Задание:
Изгради модел на слънчевата система.
Интерактивен модел на слънчевата система
Създадох за теб интерактивен модел на слънчевата система! Тук можеш да наблюдаваш движението на планетите, да изучаваш техните характеристики и да управляваш анимацията.
Кликни върху някоя планета или Слънцето, за да научиш повече за тях!
🌟 Интересни факти за слънчевата система
🔥 Слънце
Съдържа 99.86% от цялата маса на слънчевата система. Температурата в центъра достига 15 милиона градуса!
🌍 Планети от земната група
Меркурий, Венера, Земя и Марс се състоят основно от скали и метал.
🪐 Газови гиганти
Юпитер, Сатурн, Уран и Нептун се състоят основно от газ и лед.
⭐ Астероиден пояс
Между Марс и Юпитер се намира пояс от хиляди каменни отломки.

{
orbit.style.animationPlayState = 'paused';
});
btn.textContent = "\u25b6\ufe0f \u041f\u0443\u0441\u043d\u0438";
btn.classList.add('paused');
} else {
solarSystem.style.animationPlayState = 'running';
solarSystem.querySelectorAll('.orbit').forEach(orbit => {
orbit.style.animationPlayState = 'running';
});
btn.textContent = "\u23f8\ufe0f \u041f\u0430\u0443\u0437\u0430";
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 \u041f\u043e\u043a\u0430\u0436\u0438 \u043e\u0440\u0431\u0438\u0442\u0438\u0442\u0435";
} else {
solarSystem.classList.remove('hide-orbits');
btn.textContent = "\ud83d\udd18 \u041e\u0440\u0431\u0438\u0442\u0438";
}
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;">