-
Notifications
You must be signed in to change notification settings - Fork 0
Add new HTML templates for various visual effects #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Aurora Waves</title> | ||
| <style> | ||
| html, | ||
| body { | ||
| margin: 0; | ||
| width: 100%; | ||
| height: 100%; | ||
| overflow: hidden; | ||
| background: radial-gradient(circle at 50% 20%, #101b32, #04060d 72%); | ||
| } | ||
|
|
||
| canvas { | ||
| display: block; | ||
| width: 100%; | ||
| height: 100%; | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <canvas id="aurora"></canvas> | ||
| <script> | ||
| const canvas = document.getElementById("aurora"); | ||
| const ctx = canvas.getContext("2d"); | ||
| let t = 0; | ||
|
|
||
| function resize() { | ||
| canvas.width = innerWidth; | ||
| canvas.height = innerHeight; | ||
| } | ||
|
|
||
| function drawWave(offset, color, amp, freq, speed, thick) { | ||
| ctx.beginPath(); | ||
| for (let x = 0; x <= canvas.width; x += 2) { | ||
| const y = | ||
| canvas.height * 0.5 + | ||
| Math.sin(x * freq + t * speed + offset) * amp + | ||
| Math.sin(x * (freq * 0.37) - t * speed * 0.8) * (amp * 0.4); | ||
| if (x === 0) ctx.moveTo(x, y); | ||
| else ctx.lineTo(x, y); | ||
| } | ||
| ctx.lineWidth = thick; | ||
| ctx.strokeStyle = color; | ||
| ctx.stroke(); | ||
| } | ||
|
|
||
| function frame() { | ||
| t += 0.016; | ||
| ctx.fillStyle = "rgba(4, 6, 13, 0.08)"; | ||
| ctx.fillRect(0, 0, canvas.width, canvas.height); | ||
|
|
||
| drawWave(0.0, "rgba(84, 255, 214, 0.25)", 100, 0.007, 1.5, 44); | ||
| drawWave(1.2, "rgba(89, 164, 255, 0.22)", 130, 0.006, 1.1, 58); | ||
| drawWave(2.4, "rgba(201, 122, 255, 0.20)", 85, 0.009, 1.8, 36); | ||
|
|
||
| requestAnimationFrame(frame); | ||
| } | ||
|
|
||
| resize(); | ||
| window.addEventListener("resize", resize); | ||
| requestAnimationFrame(frame); | ||
| </script> | ||
| </body> | ||
| </html> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Digital Clock</title> | ||
| <style> | ||
| :root { | ||
| --bg-1: #05060a; | ||
| --bg-2: #10182b; | ||
| --glow: #37f7ff; | ||
| --text: #e9fcff; | ||
| } | ||
|
|
||
| html, | ||
| body { | ||
| margin: 0; | ||
| width: 100%; | ||
| height: 100%; | ||
| overflow: hidden; | ||
| } | ||
|
|
||
| body { | ||
| display: grid; | ||
| place-items: center; | ||
| background: radial-gradient( | ||
| circle at 30% 30%, | ||
| var(--bg-2), | ||
| var(--bg-1) | ||
| ); | ||
| color: var(--text); | ||
| font-family: "Courier New", monospace; | ||
| } | ||
|
|
||
| .panel { | ||
| text-align: center; | ||
| padding: 32px 40px; | ||
| border: 1px solid rgba(55, 247, 255, 0.25); | ||
| border-radius: 16px; | ||
| background: rgba(8, 12, 24, 0.62); | ||
| backdrop-filter: blur(5px); | ||
| box-shadow: 0 0 40px rgba(55, 247, 255, 0.12); | ||
| } | ||
|
|
||
| .time { | ||
| font-size: clamp(56px, 14vw, 140px); | ||
| letter-spacing: 0.08em; | ||
| color: var(--glow); | ||
| text-shadow: | ||
| 0 0 8px rgba(55, 247, 255, 0.7), | ||
| 0 0 20px rgba(55, 247, 255, 0.35); | ||
| } | ||
|
|
||
| .date { | ||
| margin-top: 12px; | ||
| font-size: clamp(14px, 2.8vw, 26px); | ||
| letter-spacing: 0.08em; | ||
| opacity: 0.9; | ||
| } | ||
|
|
||
| .pulse { | ||
| animation: pulse 1.4s ease-in-out infinite; | ||
| } | ||
|
|
||
| @keyframes pulse { | ||
| 0%, | ||
| 100% { | ||
| opacity: 1; | ||
| } | ||
| 50% { | ||
| opacity: 0.3; | ||
| } | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <div class="panel"> | ||
| <div id="time" class="time">00:00:00</div> | ||
| <div id="date" class="date">---</div> | ||
| </div> | ||
|
|
||
| <script> | ||
| const timeEl = document.getElementById("time"); | ||
| const dateEl = document.getElementById("date"); | ||
|
|
||
| function updateClock() { | ||
| const now = new Date(); | ||
| const hh = String(now.getHours()).padStart(2, "0"); | ||
| const mm = String(now.getMinutes()).padStart(2, "0"); | ||
| const ss = String(now.getSeconds()).padStart(2, "0"); | ||
|
|
||
| timeEl.innerHTML = `${hh}<span class="pulse">:</span>${mm}<span class="pulse">:</span>${ss}`; | ||
|
miguel-l-b marked this conversation as resolved.
|
||
| dateEl.textContent = now.toLocaleDateString(undefined, { | ||
| weekday: "long", | ||
| year: "numeric", | ||
| month: "long", | ||
| day: "2-digit", | ||
| }); | ||
| } | ||
|
|
||
| updateClock(); | ||
| setInterval(updateClock, 1000); | ||
| </script> | ||
| </body> | ||
| </html> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Doom Fire</title> | ||
| <style> | ||
| html, | ||
| body { | ||
| margin: 0; | ||
| width: 100%; | ||
| height: 100%; | ||
| overflow: hidden; | ||
| background: #000; | ||
| } | ||
|
|
||
| canvas { | ||
| width: 100%; | ||
| height: 100%; | ||
| image-rendering: pixelated; | ||
| display: block; | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <canvas id="fire"></canvas> | ||
| <script> | ||
| const canvas = document.getElementById("fire"); | ||
| const ctx = canvas.getContext("2d", { alpha: false }); | ||
|
|
||
| const palette = [ | ||
| [7, 7, 7], | ||
| [31, 7, 7], | ||
| [47, 15, 7], | ||
| [71, 15, 7], | ||
| [87, 23, 7], | ||
| [103, 31, 7], | ||
| [119, 31, 7], | ||
| [143, 39, 7], | ||
| [159, 47, 7], | ||
| [175, 63, 7], | ||
| [191, 71, 7], | ||
| [199, 71, 7], | ||
| [223, 79, 7], | ||
| [223, 87, 7], | ||
| [223, 87, 7], | ||
| [215, 95, 7], | ||
| [215, 95, 7], | ||
| [215, 103, 15], | ||
| [207, 111, 15], | ||
| [207, 119, 15], | ||
| [207, 127, 15], | ||
| [207, 135, 23], | ||
| [199, 135, 23], | ||
| [199, 143, 23], | ||
| [199, 151, 31], | ||
| [191, 159, 31], | ||
| [191, 159, 31], | ||
| [191, 167, 39], | ||
| [191, 167, 39], | ||
| [191, 175, 47], | ||
| [183, 175, 47], | ||
| [183, 183, 47], | ||
| [183, 183, 55], | ||
| [207, 207, 111], | ||
| [223, 223, 159], | ||
| [239, 239, 199], | ||
| [255, 255, 255], | ||
| ]; | ||
|
|
||
| let cols = 0; | ||
| let rows = 0; | ||
| let fire = []; | ||
|
|
||
| function resize() { | ||
| canvas.width = window.innerWidth; | ||
| canvas.height = window.innerHeight; | ||
|
|
||
| cols = Math.max(120, Math.floor(canvas.width / 5)); | ||
| rows = Math.max(80, Math.floor(canvas.height / 5)); | ||
| fire = new Uint8Array(cols * rows); | ||
|
|
||
| for (let x = 0; x < cols; x++) { | ||
| fire[(rows - 1) * cols + x] = palette.length - 1; | ||
| } | ||
| } | ||
|
|
||
| function updateFire() { | ||
| for (let y = 1; y < rows; y++) { | ||
| for (let x = 0; x < cols; x++) { | ||
| const src = y * cols + x; | ||
| const decay = (Math.random() * 3) | 0; | ||
| const dstX = Math.max( | ||
| 0, | ||
| Math.min(cols - 1, x + ((Math.random() * 3) | 0) - 1), | ||
| ); | ||
| const dst = (y - 1) * cols + dstX; | ||
| fire[dst] = Math.max(0, fire[src] - decay); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| function renderFire() { | ||
| const img = ctx.createImageData(cols, rows); | ||
| for (let i = 0; i < fire.length; i++) { | ||
| const c = palette[fire[i]]; | ||
| const p = i * 4; | ||
| img.data[p] = c[0]; | ||
| img.data[p + 1] = c[1]; | ||
| img.data[p + 2] = c[2]; | ||
| img.data[p + 3] = 255; | ||
| } | ||
|
|
||
| const off = document.createElement("canvas"); | ||
| off.width = cols; | ||
| off.height = rows; | ||
| off.getContext("2d").putImageData(img, 0, 0); | ||
|
|
||
| ctx.imageSmoothingEnabled = false; | ||
| ctx.drawImage(off, 0, 0, canvas.width, canvas.height); | ||
|
miguel-l-b marked this conversation as resolved.
|
||
| } | ||
|
|
||
| function loop() { | ||
| updateFire(); | ||
| renderFire(); | ||
| requestAnimationFrame(loop); | ||
| } | ||
|
|
||
| resize(); | ||
| window.addEventListener("resize", resize); | ||
| requestAnimationFrame(loop); | ||
| </script> | ||
| </body> | ||
| </html> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Matrix Rain</title> | ||
| <style> | ||
| html, | ||
| body { | ||
| margin: 0; | ||
| width: 100%; | ||
| height: 100%; | ||
| overflow: hidden; | ||
| background: #030a03; | ||
| } | ||
|
|
||
| canvas { | ||
| display: block; | ||
| width: 100%; | ||
| height: 100%; | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <canvas id="c"></canvas> | ||
| <script> | ||
| const canvas = document.getElementById("c"); | ||
| const ctx = canvas.getContext("2d"); | ||
|
|
||
| let w = 0; | ||
| let h = 0; | ||
| let columns = 0; | ||
| let drops = []; | ||
|
|
||
| const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ$#@%&*+-"; | ||
| const fontSize = 16; | ||
|
|
||
| function resize() { | ||
| w = canvas.width = window.innerWidth; | ||
| h = canvas.height = window.innerHeight; | ||
|
miguel-l-b marked this conversation as resolved.
|
||
| columns = Math.floor(w / fontSize); | ||
| drops = Array.from({ length: columns }, () => Math.random() * -100); | ||
| } | ||
|
|
||
| function draw() { | ||
| ctx.fillStyle = "rgba(3, 10, 3, 0.14)"; | ||
| ctx.fillRect(0, 0, w, h); | ||
|
|
||
| ctx.font = `${fontSize}px monospace`; | ||
| for (let i = 0; i < columns; i++) { | ||
| const text = chars[(Math.random() * chars.length) | 0]; | ||
| const x = i * fontSize; | ||
| const y = drops[i] * fontSize; | ||
|
|
||
| ctx.fillStyle = "#c8ffc8"; | ||
| ctx.fillText(text, x, y); | ||
| ctx.fillStyle = "#23ff23"; | ||
| ctx.fillText(text, x, y + fontSize); | ||
|
|
||
| if (y > h && Math.random() > 0.98) { | ||
| drops[i] = Math.random() * -20; | ||
| } | ||
| drops[i] += 0.9; | ||
| } | ||
| } | ||
|
|
||
| resize(); | ||
| window.addEventListener("resize", resize); | ||
| setInterval(draw, 33); | ||
| </script> | ||
|
miguel-l-b marked this conversation as resolved.
|
||
| </body> | ||
| </html> | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.