Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PB2204 committed Feb 16, 2024
0 parents commit ab2fce6
Show file tree
Hide file tree
Showing 55 changed files with 3,470 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Our Solar System

Solar System is a responsive webpage, I have made to show my love for astronomy :heart_eyes: I have used HTML, CSS and JavaScript.

Live link :- https://pabitrabanerjee.me/Our-Solar-System

## Screenshots :point_down:
Desktop View | Mobile View
------------ | -------------
<img src="https://res.cloudinary.com/djix6uusx/image/upload/v1647791310/screencapture-planet-points-vercel-app-2022-03-20-21_17_45_r4ence.png"/> | <img src="https://res.cloudinary.com/djix6uusx/image/upload/v1647791397/screencapture-127-0-0-1-5501-index-html-2022-03-20-21_19_34_jwsdwh.png"/>
Binary file added images/apollo-1.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 images/apollo-2.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 images/apollo-3.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 images/apollo-4.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 images/apollo-5.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 images/earth.png
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 images/earth1.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 images/earth2.png
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 images/earth3.png
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 images/earth4.png
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 images/jupiter.png
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 images/jupiter1.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 images/jupiter2.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 images/jupiter3.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 images/jupiter4.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 images/land.png
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 images/mars.png
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 images/mars1.png
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 images/mars2.png
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 images/mars3.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 images/mars4.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 images/mercury.png
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 images/mercury1.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 images/mercury2.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 images/mercury3.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 images/mercury4.jpeg
Binary file added images/moon.png
Binary file added images/neptune.png
Binary file added images/neptune1.jpg
Binary file added images/neptune2.png
Binary file added images/neptune3.jpg
Binary file added images/neptune4.jpg
Binary file added images/saturn.png
Binary file added images/saturn1.png
Binary file added images/saturn2.jpg
Binary file added images/saturn3.jpg
Binary file added images/saturn4.jpg
Binary file added images/solar-system.png
Binary file added images/space.jpg
Binary file added images/space2.jpg
Binary file added images/sun.png
Binary file added images/uranus.png
Binary file added images/uranus1.png
Binary file added images/uranus2.png
Binary file added images/uranus3.png
Binary file added images/uranus4.jpg
Binary file added images/venus.png
Binary file added images/venus1.jfif
Binary file not shown.
Binary file added images/venus2.png
Binary file added images/venus3.jpg
Binary file added images/venus4.jpg
1,506 changes: 1,506 additions & 0 deletions index.html

Large diffs are not rendered by default.

182 changes: 182 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
var slideIndex = 1;
showSlides(slideIndex);

// Next/previous controls
function plusSlides(n) {
showSlides(slideIndex += n);
}

// Thumbnail image controls
function currentSlide(n) {
showSlides(slideIndex = n);
}

function showSlides(n) {
var i;
var slides = document.getElementsByClassName("slide");

if (n > slides.length) { slideIndex = 1 }
if (n < 1) { slideIndex = slides.length }
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}

slides[slideIndex - 1].style.display = "grid";

}

const spaceship = document.querySelector(".spaceship");
let previousPlanet, currentPlanet;

function viewFacts(id) {

currentPlanet = document.getElementById(id);

// viewing planet details
document.getElementById("planetData").style.display = "block";

if (previousPlanet) {
previousPlanet.classList.add("hidden");
}
currentPlanet.classList.remove("hidden");
currentPlanet.scrollIntoView();

scrollAnimation(currentPlanet);

previousPlanet = currentPlanet;

}

function scrollAnimation(planet) {

// intersection observer - onscroll animation


const facts = planet.querySelectorAll(".facts");

// animation on facts

const appearOptions = {
threshold: 0.5,
rootMargin: "0px 0px 50px 0px"
}

const appearOnScroll = new IntersectionObserver(function (entries, appearOnScroll) {

entries.forEach(entry => {
if (!entry.isIntersecting) {
return;

} else {
entry.target.classList.add("slideUp");
appearOnScroll.unobserve(entry.target);
}
})

}, appearOptions);

facts.forEach(fact => {
appearOnScroll.observe(fact);
});

}




// animation on navbar

const navbar = document.querySelector("nav");
const header = document.querySelector("header");

const options = {
rootMargin: "-200px"
}


const linksObserver = new IntersectionObserver(function (entries, linksObserver) {

entries.forEach(entry => {

if (!entry.isIntersecting) {
navbar.style.backgroundColor = "#000";


} else {
navbar.style.backgroundColor = "transparent";
}
});

}, options);

linksObserver.observe(header);


// close side panel
let sidePanel = document.getElementById("solarSideCard");

function closeSidePanel() {
sidePanel.style.right = "-100%";

}

// open side panel
let infoPanelPrevious, infoPanelCurrent;

infoPanelPrevious = document.getElementById('sideInfoSun');

function openSidePanel(id) {
infoPanelCurrent = document.getElementById(id);
sidePanel.style.right = "0";

infoPanelPrevious.classList.add('hidden');
infoPanelCurrent.classList.remove('hidden');

infoPanelPrevious = infoPanelCurrent;

}

// move to planet carousel
function moveToPlanetCarousel() {
document.getElementById('planet-carousel').scrollIntoView();
}

// reset dropdown

function resetDropdown() {

document.querySelector("details").removeAttribute('open');
}

// mobile menu

let hamburgerMenu = document.getElementById('hamburgerMenu');
let mobileMenu = document.getElementById('mobileMenu');

function showMobileMenu() {


hamburgerMenu.classList.toggle('active');
mobileMenu.classList.toggle('active');

setTimeout(() => {
mobileMenu.querySelector('.top-section').classList.toggle('active');
mobileMenu.querySelector('.bottom-section').classList.toggle('active');
}, 300);


}

// reset mobile menu
function resetMobileMenu() {

if (mobileMenu.classList.contains("active")) {
hamburgerMenu.classList.remove('active');
mobileMenu.classList.remove('active');
mobileMenu.querySelector('.top-section').classList.remove('active');
mobileMenu.querySelector('.bottom-section').classList.remove('active');
}
}



Loading

0 comments on commit ab2fce6

Please sign in to comment.