Adding full screen (vh) story

This commit is contained in:
Hugo Averty 2020-06-14 13:29:47 +02:00
parent c53701288c
commit d54e884063
2 changed files with 72 additions and 37 deletions

View File

@ -86,11 +86,11 @@
</div> </div>
</div> </div>
</div> </div>
<div class="title text-center"> <div class="title title-main text-center">
<h1>Your workplace<br/>but better</h1> <h1>Your workplace<br/>but better</h1>
<h3>You are impatient to discover this new world? Click on "Play online" and meet new people or share this adventure with your colleagues and friends by clicking on "Private mode"</h3> <h3>You are impatient to discover this new world? Click on "Play online" and meet new people or share this adventure with your colleagues and friends by clicking on "Private mode"</h3>
</div> </div>
<div class="row justify-content-md-center pt-5"> <div class="row buttons-row justify-content-md-center pt-5">
<div class="col col-lg-3"> <div class="col col-lg-3">
<a class="custom-link start" href="/choose-map.html" title="PRIVATE MODE"> <a class="custom-link start" href="/choose-map.html" title="PRIVATE MODE">
PRIVATE MODE PRIVATE MODE
@ -112,6 +112,12 @@
</div> </div>
</header> </header>
<section class="story-wrapper"> <section class="story-wrapper">
<div class="clouds clouds-2">
<div class="cloud"></div>
</div>
<div class="clouds">
<div class="cloud"></div>
</div>
<div class="sky"></div> <div class="sky"></div>
<div class="mountains"></div> <div class="mountains"></div>
<img src="static/images/story/story-map-bg.png" height="672" class="story-1" /> <img src="static/images/story/story-map-bg.png" height="672" class="story-1" />
@ -153,16 +159,41 @@
<div> <div>
<p>You can also create a private room with your friends or your team ! </p> <p>You can also create a private room with your friends or your team ! </p>
<p class="bubble-legend">To try, press button private mode</p> <p class="bubble-legend">To try, press button private mode</p>
<p class="bubble-action"><span onclick="startGame()"> <p class="bubble-action"><a href="/choose-map.html">
<img src="static/images/playicon.png" /> <img src="static/images/playicon.png" />
START IN PRIVATE MODE START IN PRIVATE MODE
</span></p> </a></p>
</div> </div>
</div> </div>
<!-- PRELOADING (hidden elements) --> <!-- PRELOADING (hidden elements) -->
<img src="static/images/story/character-walk-right.gif" style="display:none;" /> <img src="static/images/story/character-walk-right.gif" style="display:none;" />
</section> </section>
<script> <script>
gsap.to(".title-main", {
//y:-1000,
scale: 0,
opacity: 0,
ease: "none",
scrollTrigger: {
trigger: "header",
start: "top top", // the default values
// end: "bottom top",
scrub: true
},
});
gsap.to(".over-image .clouds", {
y: 100,
ease: "none",
scrollTrigger: {
trigger: "header",
start: "top top", // the default values
// end: "bottom top",
scrub: true
},
});
var maxImageTranslateValue = 3507 - window.innerWidth; var maxImageTranslateValue = 3507 - window.innerWidth;
var bubbleNumber = document.getElementsByClassName("bubble").length; var bubbleNumber = document.getElementsByClassName("bubble").length;
var charWalkToRightImage = "static/images/story/character-walk-right.gif"; var charWalkToRightImage = "static/images/story/character-walk-right.gif";
@ -177,11 +208,6 @@
scrub: 1, // smooth scrubbing, takes 1 second to "catch up" to the scrollbar scrub: 1, // smooth scrubbing, takes 1 second to "catch up" to the scrollbar
} }
}); });
var moveMountains = function() {
storyScrollTrigger.to(".mountains", {
x: -100
})
};
storyScrollTrigger.to(".birds", { storyScrollTrigger.to(".birds", {
x: (-window.innerWidth -200) x: (-window.innerWidth -200)
@ -206,7 +232,6 @@
x: -maxImageTranslateValue * (2/bubbleNumber), x: -maxImageTranslateValue * (2/bubbleNumber),
onStart: function() { onStart: function() {
document.getElementById("leymah").src = charWalkToRightImage; document.getElementById("leymah").src = charWalkToRightImage;
moveMountains();
}, },
onComplete: function() { onComplete: function() {
document.getElementById("leymah").src = charStaticImage; document.getElementById("leymah").src = charStaticImage;
@ -223,7 +248,6 @@
x: -maxImageTranslateValue * (3/bubbleNumber), x: -maxImageTranslateValue * (3/bubbleNumber),
onStart: function() { onStart: function() {
document.getElementById("leymah").src = charWalkToRightImage; document.getElementById("leymah").src = charWalkToRightImage;
moveMountains();
}, },
onComplete: function() { onComplete: function() {
document.getElementById("leymah").src = charStaticImage; document.getElementById("leymah").src = charStaticImage;
@ -240,7 +264,6 @@
x: -maxImageTranslateValue, x: -maxImageTranslateValue,
onStart: function() { onStart: function() {
document.getElementById("leymah").src = "static/images/story/character-walk-right.gif"; document.getElementById("leymah").src = "static/images/story/character-walk-right.gif";
moveMountains();
}, },
onComplete: function() { onComplete: function() {
document.getElementById("leymah").src = "static/images/story/character-static.png"; document.getElementById("leymah").src = "static/images/story/character-static.png";

View File

@ -75,10 +75,12 @@ header {
font-family: 'Karmatic Arcade'; font-family: 'Karmatic Arcade';
font-size: 2.75rem; font-size: 2.75rem;
margin-bottom: 1.25rem; margin-bottom: 1.25rem;
color: white;
} }
h3 { h3 {
min-height: 200px; min-height: 200px;
padding: 1rem; padding: 1rem;
color: #106ca2;
} }
@include media-breakpoint-down(xs) { @include media-breakpoint-down(xs) {
h3 { h3 {
@ -87,34 +89,34 @@ header {
} }
} }
} }
.clouds {
content: ""; }
position: absolute; .clouds {
bottom: 0; content: "";
right: 0; position: absolute;
height: 162px; bottom: 0;
overflow: hidden; right: 0;
width: 100%; height: 162px;
z-index: 1; overflow: hidden;
&.clouds-2 { width: 100%;
bottom: 25px; z-index: 1;
.cloud { &.clouds-2 {
transform: translateX(50px); bottom: 25px;
-webkit-animation-duration: 80s;
opacity: .6;
}
}
.cloud { .cloud {
background: url('../images/cloud.png') repeat-x; transform: translateX(50px);
height: 162px; -webkit-animation-duration: 80s;
width: 4000px; opacity: .6;
-webkit-animation-name: prop-600;
-webkit-animation-duration: 50s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-direction:alternate;
} }
} }
.cloud {
background: url('../images/cloud.png') repeat-x;
height: 162px;
width: 4000px;
-webkit-animation-name: prop-600;
-webkit-animation-duration: 50s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-direction:alternate;
}
} }
@-webkit-keyframes prop-600 { @-webkit-keyframes prop-600 {
0% { 0% {
@ -124,6 +126,7 @@ header {
-webkit-transform: translateX(-400px); -webkit-transform: translateX(-400px);
} }
} }
.custom-link{ .custom-link{
cursor: pointer; cursor: pointer;
font-family: "VCR OSD Mono"; font-family: "VCR OSD Mono";
@ -212,6 +215,7 @@ img{
.story-wrapper { .story-wrapper {
background: white; background: white;
position: relative; position: relative;
height: 100vh;
min-height: calc(672px + 75px); min-height: calc(672px + 75px);
padding-top: 75px; padding-top: 75px;
width: 100%; width: 100%;
@ -223,6 +227,7 @@ img{
max-width: none; max-width: none;
} }
.sky { .sky {
margin-top: 8vh;
z-index: 1; z-index: 1;
position: absolute; position: absolute;
top: 0; top: 0;
@ -230,6 +235,12 @@ img{
height: 242px; height: 242px;
background: url(../images/story/sky.jpg) repeat-x top left; background: url(../images/story/sky.jpg) repeat-x top left;
} }
.clouds {
bottom: auto;
top: 0;
z-index: 2;
transform: scaleY(-1);
}
.mountains { .mountains {
z-index: 5; z-index: 5;
position: absolute; position: absolute;
@ -242,6 +253,7 @@ img{
position: absolute; position: absolute;
z-index: 10; z-index: 10;
left: 0; left: 0;
bottom: 0;
overflow: hidden; overflow: hidden;
} }
.character { .character {