diff --git a/assets/loader.js b/assets/loader.js index c0da6ee..1d3790e 100644 --- a/assets/loader.js +++ b/assets/loader.js @@ -1,10 +1,44 @@ window.addEventListener('load', function() { - if (!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { - fetch('assets/ascii.txt') - .then(response => response.text()) - .then(data => { - const asciiArtContainer = document.getElementById('ascii-art-container'); - asciiArtContainer.innerText = data; - }); + fetch('assets/ascii.txt') + .then(response => response.text()) + .then(data => { + const asciiArtContainer = document.getElementById('ascii-art-container'); + asciiArtContainer.innerText = data; + initAsciiEffect(data); + }); +}); +function adjustFontSize() { + const asciiArtContainer = document.getElementById('ascii-art-container'); + const windowWidth = window.innerWidth; + const windowHeight = window.innerHeight; + const baseFontSize = Math.min(windowWidth, windowHeight) / 150; + asciiArtContainer.style.fontSize = `${baseFontSize}px`; + asciiArtContainer.style.top = `${windowHeight / 2}px`; + asciiArtContainer.style.left = `${windowWidth / 2}px`; + asciiArtContainer.style.transform = 'translate(-50%, -50%)'; + } +window.addEventListener('resize', adjustFontSize); +window.addEventListener('load', adjustFontSize); +function initAsciiEffect(asciiArt) { + const asciiArtContainer = document.getElementById('ascii-art-container'); + const chars = asciiArt.split(''); + const updateFrequency = 1; + function getRandomIndex() { + return Math.floor(Math.random() * chars.length); } -}); \ No newline at end of file + function flipBit() { + const index = getRandomIndex(); + const char = chars[index]; + if (char === '0') { + chars[index] = '1'; + } else if (char === '1') { + chars[index] = '0'; + } else if (char === '@') { + chars[index] = '#'; + } else if (char === '#') { + chars[index] = '@'; + } + asciiArtContainer.innerText = chars.join(''); + } + setInterval(flipBit, updateFrequency); +} diff --git a/assets/style.css b/assets/style.css index 64c667a..e2f7758 100644 --- a/assets/style.css +++ b/assets/style.css @@ -2,7 +2,6 @@ font-family: 'workbench'; src: url('../assets/font.woff2') format('woff2'); } - body { background-color: #333; background-image: @@ -14,7 +13,6 @@ body { background-size: 100% 3px; background-repeat: repeat-y; } - .navbar { background: radial-gradient( @@ -30,14 +28,12 @@ body { justify-content: space-between; align-items: center; } - .logo { font-family: 'workbench', sans-serif; font-size: 1.5rem; color: #33ccffca; text-shadow: 0 0 10px #33ccffbe; } - .nav-links { list-style: none; margin: 0; @@ -45,20 +41,17 @@ body { display: flex; align-items: center; } - .nav-links li { margin-right: 20px; } - .nav-links a { font-family: 'workbench', sans-serif; font-size: 1.2rem; - color: #33ccffab; /* a pale blue color reminiscent of old CRTs */ + color: #33ccffab; text-decoration: none; transition: color 0.2s ease; text-shadow: 0 0 3px #33ccffaf; } - .nav-links a:hover { color: #33ccffda; } @@ -67,20 +60,28 @@ body { top: 50%; left: 50%; transform: translate(-50%, -50%); - font-size: calc(5px + 0.005vw); /* Dynamically adjust the font size based on the viewport width */ + font-size: 10vmin; font-family: 'Courier New', monospace; color: #33ccffab; text-shadow: 0 0 3px #33ccffaf; padding: 10px; white-space: pre; pointer-events: none; - max-height: calc(100vh - 80px); /* Subtract the max possible navbar height to restrict container size */ - overflow: auto; /* Add scrollbar to container if content exceeds its max-height */ + max-width: 90%; + max-height: 90%; + overflow: hidden; } - - -@media only screen and (max-width: 768px) { - .ascii-art-container { - display: none; +@media (max-width: 600px) { + .navbar { + flex-direction: column; + align-items: center; } -} + + .nav-links { + flex-direction: column; + align-items: center; + } + .nav-links li { + margin: 5px 0; + } +} \ No newline at end of file diff --git a/bulb/bulb.js b/bulb/bulb.js deleted file mode 100644 index 1626e1e..0000000 --- a/bulb/bulb.js +++ /dev/null @@ -1,117 +0,0 @@ -const init = () => { - - const renderer = new THREE.WebGLRenderer({ antialias:true }); - document.body.appendChild(renderer.domElement); - - const scene = new THREE.Scene(); - - const orthographiCamera = new THREE.OrthographicCamera(window.innerWidth / -2.0, window.innerWidth / +2.0, window.innerHeight / +2.0, window.innerHeight / -2.0, 0.0, 1.0); - const perspectiveCamera = new THREE.PerspectiveCamera(45.0, window.innerWidth / window.innerHeight, 0.1, 1000.0); - const controls = new THREE.OrbitControls(perspectiveCamera, renderer.domElement); - const clock = new THREE.Clock(); - - perspectiveCamera.position.set(0.0, 0.0, 5.0); - perspectiveCamera.lookAt(new THREE.Vector3(0.0, 0.0, 0.0)); - - const geometry = new THREE.PlaneBufferGeometry(window.innerWidth, window.innerHeight); - - const uniforms = { - uApp: { - value: { - time: clock.getElapsedTime(), - resolution: new THREE.Vector2(window.innerWidth, window.innerHeight) - } - }, - uCamera: { - value: { - position: perspectiveCamera.position, - viewMatrix: perspectiveCamera.matrixWorldInverse, - projectionMatrix: perspectiveCamera.projectionMatrix - } - }, - uParams: { - value: { - numIterations: 30, - convergenceCriteria: 0.0001, - finiteDifferenceEpsilon: 0.0001 - } - }, - uScene: { - value: { - backgroundColor: new THREE.Vector3(0.0, 0.0, 0.0), - lights: [ - { - direction: new THREE.Vector3(1.0, 1.0, 1.0), - ambientColor: new THREE.Vector3(1.0, 1.0, 1.0), - diffuseColor: new THREE.Vector3(1.0, 1.0, 0.0), - specularColor: new THREE.Vector3(1.0, 1.0, 0.0) - }, - { - direction: new THREE.Vector3(-1.0, -1.0, -1.0), - ambientColor: new THREE.Vector3(1.0, 1.0, 1.0), - diffuseColor: new THREE.Vector3(1.0, 0.0, 1.0), - specularColor: new THREE.Vector3(1.0, 0.0, 1.0) - } - ], - material: { - ambientColor: new THREE.Vector3(0.05, 0.05, 0.05), - diffuseColor: new THREE.Vector3(0.5, 0.5, 0.5), - specularColor: new THREE.Vector3(1.0, 1.0, 1.0), - emissionColor: new THREE.Vector3(0.0, 0.0, 0.0), - shininess: 64.0 - }, - bound: { - position: new THREE.Vector3(0.0, 0.0, 0.0), - radius: 2.0 - }, - fractal: { - power: 10, - numIterations: 4, - escapeCriteria: 2.0 - } - } - } - } - - const material = new THREE.ShaderMaterial({ - vertexShader: document.getElementById('vertexShader').textContent, - fragmentShader: document.getElementById('fragmentShader').textContent, - uniforms: uniforms - }); - - scene.add(new THREE.Mesh(geometry, material)); - - const onWindowResize = (event) => { - uniforms.uApp.value.resolution.x = window.innerWidth * window.devicePixelRatio; - uniforms.uApp.value.resolution.y = window.innerHeight * window.devicePixelRatio; - // NOTE: https://ics.media/tutorial-three/renderer_resize/ - renderer.setPixelRatio(window.devicePixelRatio); - renderer.setSize(window.innerWidth, window.innerHeight); - perspectiveCamera.aspect = window.innerWidth / window.innerHeight; - perspectiveCamera.updateProjectionMatrix(); - } - onWindowResize(); - window.addEventListener('resize', onWindowResize, false); - - const animate = () => { - - requestAnimationFrame(animate); - - const update = () => { - controls.update(); - perspectiveCamera.lookAt(new THREE.Vector3(0.0, 0.0, 0.0)); - uniforms.uApp.value.time = clock.getElapsedTime(); - uniforms.uCamera.value.position = perspectiveCamera.position; - uniforms.uCamera.value.viewMatrix = perspectiveCamera.matrixWorldInverse; - uniforms.uCamera.value.projectionMatrix = perspectiveCamera.projectionMatrix; - } - - update(); - - renderer.render(scene, orthographiCamera); - }; - - animate(); -} - -window.addEventListener("load", init); diff --git a/bulb/index.html b/bulb/index.html deleted file mode 100644 index 2bf9b99..0000000 --- a/bulb/index.html +++ /dev/null @@ -1,889 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/demo.html b/demo.html deleted file mode 100644 index 9b739fc..0000000 --- a/demo.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - -Mandelbulb ASCII Art - - - -
-
-
- -
-

-
-
-
-
-
\ No newline at end of file
diff --git a/icons/android-chrome-192x192.png b/icons/android-chrome-192x192.png
new file mode 100644
index 0000000..9336d4e
Binary files /dev/null and b/icons/android-chrome-192x192.png differ
diff --git a/icons/android-chrome-256x256.png b/icons/android-chrome-256x256.png
new file mode 100644
index 0000000..f92c34b
Binary files /dev/null and b/icons/android-chrome-256x256.png differ
diff --git a/icons/apple-touch-icon.png b/icons/apple-touch-icon.png
new file mode 100644
index 0000000..94c7028
Binary files /dev/null and b/icons/apple-touch-icon.png differ
diff --git a/icons/browserconfig.xml b/icons/browserconfig.xml
new file mode 100644
index 0000000..0f17031
--- /dev/null
+++ b/icons/browserconfig.xml
@@ -0,0 +1,9 @@
+
+
+    
+        
+            
+            #33ccff
+        
+    
+
diff --git a/icons/favicon-16x16.png b/icons/favicon-16x16.png
new file mode 100644
index 0000000..6de8c9c
Binary files /dev/null and b/icons/favicon-16x16.png differ
diff --git a/icons/favicon-32x32.png b/icons/favicon-32x32.png
new file mode 100644
index 0000000..e8a180c
Binary files /dev/null and b/icons/favicon-32x32.png differ
diff --git a/icons/favicon.ico b/icons/favicon.ico
new file mode 100644
index 0000000..f9f0ea2
Binary files /dev/null and b/icons/favicon.ico differ
diff --git a/icons/mstile-150x150.png b/icons/mstile-150x150.png
new file mode 100644
index 0000000..ee08ddc
Binary files /dev/null and b/icons/mstile-150x150.png differ
diff --git a/icons/safari-pinned-tab.svg b/icons/safari-pinned-tab.svg
new file mode 100644
index 0000000..87e3a59
--- /dev/null
+++ b/icons/safari-pinned-tab.svg
@@ -0,0 +1,38 @@
+
+
+
+
+Created by potrace 1.14, written by Peter Selinger 2001-2017
+
+
+
+
+
diff --git a/icons/site.webmanifest b/icons/site.webmanifest
new file mode 100644
index 0000000..29d1f59
--- /dev/null
+++ b/icons/site.webmanifest
@@ -0,0 +1,19 @@
+{
+    "name": "elia.network",
+    "short_name": "elia.network",
+    "icons": [
+        {
+            "src": "android-chrome-192x192.png",
+            "sizes": "192x192",
+            "type": "image/png"
+        },
+        {
+            "src": "android-chrome-256x256.png",
+            "sizes": "256x256",
+            "type": "image/png"
+        }
+    ],
+    "theme_color": "#33ccff",
+    "background_color": "#33ccff",
+    "display": "standalone"
+}
diff --git a/index.html b/index.html
index d6455fa..9b7ce39 100644
--- a/index.html
+++ b/index.html
@@ -1,15 +1,21 @@
 
 
 
-  
   
   
   
   
   
   
-
-  
+  
+  
+  
+  
+  
+  
+  
+  
+