\n
",
"css": ".body { margin: 0; padding: 0; overflow: hidden; background: #000; color: #fff; font-family: 'Courier New', Courier, monospace; }\n#app { width: 100vw; height: 100vh; position: relative; overflow: hidden; background: #000; }\n#canvas-container { position: relative; width: 100%; height: 100%; }\n#glCanvas { width: 100%; height: 100%; display: block; }\n#overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; z-index: 10; }\n.glitch-text { font-size: 3rem; letter-spacing: 0.5rem; color: #fff; text-shadow: 2px 0 #f0f, 0 -2px #0ff; animation: glitch 1s infinite; }\n.fade-text { font-size: 1.2rem; opacity: 0.6; animation: fade 4s infinite alternate; }\n@keyframes glitch { 0% { transform: translate(0); } 20% { transform: translate(-2px, 2px); } 40% { transform: translate(-2px, -2px); } 60% { transform: translate(2px, 2px); } 80% { transform: translate(2px, -2px); } 100% { transform: translate(0); } }\n@keyframes fade { from { opacity: 0.3; } to { opacity: 0.7; } }",
"js": "const canvas = document.getElementById('glCanvas');\nconst gl = canvas.getContext('webgl');\n\nif (!gl) {\n alert('WebGL not supported');\n}\n\nconst vsSource = `\n attribute vec4 a_position;\n void main() {\n gl_Position = a_position;\n }\n`;\n\nconst fsSource = `\n precision highp float;\n uniform float u_time;\n uniform vec2 u_resolution;\n \n float hash(float n) {\n return fract(sin(n) * 43758.5453123);\n }\n \n float noise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n f = f * f * (3.0 - 2.0 * f);\n float n = dot(i, vec2(hash(dot(i, vec2(12.9898, 78.233)), hash(dot(i, vec2(12.9898, 78.233)))));\n return mix(n, n, f.x + f.y);\n }\n\n void main() {\n vec2 uv = gl_FragCoord.xy / u_resolution.xy;\n vec2 centered_uv = uv * 2.0 - 1.0;\n float t = u_time * 0.2;\n \n float dist = length(centered_uv);\n float glow = 0.05 / (dist + 0.01);\n \n float lines = sin(uv.y * 100.0 + u_time * 2.0) * 0.5 + 0.5;\n float scanlines = smoothstep(0.4, 0.6, lines);\n \n vec3 color = vec3(0.0, 0.0, 0.1);\n color += vec3(0.1, 0.1, 0.2) * (1.0 - dist);\n color += vec3(0.0, 0.5, 1.0) * glow * 0.3;\n \n float noise_val = hash(uv.x * 100.0 + uv.y * 100.0 + u_time);\n color += vec3(noise_val * 0.05);\n \n float ring = smoothstep(0.4, 0.39, dist) - smoothstep(0.3, 0.29, dist);\n color += vec3(0.4, 0.6, 1.0) * ring * (sin(u_time * 0.5) * 0.5 + 0.5);\n \n gl_FragCoord.xy = gl_FragCoord.xy;\n gl_FragColor = vec4(color * scanlines, 1.0);\n }\n`;\n\nfunction createShader(gl, type, source) {\n return gl.createShader(type);\n // Note: This part is usually handled by an internal method\n // Re-implementing basic shader creation for the window\n}\n\n// Simplified shader setup for the purpose of the response\nfunction init() {\n const vertexShader = gl.createShader(gl Upcoming Shader implementation logic here for JS string)\n}\n\n// Correcting the JS to be a fully functional WebGL implementation within a string\n// Overriding the logic to actually render\n\nconst vertexShaderSource = vsSource;\nconst fragmentShaderSource = fsSource;\n\nfunction compileShader(gl, source, type) {\n const shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n return shader;\n}\n\nfunction createProgram(gl, vertexShader, fragmentShader) {\n const program = gl.createProgram();\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n gl.linkProgram(program);\n return program;\n}\n\n// Redefining based on the context of the window\n// But since this is limited, I will use a simpler canvas 2D API for a more robust output in these specific environments\n\n// I will rewrite JS to 2D canvas for stability across all environments while maintaining the aesthetic\n\nconst ctx = canvas.getContext('2d');\ncanvas.width = window.innerWidth;\ncanvas.height = window.innerHeight;\n\nlet particles = [];\n\nfunction initParticles() {\n particles = [];\n for(let i=0; i<100; i++) {\n particles.push({\n x: Math.random() * canvas.width,\n y: Math.random() * canvas.height,\n vx: (Math.random() - 0.5) * 0.5,\n vy: (Math.random() - 0.5) * 0.5,\n size: Math.random() * 2,\n color: `rgba(100, 150, 255, ${Math.random() * 0.5 + 0.2})`\n });\n }\n}\n\nfunction draw() {\n ctx.fillStyle = 'rgba(0, 0, 5, 0.1)';\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n \n ctx.strokeStyle = 'rgba(100, 150, 255, 0.1)';\n ctx.lineWidth = 0.5;\n \n particles.forEach(p => {\n p.x += p.vx;\n p.y += p.vy;\n \n if(p.x < 0 || p.x > canvas.width) p.vx *= -1;\n if(p.y < 0 || p.y > canvas.height) p.vy *= -1;\n \n ctx.beginPath();\n ctx.arc(p.x, p.y, p.size, 0, Math.PI * 2);\n ctx.fillStyle = p.color;\n ctx.fill();\n \n // Connection lines\n particles.forEach(p2 => {\n let dx = p.x - p2.x;\n let dx2 = p.y - p2.y;\n let dist = Math.sqrt(dx*dx + dx2*dx2);\n if(dist < 100) {\n ctx.beginPath();n// removing this typo\n ctx.moveTo(p.x, p.y);\n ctx.moveTo(p.x, p.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n }\n });\n });\n \n requestAnimationFrame(draw);\n}\n\ninitParticles();\nwindow.addEventListener('resize', () =>
\n \n
\n\n
\n MELANCOLÍA DIGITAL
\nFragmentos de una memoria que nunca existió
\n