// Power Rangers Fan Site - JavaScript
// Neocities compatible
// Team selector function
function selectTeam(team) {
const teams = {
'mmpr': {
name: 'Mighty Morphin Power Rangers',
leader: 'Jason Lee Scott (Red Ranger)',
info: 'The original team! Five teenagers with attitude chosen by Zordon!',
color: '#ff0000'
},
'zeo': {
name: 'Power Rangers Zeo',
leader: 'Tommy Oliver (Red Ranger)',
info: 'Powered by the Zeo Crystal! More powerful than ever!',
color: '#ffd700'
},
'turbo': {
name: 'Power Rangers Turbo',
leader: 'Tommy Oliver / TJ Johnson (Red Ranger)',
info: 'Shift into Turbo! Racing-themed powers!',
color: '#ff0000'
},
'space': {
name: 'Power Rangers in Space',
leader: 'Andros (Red Space Ranger)',
info: 'Let\'s rocket! Taking the fight to the stars!',
color: '#ff0000'
}
};
const selectedTeam = teams[team];
const message = `🎯 YOU SELECTED: ${selectedTeam.name}\n\n` +
`👑 Leader: ${selectedTeam.leader}\n\n` +
`âš¡ ${selectedTeam.info}\n\n` +
`GO GO POWER RANGERS!`;
alert(message);
// Update the page background temporarily
const grid = document.querySelector('.morphin-grid');
const originalBg = grid.style.background;
grid.style.background = `radial-gradient(circle, ${selectedTeam.color} 0%, #000 100%)`;
setTimeout(() => {
grid.style.background = originalBg;
}, 2000);
}
// Ranger selector function
function selectRanger(color) {
const rangers = {
'red': {
title: 'Red Ranger - The Leader! 🔴',
name: 'Jason Lee Scott / Tommy Oliver',
zord: 'Tyrannosaurus / Red Dragon Thunderzord',
info: 'The fearless leader of the team!'
},
'blue': {
title: 'Blue Ranger - The Smart One! 🔵',
name: 'Billy Cranston',
zord: 'Triceratops / Unicorn Thunderzord',
info: 'The genius inventor and tech expert!'
},
'yellow': {
title: 'Yellow Ranger - The Strong One! 🟡',
name: 'Trini Kwan / Aisha Campbell',
zord: 'Saber-Toothed Tiger / Griffin Thunderzord',
info: 'Master of martial arts and compassion!'
},
'pink': {
title: 'Pink Ranger - The Graceful One! 🩷',
name: 'Kimberly Hart / Katherine Hillard',
zord: 'Pterodactyl / Firebird Thunderzord',
info: 'Gymnast extraordinaire with a heart of gold!'
},
'black': {
title: 'Black Ranger - The Cool One! âš«',
name: 'Zack Taylor / Adam Park',
zord: 'Mastodon / Lion Thunderzord',
info: 'Hip-hop kido master and the coolest dancer!'
},
'green': {
title: 'Green Ranger - The Dragon! 🟢',
name: 'Tommy Oliver',
zord: 'Dragonzord',
info: 'The legendary sixth ranger with the Dragon Dagger!'
},
'white': {
title: 'White Ranger - The Tiger! ⚪',
name: 'Tommy Oliver',
zord: 'Tigerzord / White Shogunzord',
info: 'The new leader with the power of the White Tiger!'
}
};
const ranger = rangers[color];
const infoDiv = document.getElementById('ranger-info');
infoDiv.innerHTML = `
âš¡ ${ranger.title} âš¡
Ranger: ${ranger.name}
Zord: ${ranger.zord}
Bio: ${ranger.info}
`;
infoDiv.style.textShadow = `0 0 10px ${color}`;
// Scroll to the info section
infoDiv.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}
// Konami code easter egg
let konamiCode = [];
const konamiPattern = ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown',
'ArrowLeft', 'ArrowRight', 'ArrowLeft', 'ArrowRight',
'b', 'a'];
document.addEventListener('keydown', (e) => {
konamiCode.push(e.key);
konamiCode = konamiCode.slice(-10);
if (konamiCode.join(',') === konamiPattern.join(',')) {
activateMorphinPower();
}
});
// Easter egg activation
function activateMorphinPower() {
alert('🎉 IT\'S MORPHIN TIME! 🎉\n\nYou unlocked the secret Ranger code!\n\nMay the Power protect you!');
// Add rainbow animation to body
document.body.style.animation = 'rainbowShift 2s ease infinite';
// Create power coins falling effect
createPowerCoins();
setTimeout(() => {
document.body.style.animation = '';
}, 5000);
}
// Create falling power coins effect
function createPowerCoins() {
const coins = ['🦖', 'ðŸ¦', 'ðŸ¯', '🦅', '🦣', 'ðŸ‰'];
for (let i = 0; i < 20; i++) {
setTimeout(() => {
const coin = document.createElement('div');
coin.textContent = coins[Math.floor(Math.random() * coins.length)];
coin.style.position = 'fixed';
coin.style.left = Math.random() * window.innerWidth + 'px';
coin.style.top = '-50px';
coin.style.fontSize = '3em';
coin.style.zIndex = '9999';
coin.style.pointerEvents = 'none';
coin.style.transition = 'top 3s linear, opacity 2s ease-out';
document.body.appendChild(coin);
setTimeout(() => {
coin.style.top = window.innerHeight + 'px';
coin.style.opacity = '0';
}, 10);
setTimeout(() => {
coin.remove();
}, 3000);
}, i * 200);
}
}
// Random power ranger quote on page load
const rangerQuotes = [
"It's Morphin Time!",
"Go Go Power Rangers!",
"May the Power protect you!",
"We need Dinozord power NOW!",
"Alpha, teleport us out of here!",
"Back to action!",
"Let's show them some Megazord power!",
"Rangers together, Samurai forever!",
"Shift into Turbo!",
"Let's rocket!"
];
window.addEventListener('load', () => {
console.log('%câš¡ ' + rangerQuotes[Math.floor(Math.random() * rangerQuotes.length)] + ' âš¡',
'color: #ffd700; font-size: 20px; font-weight: bold; text-shadow: 2px 2px #000;');
console.log('%cWelcome to the Ultimate Power Rangers Fan Site!',
'color: #ff0000; font-size: 16px; font-weight: bold;');
});
// Visitor counter animation (fake but fun!)
let visitorCount = 2845;
function updateVisitorCounter() {
const counter = document.querySelector('.visitor-counter');
if (counter) {
visitorCount++;
counter.innerHTML = `ðŸ‘ï¸ VISITORS: ${String(visitorCount).padStart(7, '0')} ðŸ‘ï¸`;
}
}
// Update counter every 30 seconds for fun
setInterval(updateVisitorCounter, 30000);
// Add click sound effect (optional - commented out as it needs audio file)
/*
function playMorphSound() {
const audio = new Audio('morph.mp3');
audio.play();
}
*/