Skip to content

Commit

Permalink
updated iss and bennu asteroid
Browse files Browse the repository at this point in the history
  • Loading branch information
Git21221 committed Jul 25, 2023
1 parent 01c96a1 commit ff49f0f
Show file tree
Hide file tree
Showing 8 changed files with 247 additions and 32 deletions.
4 changes: 4 additions & 0 deletions planets/3d-bennu/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body{
margin: 0;
overflow: hidden;
}
Binary file added planets/3d-bennu/images/asteroid_bennu.glb
Binary file not shown.
27 changes: 27 additions & 0 deletions planets/3d-bennu/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Asteroid Bennu</title>
<script src="//unpkg.com/three" defer></script>
<script src="//unpkg.com/three-globe" defer></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/"
}
}
</script>
<link rel="stylesheet" href="css/style.css">
</head>

<body>
<canvas class="webgl">
</canvas>
<script type="module" src="js/script.js"></script>
</body>

</html>
78 changes: 78 additions & 0 deletions planets/3d-bennu/js/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import * as THREE from '../../three.js-master/build/three.module.js'
import { GLTFLoader } from '../../three.js-master/examples/jsm/loaders/GLTFLoader.js'
import { RGBELoader } from '../../three.js-master/examples/jsm/loaders/RGBELoader.js'
import {OrbitControls} from '../../three.js-master/examples/jsm/controls/OrbitControls.js'
// sizes of my screen
let sizes = {
width: window.innerWidth,
height: window.innerHeight,
}
//declaring all things here
const canvas = document.querySelector('.webgl');
const scene = new THREE.Scene();
const loader = new GLTFLoader();
loader.load('images/asteroid_bennu.glb', function (glb) {
console.log(glb)
const root = glb.scene;
root.scale.set(6, 6, 6)
// root.position.set(0,-1,0);

scene.add(root);
}, function (xhr) {
console.log((xhr.loaded / xhr.total * 100) + "% loaded")
}, function (error) {
console.log('An error occured')
})

const light = new THREE.AmbientLight(0xffffff, 1);
// for light
light.position.set(40, 0, 0)
scene.add(light)

const camera = new THREE.PerspectiveCamera(90, sizes.width / sizes.height, 0.1, 1000);
//for camera
camera.position.set(3,2,2)
scene.add(camera)
const renderer = new THREE.WebGL1Renderer({
canvas: canvas
})
//render
renderer.setSize(sizes.width, sizes.height)
renderer.setPixelRatio(2)
renderer.render(scene, camera)

// resize for responsiveness
window.addEventListener("resize", () => {
console.log(window.innerWidth)
sizes.width = window.innerWidth
sizes.height = window.innerHeight
camera.aspect = sizes.width / sizes.height
camera.updateProjectionMatrix()
renderer.setSize(sizes.width, sizes.height)
})

const controls = new OrbitControls(camera, renderer.domElement); //orbital controls

// OrbitControls
controls.enableDamping = true
controls.enablePan = false // off right click position change
controls.enableZoom = true // off zooming on planet
controls.autoRotate = false;
// controls.autoRotateSpeed = 0.7;

