Changed around line 1
- document.addEventListener('DOMContentLoaded', () => {
- const startDate = new Date('2023-01-01').getTime(); // Set your actual start date
-
+ document.addEventListener("DOMContentLoaded", () => {
+ const startDate = new Date("2024-01-20").getTime(); // Set your actual start date
+
-
+
- const hours = Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
+ const hours = Math.floor(
+ (difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60),
+ );
-
- document.getElementById('loveTimer').textContent =
+
+ document.getElementById("loveTimer").textContent =
- const heart = document.createElement('div');
- heart.innerHTML = '💖';
- heart.style.position = 'absolute';
- heart.style.left = Math.random() * 100 + '%';
- heart.style.top = '100%';
- heart.style.fontSize = (Math.random() * 20 + 10) + 'px';
- heart.style.animation = 'floatUp 4s linear forwards';
- document.querySelector('.floating-hearts').appendChild(heart);
+ const heart = document.createElement("div");
+ heart.innerHTML = "💖";
+ heart.style.position = "absolute";
+ heart.style.left = Math.random() * 100 + "%";
+ heart.style.top = "100%";
+ heart.style.fontSize = Math.random() * 20 + 10 + "px";
+ heart.style.animation = "floatUp 4s linear forwards";
+ document.querySelector(".floating-hearts").appendChild(heart);
- document.getElementById('sendLove').addEventListener('click', () => {
- for(let i = 0; i < 5; i++) {
+ document.getElementById("sendLove").addEventListener("click", () => {
+ for (let i = 0; i < 5; i++) {
- document.getElementById('sendNote').addEventListener('click', () => {
- const note = document.getElementById('loveNote').value;
- if(note.trim()) {
- alert('你的爱意已经传达到啦! 💕');
- document.getElementById('loveNote').value = '';
+ document.getElementById("sendNote").addEventListener("click", () => {
+ const note = document.getElementById("loveNote").value;
+ if (note.trim()) {
+ alert("你的爱意已经传达到啦! 💕");
+ document.getElementById("loveNote").value = "";
Changed around line 48: document.addEventListener('DOMContentLoaded', () => {
- const style = document.createElement('style');
+ const style = document.createElement("style");