Spaces:
Running
Running
decorações como notas musicais
Browse files
script.js
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
|
|
| 1 |
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
// Smooth scroll for anchor links
|
| 3 |
-
|
| 4 |
anchor.addEventListener('click', function (e) {
|
| 5 |
e.preventDefault();
|
| 6 |
document.querySelector(this.getAttribute('href')).scrollIntoView({
|
|
|
|
| 1 |
+
|
| 2 |
document.addEventListener('DOMContentLoaded', function() {
|
| 3 |
+
// Add floating music notes
|
| 4 |
+
for (let i = 0; i < 12; i++) {
|
| 5 |
+
const note = document.createElement('div');
|
| 6 |
+
note.className = 'music-note';
|
| 7 |
+
note.innerHTML = '♪';
|
| 8 |
+
note.style.left = `${Math.random() * 100}vw`;
|
| 9 |
+
note.style.top = `${Math.random() * 100}vh`;
|
| 10 |
+
note.style.animationDelay = `${Math.random() * 3}s`;
|
| 11 |
+
note.style.fontSize = `${1 + Math.random() * 2}rem`;
|
| 12 |
+
document.body.appendChild(note);
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
// Smooth scroll for anchor links
|
| 16 |
+
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
| 17 |
anchor.addEventListener('click', function (e) {
|
| 18 |
e.preventDefault();
|
| 19 |
document.querySelector(this.getAttribute('href')).scrollIntoView({
|