const loop = () => {
controls.update()
renderer.render(scene, camera)
window.requestAnimationFrame(loop)
}
loop()
const hdrTexture = new URL('../../stars.hdr', import.meta.url);
const loadere = new RGBELoader();
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping
renderer.toneMappingExposure = 0.6
loadere.load(hdrTexture, function(texture){
texture.mapping = THREE.EquirectangularReflectionMapping
scene.background = texture;
scene.environment = texture
})
4 changes: 2 additions & 2 deletions planets/css/planet.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ section:target~#home {
color: black;
border-radius: 60px;
}
#planets, #dplanets{
#planets, #dplanets, #iss, #asteroid, #ss, #probe{
max-width: 1000px;
margin: auto;
display: flex;
Expand Down Expand Up @@ -76,7 +76,7 @@ section:target~#home {
line-height: 2.5rem;
font-size: 1.19rem;
}
#planets img, #dplanets img{
#planets img, #dplanets img, #iss img, #asteroid img, #ss img, #probe img{
height: auto;
width: 100%;
}
Expand Down
Binary file added planets/img/bennu.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added planets/img/iss.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
166 changes: 136 additions & 30 deletions planets/planets.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,26 @@
</a>
<div class="navbar-links" id="navbar-link-toogle">
<a href="/sec-page/second.html" title="View Our Solar System">
<svg xmlns="http://www.w3.org/2000/svg" id="orrery" enable-background="new 0 0 32 32" viewBox="0 0 32 32">
<circle class="sun" cx="16" cy="16" r="3.2" />
<g class="third">
<circle cx="16" cy="16" r="14" fill="none" stroke="#fff" stroke-miterlimit="10" stroke-width=".9" />
<circle cx="28.2" cy="23.1" r="1.7" />
</g>
<g class="second">
<circle cx="16" cy="16" r="10.5" fill="none" stroke="#fff" stroke-miterlimit="10" stroke-width=".9" />
<circle cx="10.6" cy="7.2" r="1.7" />
</g>
<g class="first">
<circle cx="16" cy="16" r="6.8" fill="none" stroke="#fff" stroke-miterlimit="10" stroke-width=".9" />
<circle cx="11.7" cy="21" r="1.7" />
</g>
<svg xmlns="http://www.w3.org/2000/svg" id="orrery" enable-background="new 0 0 32 32"
viewBox="0 0 32 32">
<circle class="sun" cx="16" cy="16" r="3.2" />
<g class="third">
<circle cx="16" cy="16" r="14" fill="none" stroke="#fff" stroke-miterlimit="10"
stroke-width=".9" />
<circle cx="28.2" cy="23.1" r="1.7" />
</g>
<g class="second">
<circle cx="16" cy="16" r="10.5" fill="none" stroke="#fff" stroke-miterlimit="10"
stroke-width=".9" />
<circle cx="10.6" cy="7.2" r="1.7" />
</g>
<g class="first">
<circle cx="16" cy="16" r="6.8" fill="none" stroke="#fff" stroke-miterlimit="10"
stroke-width=".9" />
<circle cx="11.7" cy="21" r="1.7" />
</g>
</svg>
</a>
</a>
<a class="navbar-links-txt" href="/index.html">Home</a>
<a class="navbar-links-txt highlight" href="/planets/planets.html">Planets</a>
<a class="navbar-links-txt" href="/gallery/gallery.html">Gallery</a>
Expand Down Expand Up @@ -375,7 +379,7 @@
</div>
<div class="info">
<div class="imgs">
<img src="img/uranus.jpg" alt="Mercury image">
<img src="img/uranus.jpg" alt="Uranus image">
<div class="bar">
<a href="img/uranus.jpg" title="Download" download>
<div class="downloadOp">
Expand Down Expand Up @@ -431,7 +435,7 @@
</ul>
</div>
<div class="imgs">
<img src="img/neptune.jpg" alt="Mercury image">
<img src="img/neptune.jpg" alt="Neptune image">
<div class="bar">
<a href="img/neptune.jpg" title="Download" download>
<div class="downloadOp">
Expand Down Expand Up @@ -476,7 +480,7 @@
</div>
<div class="info">
<div class="imgs">
<img src="img/ceres.jpg" alt="Mercury image">
<img src="img/ceres.jpg" alt="ceres image">
<div class="bar">
<a href="img/ceres.jpg" title="Download" download>
<div class="downloadOp">
Expand All @@ -501,9 +505,11 @@
<li>
- Ceres comprises 25% of the asteroid belt's total mass</li>
<li><strong>NameShake</strong>
- Ceres is named for the Roman goddess of corn and harvests. The word cereal comes from the same name.</li>
- Ceres is named for the Roman goddess of corn and harvests. The word cereal comes from
the same name.</li>
<li><strong>Day</strong>
- Ceres takes 1,682 Earth days, or 4.6 Earth years, to make one trip around the Sun.</li>
- Ceres takes 1,682 Earth days, or 4.6 Earth years, to make one trip around the Sun.
</li>
<li><strong>Moon</strong> - 0</li>
</ul>
</div>
Expand All @@ -530,7 +536,7 @@
</ul>
</div>
<div class="imgs">
<img src="img/pluto.jpg" alt="Mercury image">
<img src="img/pluto.jpg" alt="pluto image">
<div class="bar">
<a href="img/pluto.jpg" title="Download" download>
<div class="downloadOp">
Expand All @@ -556,7 +562,7 @@
</div>
<div class="info">
<div class="imgs">
<img src="img/eris.png" alt="Mercury image">
<img src="img/eris.png" alt="eris image">
<div class="bar">
<a href="img/eris.png" title="Download" download>
<div class="downloadOp">
Expand All @@ -581,7 +587,7 @@
<li><strong>Year</strong>
- 557 Earth years</li>
<li><strong>Radius</strong>
~ 722 miles | 1,163 kilometers</li>
~ 722 miles | 1,163 kilometers</li>
<li><strong>Planet Type</strong>
- Dwarf</li>
<li><strong>Moon</strong> - 1 (Dysnomia)</li>
Expand All @@ -606,11 +612,12 @@
- Dwarf</li>
<li><strong>Radius</strong>
~ 385 miles | 620 kilometers</li>
<li><strong>Moon</strong> - 2 (Namaka <sub>(inner moon)</sub>, Hi'iaka <sub>(outer moon)</sub>)</li>
<li><strong>Moon</strong> - 2 (Namaka <sub>(inner moon)</sub>, Hi'iaka <sub>(outer
moon)</sub>)</li>
</ul>
</div>
<div class="imgs">
<img src="img/haumea.jpg" alt="Mercury image">
<img src="img/haumea.jpg" alt="haumea image">
<div class="bar">
<a href="img/haumea.jpg" title="Download" download>
<div class="downloadOp">
Expand All @@ -636,7 +643,7 @@
</div>
<div class="info">
<div class="imgs">
<img src="img/makemake.jpg" alt="Mercury image">
<img src="img/makemake.jpg" alt="makemake image">
<div class="bar">
<a href="img/makemake.jpg" title="Download" download>
<div class="downloadOp">
Expand All @@ -661,11 +668,13 @@
<li><strong>Year</strong>
- 305.34 Earth years</li>
<li><strong>Radius</strong>
~ 444 miles | 715 kilometers</li>
~ 444 miles | 715 kilometers</li>
<li><strong>Planet Type</strong>
- Dwarf</li>
<li><strong>Moon <sub>Confirmed</sub> </strong> - 0</li>
<li><strong>Moon <sub>Provisional</sub> </strong> - 1 (S/2015 (136472) 1, MK 2 <sub>Nicknamed</sub> )</li>
<li><strong>Moon <sub>Provisional</sub> </strong> - 1 (S/2015 (136472) 1, MK 2
<sub>Nicknamed</sub> )
</li>
</ul>
</div>
</div>
Expand All @@ -676,14 +685,111 @@


