npv2k1 commited on
Commit
05f8903
·
verified ·
1 Parent(s): ea00b01

Thêm nhiều hiệu ứng động hơn, hiệu ứng tuyết rơi nữa. Chuển chuột thành hình trái tim

Browse files
Files changed (3) hide show
  1. index.html +15 -1
  2. script.js +55 -2
  3. style.css +37 -0
index.html CHANGED
@@ -192,6 +192,20 @@
192
  feather.replace();
193
  </script>
194
  <script src="script.js"></script>
195
- <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  </body>
197
  </html>
 
192
  feather.replace();
193
  </script>
194
  <script src="script.js"></script>
195
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
196
+ <style>
197
+ /* Add subtle heartbeat to hero section */
198
+ section.relative h1 {
199
+ animation: heartbeat 1.5s ease-in-out infinite;
200
+ }
201
+
202
+ @keyframes heartbeat {
203
+ 0% { transform: scale(1); }
204
+ 25% { transform: scale(1.05); }
205
+ 50% { transform: scale(1); }
206
+ 75% { transform: scale(1.03); }
207
+ 100% { transform: scale(1); }
208
+ }
209
+ </style>
210
  </body>
211
  </html>
script.js CHANGED
@@ -1,8 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  // Intersection Observer for section animations
2
  document.addEventListener('DOMContentLoaded', () => {
3
- const sections = document.querySelectorAll('section');
 
4
 
5
- const observer = new IntersectionObserver((entries) => {
 
6
  entries.forEach(entry => {
7
  if (entry.isIntersecting) {
8
  entry.target.classList.add('show');
 
1
+
2
+ // Create snowflakes
3
+ function createSnowflakes() {
4
+ const snowflakesCount = 50;
5
+ const body = document.body;
6
+
7
+ for (let i = 0; i < snowflakesCount; i++) {
8
+ setTimeout(() => {
9
+ const snowflake = document.createElement('div');
10
+ snowflake.classList.add('snowflake');
11
+ snowflake.innerHTML = '❄';
12
+
13
+ // Random properties
14
+ const size = Math.random() * 15 + 5;
15
+ const left = Math.random() * window.innerWidth;
16
+ const duration = Math.random() * 10 + 5;
17
+ const delay = Math.random() * 5;
18
+ const opacity = Math.random() * 0.5 + 0.5;
19
+
20
+ snowflake.style.left = `${left}px`;
21
+ snowflake.style.fontSize = `${size}px`;
22
+ snowflake.style.animationDuration = `${duration}s`;
23
+ snowflake.style.animationDelay = `${delay}s`;
24
+ snowflake.style.opacity = opacity;
25
+
26
+ body.appendChild(snowflake);
27
+
28
+ // Remove snowflake after animation completes
29
+ setTimeout(() => {
30
+ snowflake.remove();
31
+ }, duration * 1000);
32
+ }, i * 300);
33
+ }
34
+
35
+ // Keep creating snowflakes
36
+ setInterval(createSnowflakes, 15000);
37
+ }
38
+
39
+ // Add floating animation to elements
40
+ function addFloatingEffects() {
41
+ const floatingElements = document.querySelectorAll('h1, h2, h3, .countdown-box');
42
+ floatingElements.forEach(el => {
43
+ el.style.animation = 'float 3s ease-in-out infinite';
44
+ });
45
+
46
+ const pulseElements = document.querySelectorAll('button, a[href="#rsvp"], a[href="#details"]');
47
+ pulseElements.forEach(el => {
48
+ el.style.animation = 'pulse 2s ease-in-out infinite';
49
+ });
50
+ }
51
+
52
  // Intersection Observer for section animations
53
  document.addEventListener('DOMContentLoaded', () => {
54
+ createSnowflakes();
55
+ addFloatingEffects();
56
 
57
+ const sections = document.querySelectorAll('section');
58
+ const observer = new IntersectionObserver((entries) => {
59
  entries.forEach(entry => {
60
  if (entry.isIntersecting) {
61
  entry.target.classList.add('show');
style.css CHANGED
@@ -1,8 +1,45 @@
 
1
  /* Smooth scrolling */
2
  html {
3
  scroll-behavior: smooth;
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  }
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  /* Custom scrollbar */
7
  ::-webkit-scrollbar {
8
  width: 8px;
 
1
+
2
  /* Smooth scrolling */
3
  html {
4
  scroll-behavior: smooth;
5
+ cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23ff3366'><path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/></svg>"), auto;
6
+ }
7
+
8
+ /* Heart cursor for clickable elements */
9
+ a, button, input[type="submit"], label {
10
+ cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='%23ff3366'><path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/></svg>"), pointer;
11
+ }
12
+
13
+ /* Floating animation */
14
+ @keyframes float {
15
+ 0% { transform: translateY(0px); }
16
+ 50% { transform: translateY(-10px); }
17
+ 100% { transform: translateY(0px); }
18
  }
19
 
20
+ /* Pulse animation */
21
+ @keyframes pulse {
22
+ 0% { transform: scale(1); }
23
+ 50% { transform: scale(1.05); }
24
+ 100% { transform: scale(1); }
25
+ }
26
+
27
+ /* Snowflakes */
28
+ .snowflake {
29
+ position: fixed;
30
+ top: -10px;
31
+ z-index: 9999;
32
+ color: white;
33
+ user-select: none;
34
+ pointer-events: none;
35
+ animation: fall linear forwards;
36
+ }
37
+
38
+ @keyframes fall {
39
+ to {
40
+ transform: translateY(100vh);
41
+ }
42
+ }
43
  /* Custom scrollbar */
44
  ::-webkit-scrollbar {
45
  width: 8px;