|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => { |
|
|
|
|
|
const body = document.body; |
|
|
let vibeMode = false; |
|
|
|
|
|
|
|
|
const vibeToggle = document.createElement('button'); |
|
|
vibeToggle.innerHTML = 'π΅'; |
|
|
vibeToggle.style.cssText = ` |
|
|
position: fixed; |
|
|
bottom: 20px; |
|
|
right: 20px; |
|
|
width: 60px; |
|
|
height: 60px; |
|
|
border-radius: 50%; |
|
|
background: linear-gradient(45deg, #ff6b6b, #4ecdc4); |
|
|
border: none; |
|
|
font-size: 24px; |
|
|
cursor: pointer; |
|
|
z-index: 1000; |
|
|
transition: all 0.3s; |
|
|
box-shadow: 0 4px 15px rgba(0,0,0,0.3); |
|
|
`; |
|
|
|
|
|
vibeToggle.addEventListener('click', () => { |
|
|
vibeMode = !vibeMode; |
|
|
if (vibeMode) { |
|
|
body.classList.add('vibe-mode'); |
|
|
vibeToggle.style.transform = 'scale(1.2) rotate(360deg)'; |
|
|
document.querySelectorAll('.feature-card, .primary-button, .logo').forEach(el => { |
|
|
el.classList.add('vibe-mode'); |
|
|
}); |
|
|
} else { |
|
|
body.classList.remove('vibe-mode'); |
|
|
vibeToggle.style.transform = 'scale(1) rotate(0deg)'; |
|
|
document.querySelectorAll('.vibe-mode').forEach(el => { |
|
|
el.classList.remove('vibe-mode'); |
|
|
}); |
|
|
} |
|
|
}); |
|
|
|
|
|
document.body.appendChild(vibeToggle); |
|
|
|
|
|
|
|
|
const typewriter = document.getElementById('typewriter'); |
|
|
if (typewriter) { |
|
|
const texts = ["πΈ Jam", "π΅ Vibe", "πΉ Code", "π€ Flow"]; |
|
|
let count = 0; |
|
|
let index = 0; |
|
|
let currentText = ''; |
|
|
let letter = ''; |
|
|
|
|
|
(function type() { |
|
|
if (count === texts.length) { |
|
|
count = 0; |
|
|
} |
|
|
currentText = texts[count]; |
|
|
letter = currentText.slice(0, ++index); |
|
|
|
|
|
typewriter.textContent = letter; |
|
|
if (letter.length === currentText.length) { |
|
|
count++; |
|
|
index = 0; |
|
|
setTimeout(type, 1500); |
|
|
} else { |
|
|
setTimeout(type, 150); |
|
|
} |
|
|
})(); |
|
|
} |
|
|
|
|
|
|
|
|
document.querySelectorAll('a[href^="#"]').forEach(anchor => { |
|
|
anchor.addEventListener('click', function (e) { |
|
|
e.preventDefault(); |
|
|
document.querySelector(this.getAttribute('href')).scrollIntoView({ |
|
|
behavior: 'smooth' |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |