Skip to content

Commit 8ce64db

Browse files
committed
v1
1 parent 2239d51 commit 8ce64db

File tree

3 files changed

+48
-19
lines changed

3 files changed

+48
-19
lines changed

winchester/attempt2.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ document.addEventListener("DOMContentLoaded", function(event) {
6060
})
6161

6262
tlIntro.addLabel('start')
63-
.add(gsap.to('#mission',{ x: 0, duration: 1}))
64-
.add(gsap.to('#vision',{ x: 0, duration: 1}),"<+=1")
63+
.add(gsap.to('#mission',{ x: 0, duration: 2}))
64+
.add(gsap.to('#vision',{ x: 0, duration: 2}),"<+=1")
6565

6666
// Goals Wheel
6767
const tlGoals = gsap.timeline({
@@ -73,23 +73,25 @@ document.addEventListener("DOMContentLoaded", function(event) {
7373
scrub: 0.5, // smooth scrubbing, takes 1 second to "catch up" to the scrollbar
7474
snap: {
7575
snapTo: 'labels', // snap to the closest label in the timeline
76-
duration: { max: 0.3 }, // the snap animation should be at least 0.2 seconds, but no more than 3 seconds (determined by velocity)
76+
// duration: { max: 0.3 }, // the snap animation should be at least 0.2 seconds, but no more than 3 seconds (determined by velocity)
7777
// delay: 0.1, // wait 0.2 seconds from the last scroll event before doing the snapping
7878
ease: 'power2.inOut' // the ease of the snap animation ("power3" by default)
7979
},
8080
// markers: true,
8181
}
8282
});
8383

84-
const labelOutState = {x: "-100%", scale: "0"}
84+
const duration = 10
85+
const labelOutState = {x: "-100%", scale: "0", duration: duration}
8586
const labelOutTiming = "" //'-=0.2'
86-
const labelInState = {x: 0, scale: "1"}
87+
const labelInState = {x: 0, scale: "1", duration: duration}
8788
const labelInTiming = "+=0.2"
89+
8890
tlGoals.addLabel("start")
8991
.add(gsap.to('#sports',{ y:50, duration: 1}),"start")
9092
// .add(gsap.to('#goals',{ paddingTop: "0px"}),"start")
9193
.addLabel("community")
92-
.to("#community",{x: 0, scale: "1"})
94+
.to("#community",{x: 0, scale: "1", duration: duration})
9395
.addLabel('support')
9496
.to('#goal-wheel', { rotation: 90 })
9597
.add(gsap.to("#community",labelOutState),`support${labelOutTiming}`)
@@ -111,16 +113,16 @@ document.addEventListener("DOMContentLoaded", function(event) {
111113
const tlPriority = gsap.timeline({
112114
scrollTrigger: {
113115
trigger: '#priorities',
114-
start: '200px top',
116+
start: 'top top',
115117
end: 'bottom top',
116-
scrub: true,
118+
scrub: 0.5,
117119
pin: true,
118120
markers: true,
119121
snap: {
120122
snapTo: 'labels', // snap to the closest label in the timeline
121123
duration: { max: 0.3 }, // the snap animation should be at least 0.2 seconds, but no more than 3 seconds (determined by velocity)
122124
// delay: 0.1, // wait 0.2 seconds from the last scroll event before doing the snapping
123-
ease: 'power2.inOut' // the ease of the snap animation ("power3" by default)
125+
ease: 'power1.inOut' // the ease of the snap animation ("power3" by default)
124126
},
125127
}
126128
})
@@ -159,8 +161,8 @@ document.addEventListener("DOMContentLoaded", function(event) {
159161
});
160162

161163
function moveForward() {
162-
timeline.seek(timeline.nextLabel())
164+
timeline.tweenTo(timeline.nextLabel(),{ease: "power5.inOut"})
163165
}
164166
function moveBack() {
165-
timeline.seek(timeline.previousLabel())
167+
timeline.tweenTo(timeline.previousLabel(),{ease: "power5.inOut"})
166168
}

winchester/design1.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<div id="journey-line" data-depth='0.1'></div>
1818
</div>
1919

20-
<!-- <header id="hero">
20+
<header id="hero">
2121
<h1>winchester students&apos; union strategy</h1>
2222
<div id="hero-image" class="imagery"></div>
2323
</header>
@@ -33,8 +33,8 @@ <h2>our vision</h2>
3333
<p>Winchester Students&apos; Union will empower our membership through the creation of innovative and inclusive student led, student delivered opportunities, activities and representation. </p>
3434
</div>
3535
</section>
36-
-->
37-
<!--
36+
37+
3838
<section id="goals">
3939

4040
<div id="sports" class="picture"></div>
@@ -53,7 +53,7 @@ <h2>Our Goals</h2>
5353
</div>
5454
</div>
5555
</div>
56-
</section> -->
56+
</section>
5757

5858
<!-- <section class="spacer"></section> -->
5959

@@ -112,7 +112,11 @@ <h3>collaboration</h3>
112112
<p>Improving collaboration and partnerships with the University to achieve the best experience for students.</p>
113113
</li>
114114
</ul>
115-
<button onclick="moveForward()">Next</button>
115+
<div id="controls">
116+
<button onclick="moveBack()">Previous</button>
117+
<button onclick="moveForward()">Next</button>
118+
</div>
119+
116120
</section>
117121

118122

winchester/parallax.css

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
--hero-height: 100vh;
1212
--line-thickness: 12px;
1313
--line-wiggle-room: 150px;
14-
--max-column-width: 1024px;
14+
--max-column-width: 1440px;
1515
}
1616

1717
body {
@@ -200,6 +200,7 @@ section#introduction {
200200
@media screen and (min-width: 1024px) {
201201
#goals {
202202
padding-top: 100px;
203+
height: 66vh;
203204
}
204205
#goals .picture {
205206
left: calc(50% - 512px);
@@ -260,7 +261,8 @@ section#introduction {
260261
margin: 0 auto;
261262
}
262263
.rotator #goal-wheel-wrap {
263-
width: 75%;
264+
height: 100%;
265+
width: 80%;
264266
padding-top: 80px;
265267
background-image: url(./arrow.png);
266268
background-repeat: no-repeat;
@@ -269,6 +271,10 @@ section#introduction {
269271
background-size: 200px;
270272
position: relative;
271273
}
274+
.rotator #goal-wheel-wrap img {
275+
max-height: 100%;
276+
}
277+
272278
.rotator #goal-wheel-wrap .logo {
273279
width: 100%; height: calc(100% - 80px);
274280
position: absolute;
@@ -287,7 +293,8 @@ section#introduction {
287293
width: 100%;
288294
}
289295
.rotator #goal-wheel-wrap {
290-
max-width: 50%;
296+
/* max-width: 50%; */
297+
width: 100%;
291298
}
292299
#goals .description .value {
293300
font-size: 3rem;
@@ -360,6 +367,22 @@ section#introduction {
360367
color: #fff;
361368
}
362369

370+
#controls {
371+
width: 100%;
372+
padding: 2rem 0 ;
373+
display: flex;
374+
justify-content: center;
375+
gap: 1rem;
376+
}
377+
#controls button {
378+
padding: 1rem;
379+
font-size: 3rem;
380+
color: #fff;
381+
border: solid 1px transparent;
382+
background-color: var(--organisation);
383+
border-radius: 1rem;
384+
}
385+
363386
#footer {
364387
height: 20rem;
365388
background-color: var(--organisation);

0 commit comments

Comments
 (0)