Skip to content

Commit

Permalink
imerssion journey final slider
Browse files Browse the repository at this point in the history
  • Loading branch information
digvijay164 committed Oct 23, 2024
1 parent 6d76248 commit 40e1b85
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 132 deletions.
83 changes: 42 additions & 41 deletions immersion-journey/final-slider/javascripts/script.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
gsap.registerPlugin(ScrollTrigger);

var panelsbg = document.getElementsByClassName("post");
var panels = document.getElementsByClassName("point");
var panelsbg = document.getElementsByClassName("post");
var panels = document.getElementsByClassName("point");

for (var i = 0; i < panels.length; i++) {
panels[i].addEventListener("mouseover", function () {
console.log("working");
//this.style.fontSize ="2rem"
gsap.to(this, {
fontSize: "2rem",
});
});
panels[i].addEventListener("mouseout", function () {
console.log("working");
//this.style.fontSize ="2rem"
gsap.to(this, {
fontSize: "1rem",
});
});
for (var i = 0; i < panels.length; i++) {
panels[i].addEventListener("mouseover", function () {
console.log("working");
//this.style.fontSize ="2rem"
gsap.to(this, {
fontSize: "2rem",
});
});
panels[i].addEventListener("mouseout", function () {
console.log("working");
//this.style.fontSize ="2rem"
gsap.to(this, {
fontSize: "1rem",
});
});

gsap.fromTo(
panels[i],
{
// fontSize: "1.5",
},
{
fontSize: "2rem",
scrollTrigger: {
trigger: panels[i],
start: "top 1vh",
end: "bottom center",
toggleActions: "play none none reverse",
},
}
);
}
gsap.fromTo(
panels[i],
{
// fontSize: "1.5",
},
{
fontSize: "2rem",
scrollTrigger: {
trigger: panels[i],
start: "top 1vh",
end: "bottom center",
toggleActions: "play none none reverse",
},
}
);
}

gsap.to('.icon', {
y: index * window.innerHeight, // Adjust the calculation based on your layout
scrollTrigger: {
trigger: section,
start: 'top center',
end: 'bottom center',
scrub: true, // Smooth animation on scroll
}});
gsap.to(".icon", {
y: index * window.innerHeight, // Adjust the calculation based on your layout
scrollTrigger: {
trigger: section,
start: "top center",
end: "bottom center",
scrub: true, // Smooth animation on scroll
},
});
181 changes: 90 additions & 91 deletions immersion-journey/final-slider/stylesheets/style.css
Original file line number Diff line number Diff line change
@@ -1,92 +1,91 @@
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS",
sans-serif;
}
html,
body {
width: 100%;
height: 100vh;
background-color: #403b3b;
color: #fff;
}
.main {
width: 100%;
height: 100vh;
display: flex;
}
.left-section {
width: 30%;
height: 25%;
background: #5d5a5a;
display: grid;
padding-top: 1%;
padding-left: 8%;
margin-top: 15%;
font-size: 1.8rem;
position: fixed;
}
.left-section a {
color: #fff;
text-decoration: none;
}
.posts {
height: 200vh;
width: 70vw;
margin-top: 14%;
margin-left: 30%;
}
.container {
width: 100%;
height: 20%;
margin-top: 1rem;
display: flex;
align-items: center;
}
.image {
height: 100%;
width: 30%;
background-color: #b33030;
}
.image img {
width: 100%;
height: 100%;
}
.content {
background-color: cadetblue;
width: 50%;
height: 100%;
padding: 5%;
}
.nav-line {
width: 10%;
height: 45%;
position: fixed;
display: flex;
align-items: center;
justify-content: center;
margin-top: 15%;
margin-left: 86%;
}
.number-label {
height: 100%;
width: 100%;
display: grid;
align-items: center;
justify-content: center;
}
.nav-line a {
color: #fff;
text-decoration: none;
font-size: 1rem;
}
.icon {
height: 40px;
width: 40px;
}
.icon img {
height: 100%;
width: 100%;
}
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
}
html,
body {
width: 100%;
height: 100vh;
background-color: #403b3b;
color: #fff;
}
.main {
width: 100%;
height: 100vh;
display: flex;
}
.left-section {
width: 30%;
height: 25%;
background: #5d5a5a;
display: grid;
padding-top: 1%;
padding-left: 8%;
margin-top: 15%;
font-size: 1.8rem;
position: fixed;
}
.left-section a {
color: #fff;
text-decoration: none;
}
.posts {
height: 200vh;
width: 70vw;
margin-top: 14%;
margin-left: 30%;
}
.container {
width: 100%;
height: 20%;
margin-top: 1rem;
display: flex;
align-items: center;
}
.image {
height: 100%;
width: 30%;
background-color: #b33030;
}
.image img {
width: 100%;
height: 100%;
}
.content {
background-color: cadetblue;
width: 50%;
height: 100%;
padding: 5%;
}
.nav-line {
width: 10%;
height: 45%;
position: fixed;
display: flex;
align-items: center;
justify-content: center;
margin-top: 15%;
margin-left: 86%;
}
.number-label {
height: 100%;
width: 100%;
display: grid;
align-items: center;
justify-content: center;
}
.nav-line a {
color: #fff;
text-decoration: none;
font-size: 1rem;
}
.icon {
height: 40px;
width: 40px;
}
.icon img {
height: 100%;
width: 100%;
}

0 comments on commit 40e1b85

Please sign in to comment.