Zadatak:
Izgradi model Sunčevog sustava.
Interaktivni model Sunčevog sustava
Izradio sam za tebe interaktivni model Sunčevog sustava! Ovdje možeš promatrati kretanje planeta, proučavati njihove karakteristike i upravljati animacijom.
Klikni na bilo koji planet ili Sunce da saznaš više o njima!
🌟 Zanimljivosti o Sunčevom sustavu
🔥 Sunce
Sadrži 99.86% ukupne mase Sunčevog sustava. Temperatura u središtu doseže 15 milijuna stupnjeva!
🌍 Terestrički planeti
Merkur, Venera, Zemlja i Mars sastoje se uglavnom od stijena i metala.
🪐 Plinoviti divovi
Jupiter, Saturn, Uran i Neptun sastoje se uglavnom od plina i leda.
⭐ Asteroidni pojas
Između Marsa i Jupitera nalazi se pojas s tisućama kamenih krhotina.

{
orbit.style.animationPlayState = 'paused';
});
btn.textContent = "\u25b6\ufe0f Pokreni";
btn.classList.add('paused');
} else {
solarSystem.style.animationPlayState = 'running';
solarSystem.querySelectorAll('.orbit').forEach(orbit => {
orbit.style.animationPlayState = 'running';
});
btn.textContent = "\u23f8\ufe0f Pauza";
btn.classList.remove('paused');
}
isPlaying = !isPlaying;
};
window.toggleOrbits = function() {
const solarSystem = document.getElementById('solarSystem');
const btn = document.getElementById('orbitToggleBtn');
if (!solarSystem || !btn) return;
if (showOrbits) {
solarSystem.classList.add('hide-orbits');
btn.textContent = "\u2b55 Prika\u017ei orbite";
} else {
solarSystem.classList.remove('hide-orbits');
btn.textContent = "\ud83d\udd18 Orbite";
}
showOrbits = !showOrbits;
};
window.changeSpeed = function(speed) {
const speedValue = document.getElementById('speedValue');
const solarSystem = document.getElementById('solarSystem');
if (!speedValue || !solarSystem) return;
animationSpeed = parseFloat(speed);
speedValue.textContent = speed + 'x';
solarSystem.querySelectorAll('.orbit').forEach((orbit, index) => {
const baseDuration = [10, 15, 20, 30, 60, 90, 120, 165][index] || 20;
orbit.style.animationDuration = (baseDuration / animationSpeed) + 's';
});
};
window.resetAnimation = function() {
const solarSystem = document.getElementById('solarSystem');
if (!solarSystem) return;
solarSystem.querySelectorAll('.orbit').forEach(orbit => {
orbit.style.animation = 'none';
});
setTimeout(() => {
solarSystem.querySelectorAll('.orbit').forEach((orbit, index) => {
orbit.style.animation = '';
const baseDuration = [10, 15, 20, 30, 60, 90, 120, 165][index] || 20;
orbit.style.animationDuration = (baseDuration / animationSpeed) + 's';
});
}, 10);
};
window.showPlanetInfo = function(planetId) {
const panel = document.getElementById('planetInfoPanel');
const nameEl = document.getElementById('planetName');
const detailsEl = document.getElementById('planetDetails');
if (!panel || !nameEl || !detailsEl) return;
const planet = planetData[planetId];
if (planet) {
nameEl.textContent = planet.name;
detailsEl.innerHTML = '
' + planet.details + '
';
panel.classList.add('active');
}
};
window.closePlanetInfo = function() {
const panel = document.getElementById('planetInfoPanel');
if (panel) {
panel.classList.remove('active');
}
};
// Инициализация
setTimeout(() => {
changeSpeed(1);
}, 100);
})()"
style="display: none;">