<section id="iss">
ISS section...
<!-- ISS section... -->
<div class="definition">
<div class="question">
What is International Space Station?
</div>
<div class="answer">
International Space Station (ISS), space station assembled in low Earth orbit largely by the United
States and Russia, with assistance and components from a multinational consortium.
The project, which began as an American effort, was long delayed by funding and technical problems.
<br>Assembly of the International Space Station (ISS) began with the launches of the Russian control
module Zarya on November 20, 1998, and the U.S.-built Unity connecting node the following month,
which were linked in orbit by U.S. space shuttle astronauts.
</div>
</div>
<div class="iss planet">
<div class="heading question">
ISS (International Space Station)
</div>
<div class="info">
<div class="imgs">
<img src="img/iss.jpeg" alt="iss image">
<div class="bar">
<a href="img/iss.jpeg" title="Download" download>
<div class="downloadOp">
<i class="fa-solid fa-download"></i>
</div>
</a>
<div class="tdOp">
<i class="fa-regular fa-image"></i>
</div>
<a href="3d-iss/index.html" title="View in 3D">
<div class="thdOp">
<i class="fa-solid fa-cube"></i>
</div>
</a>
</div>
</div>
<div class="details">
<ul>
<li> - It orbits Earth at an average altitude of approximately 250 miles.
</li>
<li> - It serves as a home where crews of astronauts and cosmonauts live.</li>
<li><strong>Speed</strong> - It travels at 17,500 mph.</li>
<li><strong>Orbit</strong> - It orbits Earth every 90 minutes.
</li>
</ul>
</div>
</div>
</div>
</section>




<section id="asteroid">
Asteroid section...
<div class="definition">
<div class="question">
What is Asteroid?
</div>
<div class="answer">
Asteroids, sometimes called minor planets, are rocky, airless remnants left over from the early
formation of our solar system about 4.6 billion years ago.
The current known asteroid count is: 1,299,621.
<br>
Most of this ancient space rubble can be found orbiting the Sun between Mars and Jupiter within the
main asteroid belt. Asteroids range in size from Vesta - the largest at about 329 miles (530
kilometers) in diameter - to bodies that are less than 33 feet (10 meters) across. The total mass of
all the asteroids combined is less than that of Earth's Moon.
</div>
</div>
<div class="bennu planet">
<div class="heading question">
ISS (International Space Station)
</div>
<div class="info">
<div class="imgs">
<img src="img/bennu.jpg" alt="bennu image">
<div class="bar">
<a href="img/bennu.jpg" title="Download" download>
<div class="downloadOp">
<i class="fa-solid fa-download"></i>
</div>
</a>
<div class="tdOp">
<i class="fa-regular fa-image"></i>
</div>
<a href="3d-bennu/index.html" title="View in 3D">
<div class="thdOp">
<i class="fa-solid fa-cube"></i>
</div>
</a>
</div>
</div>
<div class="details">
<ul>
<li><strong>Discovered</strong> - September 11, 1999</li>
<li><strong>Type</strong> - B-Type Asteroid</li>
<li><strong>Diameter</strong> - About 1,614 feet (492 meters)</li>
<li><strong>Orbital Period</strong> - 1.2 Earth Years</li>
<li><strong>Length of Day</strong> - 4.288 hours</li>
<li><strong>Mass</strong> - 85.5 million tons (77.6 million metric tons)</li>
</ul>
</div>
</div>
</div>
</section>


Expand Down

0 comments on commit ff49f0f

Please sign in to comment.