3 changed files with 204 additions and 186 deletions
@ -1,133 +1,135 @@ |
|||||||
<html> |
<html> |
||||||
<head> |
|
||||||
<title>HAPPY BIRTHDAY PRIME!</title> |
<head> |
||||||
<link rel="stylesheet" href="index.css"> |
<title>HAPPY BIRTHDAY PRIME!</title> |
||||||
<link rel="preconnect" href="https://fonts.googleapis.com"> |
<link rel="stylesheet" href="index.css"> |
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
<link rel="preconnect" href="https://fonts.googleapis.com"> |
||||||
<link href="https://fonts.googleapis.com/css2?family=Pacifico&display=swap" rel="stylesheet"> |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
||||||
<link rel="preconnect" href="https://fonts.googleapis.com"> |
<link href="https://fonts.googleapis.com/css2?family=Pacifico&display=swap" rel="stylesheet"> |
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
<link rel="preconnect" href="https://fonts.googleapis.com"> |
||||||
<link href="https://fonts.googleapis.com/css2?family=Patrick+Hand&display=swap" rel="stylesheet"> |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
||||||
<script> |
<link href="https://fonts.googleapis.com/css2?family=Patrick+Hand&display=swap" rel="stylesheet"> |
||||||
window.onload = function() { |
<script> |
||||||
var context = new AudioContext(); |
window.onload = function () { |
||||||
} |
var context = new AudioContext(); |
||||||
|
} |
||||||
</script> |
</script> |
||||||
</head> |
</head> |
||||||
|
|
||||||
<body> |
<body> |
||||||
<h1 class="title">Happy Birthday Prime!</h1> |
<h1 class="title">Happy Birthday Prime!</h1> |
||||||
<div id="balloon-container"> |
<div id="balloon-container"> |
||||||
</div> |
</div> |
||||||
<div class="cake"> |
<div class="cake"> |
||||||
<div class="plate"></div> |
<div class="plate"></div> |
||||||
<div class="layer layer-bottom"></div> |
<div class="layer layer-bottom"></div> |
||||||
<div class="layer layer-middle"></div> |
<div class="layer layer-middle"></div> |
||||||
<div class="layer layer-top"></div> |
<div class="layer layer-top"></div> |
||||||
<div class="icing"></div> |
<div class="icing"></div> |
||||||
<div class="drip drip1"></div> |
<div class="drip drip1"></div> |
||||||
<div class="drip drip2"></div> |
<div class="drip drip2"></div> |
||||||
<div class="drip drip3"></div> |
<div class="drip drip3"></div> |
||||||
<div class="candle"> |
<div class="candle"> |
||||||
<div class="flame"></div> |
<div class="flame"></div> |
||||||
</div> |
</div> |
||||||
</div> |
</div> |
||||||
<div class="audio"> |
<div class="audio"> |
||||||
<audio controls> |
<audio controls> |
||||||
<source src="boomer.mp3"> |
<source src="boomer.mp3"> |
||||||
</audio> |
</audio> |
||||||
</div> |
</div> |
||||||
|
|
||||||
<div class="wishes"> |
<div class="wishes"> |
||||||
<script crossorigin src="https://unpkg.com/@memorista/client-ui@2/dist/index.bundle.js"></script> |
<script crossorigin src="https://unpkg.com/@memorista/client-ui@2/dist/index.bundle.js"></script> |
||||||
<x-memorista api-key="26b70af0-dd40-4280-b3c4-f2ade553a59a"></x-memorista> |
<x-memorista api-key="26b70af0-dd40-4280-b3c4-f2ade553a59a"></x-memorista> |
||||||
</div> |
</div> |
||||||
|
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/@tsparticles/confetti@3.0.3/tsparticles.confetti.bundle.min.js"></script> |
<script src="https://cdn.jsdelivr.net/npm/@tsparticles/confetti@3.0.3/tsparticles.confetti.bundle.min.js"></script> |
||||||
<script type="text/javascript"> |
<script type="text/javascript"> |
||||||
const duration = 1000 * 1000, |
const duration = 1000 * 1000, |
||||||
animationEnd = Date.now() + duration; |
animationEnd = Date.now() + duration; |
||||||
|
|
||||||
let skew = 1; |
let skew = 1; |
||||||
|
|
||||||
function randomInRange(min, max) { |
function randomInRange(min, max) { |
||||||
return Math.random() * (max - min) + min; |
return Math.random() * (max - min) + min; |
||||||
} |
} |
||||||
|
|
||||||
(function frame() { |
(function frame() { |
||||||
const timeLeft = animationEnd - Date.now(), |
const timeLeft = animationEnd - Date.now(), |
||||||
ticks = Math.max(200, 500 * (timeLeft / duration)); |
ticks = Math.max(200, 500 * (timeLeft / duration)); |
||||||
|
|
||||||
skew = Math.max(0.8, skew - 0.001); |
skew = Math.max(0.8, skew - 0.001); |
||||||
|
|
||||||
confetti({ |
confetti({ |
||||||
particleCount: 1, |
particleCount: 1, |
||||||
startVelocity: 0, |
startVelocity: 0, |
||||||
ticks: ticks, |
ticks: ticks, |
||||||
origin: { |
origin: { |
||||||
x: Math.random(), |
x: Math.random(), |
||||||
// since particles fall down, skew start toward the top |
// since particles fall down, skew start toward the top |
||||||
y: Math.random() * skew - 0.2, |
y: Math.random() * skew - 0.2, |
||||||
}, |
}, |
||||||
colors: ["#f1cf23", "#df0101"], |
colors: ["#f1cf23", "#df0101"], |
||||||
shapes: ["triangle"], |
shapes: ["triangle"], |
||||||
gravity: randomInRange(0.4, 0.6), |
gravity: randomInRange(0.4, 0.6), |
||||||
scalar: randomInRange(0.4, 1), |
scalar: randomInRange(0.4, 1), |
||||||
drift: randomInRange(-0.4, 0.4), |
drift: randomInRange(-0.4, 0.4), |
||||||
}); |
}); |
||||||
|
|
||||||
if (timeLeft > 0) { |
if (timeLeft > 0) { |
||||||
requestAnimationFrame(frame); |
requestAnimationFrame(frame); |
||||||
} |
} |
||||||
})(); |
})(); |
||||||
|
|
||||||
const balloonContainer = document.getElementById("balloon-container"); |
const balloonContainer = document.getElementById("balloon-container"); |
||||||
|
|
||||||
function random(num) { |
function random(num) { |
||||||
return Math.floor(Math.random() * num); |
return Math.floor(Math.random() * num); |
||||||
} |
} |
||||||
|
|
||||||
function getRandomStyles() { |
function getRandomStyles() { |
||||||
var r = random(255); |
var r = random(255); |
||||||
var g = random(255); |
var g = random(255); |
||||||
var b = random(255); |
var b = random(255); |
||||||
var mt = random(200); |
var mt = random(200); |
||||||
var ml = random(50); |
var ml = random(50); |
||||||
var dur = random(5) + 5; |
var dur = random(5) + 5; |
||||||
return ` |
return ` |
||||||
background-color: rgba(${r},${g},${b},0.7); |
background-color: rgba(${r},${g},${b},0.7); |
||||||
color: rgba(${r},${g},${b},0.7); |
color: rgba(${r},${g},${b},0.7); |
||||||
box-shadow: inset -7px -3px 10px rgba(${r - 10},${g - 10},${b - 10},0.7); |
box-shadow: inset -7px -3px 10px rgba(${r - 10},${g - 10},${b - 10},0.7); |
||||||
margin: ${mt}px 0 0 ${ml}px; |
margin: ${mt}px 0 0 ${ml}px; |
||||||
animation: float ${dur}s ease-in infinite |
animation: float ${dur}s ease-in infinite |
||||||
`; |
`; |
||||||
} |
} |
||||||
|
|
||||||
function createBalloons(num) { |
function createBalloons(num) { |
||||||
for (var i = num; i > 0; i--) { |
for (var i = num; i > 0; i--) { |
||||||
var balloon = document.createElement("div"); |
var balloon = document.createElement("div"); |
||||||
balloon.className = "balloon"; |
balloon.className = "balloon"; |
||||||
balloon.style.cssText = getRandomStyles(); |
balloon.style.cssText = getRandomStyles(); |
||||||
balloonContainer.append(balloon); |
balloonContainer.append(balloon); |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
function removeBalloons() { |
function removeBalloons() { |
||||||
balloonContainer.style.opacity = 0; |
balloonContainer.style.opacity = 0; |
||||||
setTimeout(() => { |
setTimeout(() => { |
||||||
balloonContainer.remove() |
balloonContainer.remove() |
||||||
}, 500) |
}, 500) |
||||||
} |
} |
||||||
|
|
||||||
window.addEventListener("load", () => { |
window.addEventListener("load", () => { |
||||||
createBalloons(30) |
createBalloons(30) |
||||||
}); |
}); |
||||||
|
|
||||||
window.addEventListener("click", () => { |
window.addEventListener("click", () => { |
||||||
removeBalloons(); |
removeBalloons(); |
||||||
}); |
}); |
||||||
|
|
||||||
</script> |
</script> |
||||||
</body> |
</body> |
||||||
</html> |
|
||||||
|
|
||||||
|
</html> |
||||||
Loading…
Reference in new issue