You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project is an interactive, web-based visualization of our solar system, created using HTML5 Canvas and JavaScript. It provides an engaging and educational experience for users to explore the planets, asteroid belts, and other celestial bodies in our solar system.
5
+
6
+
## Features
7
+
8
+
- Realistic representation of the Sun, planets, and their orbits
9
+
- Animated planetary motion with varying speeds
10
+
- Asteroid belts (Main Asteroid Belt, Earth's Asteroid Belt, and Kuiper Belt)
11
+
- Earth's moon (satellite)
12
+
- Saturn's rings
13
+
- Interactive zoom functionality
14
+
- Click-to-view planet information
15
+
- Responsive design that adapts to different screen sizes
16
+
17
+
## How to Use
18
+
19
+
1. Open the index.html file in a modern web browser.
20
+
2. The solar system will automatically start animating.
21
+
3. Use the zoom controls in the top-right corner to zoom in and out:
22
+
- Click the "+" button to zoom in
23
+
- Click the "-" button to zoom out
24
+
4. Click on any planet to view its name and orbit radius.
25
+
5. Click anywhere else to close the planet information popup.
26
+
##Just install live server extension on vs code and run the index.htmnl file on it and enjoy
27
+
28
+
29
+
## Technical Details
30
+
31
+
- The visualization is built using HTML5 Canvas for rendering.
32
+
- JavaScript is used for animation and interactivity.
33
+
- Planet images are loaded dynamically (ensure the images folder is present with appropriate planet images).
34
+
- The project uses a custom zoom implementation to allow users to explore the solar system in detail.
35
+
36
+
## Customization
37
+
38
+
You can easily customize various aspects of the visualization:
39
+
40
+
- Adjust planet sizes, colors, and orbit radii in the planets array.
41
+
- Modify the number and properties of asteroids in the asteroidBelt, earthAsteroidBelt, and kuiperBelt arrays.
42
+
- Change the appearance of Saturn's rings by modifying the saturnRings object.
43
+
- Adjust the zoom limits by changing the maxZoom and minZoom variables.
44
+
45
+
## Browser Compatibility
46
+
47
+
This visualization should work in all modern web browsers that support HTML5 Canvas. For the best experience, use the latest version of Chrome, Firefox, Safari, or Edge.
48
+
49
+
## Known Issues
50
+
51
+
- The background space sound may not autoplay in some browsers due to autoplay restrictions. Users may need to interact with the page first to start the audio.
52
+
53
+
## Future Improvements
54
+
55
+
- Add more detailed information for each planet
56
+
- Implement touch controls for mobile devices
57
+
- Add options to adjust animation speed
58
+
- Include more celestial bodies like dwarf planets and comets
59
+
60
+
## Credits
61
+
62
+
This Solar System Visualization was created as an educational project. Planet images and astronomical data are based on publicly available information from NASA and other space agencies.
<spanclass="object-description">Description: Discovered in 2004, Apophis is a near-Earth asteroid approximately 370 meters in diameter. Initially predicted to have a chance of impacting Earth in 2029, further observations have ruled out that possibility.</span>
<spanclass="object-description">Description:Apophis is a large asteroid with a diameter of about 370 meters, known for its significant close approaches to Earth. When it was first discovered, it garnered attention due to its potential impact threat in 2029.</span>
<spanclass="object-description">Description: 2006 QV89 is a near-Earth asteroid with a diameter of approximately 40 meters. It gained notoriety in 2019 when it was identified as a potential impactor, with an uncertain trajectory that sparked concern.</span>
<spanclass="object-description">Description: Bennu is a carbon-rich asteroid approximately 492 meters in diameter. It is of significant interest due to its potential to impact Earth in the late 22nd century. NASA's OSIRIS-REx mission successfully collected samples from Bennu's surface in 2020, and the samples are expected to return to Earth in 2023.</span>
45
+
</a>
46
+
</li>
47
+
<li>
48
+
<ahref="https://en.wikipedia.org/wiki/2004_MN4">
49
+
<spanclass="object-name">2001 FO32</span>
50
+
<spanclass="object-description">Description: 2001 FO32 is an Apollo-type asteroid with an estimated diameter of 900 meters. It is known for its close encounters with Earth, particularly in March 2021 when it passed within 2 million kilometers. </span>
// Data object with detailed facts about each planet
217
+
constdata={
218
+
earth: {
219
+
title: "Earth",
220
+
facts: `Earth is the third planet from the Sun and the only one known to support life. It has a diverse range of ecosystems and climates, from tropical rainforests to polar ice caps. Earth's surface is 71% water, mostly in the form of oceans, which play a crucial role in regulating the planet's climate and weather patterns. The remaining 29% is land, comprising continents and islands with various terrains. Earth's atmosphere, rich in nitrogen and oxygen, shields the planet from harmful solar radiation and helps sustain life. It rotates on its axis every 24 hours, creating day and night, and orbits the Sun every 365.25 days, leading to the changing seasons. The planet's magnetic field, generated by its molten iron core, protects it from solar winds and cosmic radiation. Human activities, such as deforestation and pollution, are affecting Earth's ecosystems and climate, highlighting the need for sustainable practices and environmental conservation.`,
221
+
},
222
+
mars: {
223
+
title: "Mars",
224
+
facts: `Mars, the fourth planet from the Sun, is known for its reddish appearance due to iron oxide, or rust, on its surface. It is a terrestrial planet with a thin atmosphere, composed mostly of carbon dioxide, with traces of nitrogen and argon. Mars has the largest volcano in the solar system, Olympus Mons, and a canyon system, Valles Marineris, that stretches over 4,000 kilometers. The planet's surface features include polar ice caps, seasonal dust storms, and ancient riverbeds, suggesting it once had liquid water. Mars experiences extreme temperature variations, with averages around -80 degrees Fahrenheit. Despite its harsh conditions, Mars has been a focal point for exploration, with rovers like Curiosity and Perseverance providing insights into its geology and potential for past life. Future missions aim to investigate its potential for human colonization.`,
225
+
},
226
+
jupiter: {
227
+
title: "Jupiter",
228
+
facts: `Jupiter is the largest planet in our solar system, with a diameter of about 86,881 miles. It is a gas giant with a composition primarily of hydrogen and helium. Jupiter's most notable feature is the Great Red Spot, a massive storm that has been raging for at least 400 years. The planet has a strong magnetic field and numerous moons, including the four largest, known as the Galilean moons: Io, Europa, Ganymede, and Callisto. Jupiter's atmosphere is characterized by its banded appearance, with alternating zones of high and low pressure creating colorful cloud bands. The planet has a very fast rotation, completing one spin in just under 10 hours. Jupiter's intense gravity influences many objects in the solar system, and its massive size makes it a key player in the dynamics of planetary science.`,
229
+
},
230
+
saturn: {
231
+
title: "Saturn",
232
+
facts: `Saturn is the sixth planet from the Sun and is famous for its prominent ring system. The planet is a gas giant, composed mainly of hydrogen and helium. Saturn's rings are made up of countless ice and rock particles, varying in size from tiny grains to large chunks. The planet has a diameter of about 72,367 miles and is known for its low density, as it is less dense than water. Saturn has a strong magnetic field and dozens of moons, with Titan being the largest and having a thick atmosphere of nitrogen and methane. The planet's atmosphere features bands of clouds and storms, including the mysterious hexagonal storm system at its north pole. Saturn's complex ring system and its diverse collection of moons make it a fascinating subject for study.`,
233
+
},
234
+
uranus: {
235
+
title: "Uranus",
236
+
facts: `Uranus, the seventh planet from the Sun, is unique for its extreme tilt, with an axial tilt of about 98 degrees. This tilt causes its poles to face the Sun directly, leading to extreme seasonal variations. The planet is an ice giant with a composition of hydrogen, helium, and water, ammonia, and methane ices. Uranus has a faint ring system and 27 known moons, with Titania, Oberon, Ariel, and Umbriel being the largest. The planet's blue-green color is due to the presence of methane in its atmosphere, which absorbs red light and reflects blue. Uranus has a relatively low internal heat, and its magnetic field is tilted compared to its rotational axis. The planet was discovered in 1781 by William Herschel and has been studied by the Voyager 2 spacecraft.`,
237
+
},
238
+
neptune: {
239
+
title: "Neptune",
240
+
facts: `Neptune is the eighth and farthest planet from the Sun. It is a gas giant with a composition similar to Uranus, primarily composed of hydrogen, helium, and methane. Neptune's striking blue color is due to the absorption of red light by methane in its atmosphere. The planet has the strongest winds in the solar system, reaching speeds of up to 1,200 miles per hour. Neptune has a faint ring system and 14 known moons, with Triton being the largest. Triton is unique for its retrograde orbit and geysers that spew nitrogen gas. Neptune's atmosphere is characterized by its dynamic weather patterns, including large storms and high-altitude clouds. The planet was discovered in 1846 through mathematical predictions and has been studied by the Voyager 2 spacecraft, which provided valuable data on its atmospheric conditions and ring system.`,
241
+
},
242
+
mercury: {
243
+
title: "Mercury",
244
+
facts: `Mercury is the closest planet to the Sun and has the shortest orbital period of any planet in the solar system, completing one orbit in about 88 Earth days. It is a rocky planet with a diameter of about 3,032 miles. Mercury's surface is heavily cratered, similar to the Moon, due to impacts from space debris. The planet has a very thin atmosphere, composed mostly of oxygen, sodium, hydrogen, helium, and potassium. Mercury experiences extreme temperature fluctuations, ranging from about 800 degrees Fahrenheit during the day to -330 degrees Fahrenheit at night. The planet has a weak magnetic field and no known moons. Mercury's surface features include vast plains, steep cliffs, and large impact basins, making it an interesting subject for geological studies.`,
245
+
},
246
+
venus: {
247
+
title: "Venus",
248
+
facts: `Venus, the second planet from the Sun, is similar in size and composition to Earth but has a very different atmosphere and surface conditions. The planet is covered by thick clouds of sulfuric acid and has a surface pressure about 92 times that of Earth. Venus's atmosphere is primarily composed of carbon dioxide, with trace amounts of nitrogen and other gases. This dense atmosphere creates a strong greenhouse effect, leading to surface temperatures that can reach up to 900 degrees Fahrenheit, hotter than any other planet in the solar system. Venus rotates very slowly on its axis, taking about 243 Earth days to complete one rotation, and has a rotation direction opposite to most planets. The planet has no moons and features a rocky surface with mountains, valleys, and volcanic plains.`,
0 commit comments