Skip to content

Commit

Permalink
add scroll animations
Browse files Browse the repository at this point in the history
  • Loading branch information
Akctarus committed Nov 10, 2023
1 parent 82c4ac1 commit 3acb416
Show file tree
Hide file tree
Showing 12 changed files with 337 additions and 148 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules

.DS_Store
.parcel-cache
40 changes: 35 additions & 5 deletions app.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ html {
scroll-behavior: smooth;
}

.container {
.background {
text-align: center;
color: var(--color);
width: 100%;

display: flex;
flex-direction: column;
align-items: center;
Expand Down Expand Up @@ -50,6 +49,7 @@ html {
}

.section-two .part-one {
height: 40vh;
display: flex;
flex-direction: column;
justify-content: center;
Expand All @@ -59,6 +59,7 @@ html {
}

.section-two .part-two {
height: 60vh;
display: flex;
flex-direction: column;
justify-content: center;
Expand Down Expand Up @@ -149,11 +150,20 @@ html {
}

.logo-place {
height: 18rem;
height: 15rem;
}

p {
text-align: center;
.logo-metro {
height: 1.5rem;
vertical-align: -6px;
}

a {
text-decoration: none;
}

.link {
color: white;
}

h1 {
Expand Down Expand Up @@ -219,6 +229,20 @@ time {
display: flex;
flex-direction: column;
}

.hidden {
opacity: 0;
filter: blur(5px);
transform : translateX(-100%);
transition: all 1s;
}

.show {
opacity: 1;
filter: blur(0);
transform : translateX(0);
}

@media screen and (max-width: 1024px) {
p {
padding: 0.5rem;
Expand All @@ -239,3 +263,9 @@ time {
font-size: 3rem;
}
}

@media (prefers-reduced-motion) {
.hidden {
transition: none;
}
}
38 changes: 34 additions & 4 deletions dist/index.75a90472.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.75a90472.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions dist/index.975ef6c8.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.975ef6c8.js.map

Large diffs are not rendered by default.

36 changes: 19 additions & 17 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script src="/index.975ef6c8.js" defer=""></script>
</head>
<body>
<div class="container mandatory-scroll-snapping" dir="ltr">
<div class="background mandatory-scroll-snapping" dir="ltr">
<section class="section-one" id="section-one">
<div class="container-one">
<svg viewbox="0 0 567.3 475.8">
Expand Down Expand Up @@ -56,7 +56,7 @@
</div>
<div>
<p id="first-text">
Présentation des versions<b>Short Term DCM</b> et
Présentation des versions <b>Short Term DCM</b> et
<b>Etudes Exploitation</b> du <b>programme</b>
<span><b>OSRD</b></span>
</p>
Expand Down Expand Up @@ -96,24 +96,26 @@
</section>
<section class="section-two" id="section-two">
<div class="part-one">
<h1>
<h1 class="hidden">
Design
<span style="color: #000">your Journey<span style="color: #c7b2de">.</span></span>
</h1>
<p>
34 rue du commandant René Mouchotte <br>
de 14h à 16h <br>
<simetrodeparis><span> Montparnasse Bienvenue</span>
</simetrodeparis></p>
<p>75014 Paris</p>
<a href="https://maps.app.goo.gl/xpuXFz91JD33hsij6" class="hidden link">
<p>
34 rue du commandant René Mouchotte <br>
de 14h à 16h <br>
<span> <img src="/logo-metro.f6ae4ac6.png" alt="metro" class="logo-metro hidden"> Montparnasse Bienvenue</span>
</p>
<p class="hidden">75014 Paris</p>
</a>
</div>
<div class="part-two">
<h2>Le lieu</h2>
<img src="/OSRD-kickoff-programme-plan-event.13fe5069.svg" alt="plan" class="logo-place">
<h2 class="hidden">Le lieu</h2>
<img src="/OSRD-kickoff-programme-plan-event.13fe5069.svg" alt="plan" class="logo-place hidden">
</div>
</section>
<section class="section-three" id="section-three">
<div>
<div class="hidden">
<h2>Les conférences</h2>
<p style="color: #000">
Au programme, de 14h à 16h, une série de conférences de 5 minutes
Expand All @@ -122,12 +124,12 @@ <h2>Les conférences</h2>
<time>14:00 - 16:00</time>
</div>
<div class="part-two">
<p>
<p class="hidden">
<span>14:00</span> - Cérémonie d'ouverture et introduction au
programme OSRD <br>
<b>Loïc Hamelin</b> - Directeur du programme OSRD
</p>
<p>
<p class="hidden">
<span>14:05</span> - Conférence principale Short Term DCM <br>
<b>Loïc Hamelin</b> - Directeur du programme OSRD <br>
<b>Loïc Hamelin</b> - Directeur du programme OSRD <br>
Expand All @@ -136,7 +138,7 @@ <h2>Les conférences</h2>
<b>Loïc Hamelin</b> - Directeur du programme OSRD <br>
<b>Loïc Hamelin</b> - Directeur du programme OSRD
</p>
<p>
<p class="hidden">
<span>15:45</span> - Conclusion et avenir du projet au sein de SNCF
Réseau <br>
<b>Loïc Hamelin</b> - Directeur du programme OSRD
Expand All @@ -146,9 +148,9 @@ <h2>Les conférences</h2>
<section class="section-four" id="section-four">
<div class="container-four">
<div>
<h2>La suite</h2>
<h2 class="hidden">La suite</h2>
</div>
<div>
<div class="hidden">
<p>
Pour plus d'informations, <br>
cliquez sur :
Expand Down
Binary file added dist/logo-metro.f6ae4ac6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 21 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script src="./src/index.js" type="module"></script>
</head>
<body>
<div class="container mandatory-scroll-snapping" dir="ltr">
<div class="background mandatory-scroll-snapping" dir="ltr">
<section class="section-one" id="section-one">
<div class="container-one">
<svg viewBox="0 0 567.3 475.8">
Expand Down Expand Up @@ -100,7 +100,7 @@
</div>
<div>
<p id="first-text">
Présentation des versions<b>Short Term DCM</b> et
Présentation des versions <b>Short Term DCM</b> et
<b>Etudes Exploitation</b> du <b>programme</b>
<span><b>OSRD</b></span>
</p>
Expand Down Expand Up @@ -187,30 +187,34 @@
</section>
<section class="section-two" id="section-two">
<div class="part-one">
<h1>
<h1 class="hidden">
Design
<span style="color: black"
>your Journey<span style="color: #c7b2de">.</span></span
>
</h1>
<p>
34 rue du commandant René Mouchotte <br />
de 14h à 16h <br />
<SiMetrodeparis /><span> Montparnasse Bienvenue</span>
</p>
<p>75014 Paris</p>
<a href="https://maps.app.goo.gl/xpuXFz91JD33hsij6" class="hidden link">
<p>
34 rue du commandant René Mouchotte <br />
de 14h à 16h <br />
<span> <img src="/public/assets/visuels/logo-metro.png"
alt="metro"
class="logo-metro hidden"> Montparnasse Bienvenue</span>
</p>
<p class="hidden">75014 Paris</p>
</a>
</div>
<div class="part-two">
<h2>Le lieu</h2>
<h2 class="hidden">Le lieu</h2>
<img
src="/public/assets/plan/OSRD-kickoff-programme-plan-event.svg"
alt="plan"
class="logo-place"
class="logo-place hidden"
/>
</div>
</section>
<section class="section-three" id="section-three">
<div>
<div class="hidden">
<h2>Les conférences</h2>
<p style="color: black">
Au programme, de 14h à 16h, une série de conférences de 5 minutes
Expand All @@ -219,12 +223,12 @@ <h2>Les conférences</h2>
<time>14:00 - 16:00</time>
</div>
<div class="part-two">
<p>
<p class="hidden">
<span>14:00</span> - Cérémonie d'ouverture et introduction au
programme OSRD <br />
<b>Loïc Hamelin</b> - Directeur du programme OSRD
</p>
<p>
<p class="hidden">
<span>14:05</span> - Conférence principale Short Term DCM <br />
<b>Loïc Hamelin</b> - Directeur du programme OSRD <br />
<b>Loïc Hamelin</b> - Directeur du programme OSRD <br />
Expand All @@ -233,7 +237,7 @@ <h2>Les conférences</h2>
<b>Loïc Hamelin</b> - Directeur du programme OSRD <br />
<b>Loïc Hamelin</b> - Directeur du programme OSRD
</p>
<p>
<p class="hidden">
<span>15:45</span> - Conclusion et avenir du projet au sein de SNCF
Réseau <br />
<b>Loïc Hamelin</b> - Directeur du programme OSRD
Expand All @@ -243,9 +247,9 @@ <h2>Les conférences</h2>
<section class="section-four" id="section-four">
<div class="container-four">
<div>
<h2>La suite</h2>
<h2 class="hidden">La suite</h2>
</div>
<div>
<div class="hidden">
<p>
Pour plus d'informations, <br />
cliquez sur :
Expand Down
Binary file added public/assets/visuels/logo-metro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,16 @@ updateFooterVisibility();
document.addEventListener("scroll", function () {
updateFooterVisibility();
});

const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
entry.target.classList.toggle("show", entry.isIntersecting);
} else {
entry.target.classList.remove("show");
}
});
});

const hiddenElements = document.querySelectorAll(".hidden");
hiddenElements.forEach((el) => observer.observe(el));
Loading

0 comments on commit 3acb416

Please sign in to comment.