Skip to content

Commit 51919fb

Browse files
committed
Code for video number 6
1 parent 30ecdb2 commit 51919fb

File tree

6 files changed

+107
-2
lines changed

6 files changed

+107
-2
lines changed

css/layout1.sass

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,47 @@ img
123123
attachment: fixed
124124
margin-top: 100px
125125
border-radius: 50%
126+
position: relative
127+
128+
.window-tint
129+
background-color: rgba(0,0,0,0.5)
130+
position: absolute
131+
top: 0
132+
left: 0
133+
right: 0
134+
bottom: 0
135+
border-radius: 50%
136+
display: flex
137+
justify-content: center
138+
align-items: center
139+
opacity: 0
140+
141+
142+
.promo-text
143+
color: white
144+
font-weight: 100
145+
font-size: 50px
146+
line-height: 1.2
147+
148+
strong
149+
display: block
150+
font-size: 30px
151+
152+
span
153+
font:
154+
weight: 300
155+
size: 18px
156+
style: italic
157+
color: rgba(255,255,255,0.6)
158+
159+
.window-cta
160+
font-size: 20px
161+
text-decoration: none
162+
color: white
163+
border: 1px solid white
164+
padding: 10px 20px
165+
transition: all 0.3s ease-in-out
166+
167+
&:hover
168+
background: white
169+
color: black

css/style.css

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,4 +953,40 @@ img {
953953
background-repeat: repeat-y;
954954
background-attachment: fixed;
955955
margin-top: 100px;
956-
border-radius: 50%; }
956+
border-radius: 50%;
957+
position: relative; }
958+
.large-window .window-tint {
959+
background-color: rgba(0, 0, 0, 0.5);
960+
position: absolute;
961+
top: 0;
962+
left: 0;
963+
right: 0;
964+
bottom: 0;
965+
border-radius: 50%;
966+
display: flex;
967+
justify-content: center;
968+
align-items: center;
969+
opacity: 0; }
970+
.large-window .promo-text {
971+
color: white;
972+
font-weight: 100;
973+
font-size: 50px;
974+
line-height: 1.2; }
975+
.large-window .promo-text strong {
976+
display: block;
977+
font-size: 30px; }
978+
.large-window .promo-text span {
979+
font-weight: 300;
980+
font-size: 18px;
981+
font-style: italic;
982+
color: rgba(255, 255, 255, 0.6); }
983+
.large-window .promo-text .window-cta {
984+
font-size: 20px;
985+
text-decoration: none;
986+
color: white;
987+
border: 1px solid white;
988+
padding: 10px 20px;
989+
transition: all 0.3s ease-in-out; }
990+
.large-window .promo-text .window-cta:hover {
991+
background: white;
992+
color: black; }

index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ <h1>Clothing Store</h1>
6060
<hr>
6161
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa.</p>
6262
<hr>
63-
<div class="large-window"></div>
63+
<div class="large-window">
64+
<div class="window-tint">
65+
<div class="promo-text">Fall Suits<strong><span>from</span> $99</strong><a href="" class="window-cta">Shop Now</a></div>
66+
</div>
67+
</div>
6468
</article>
6569
<div style="height: 2000px"></div>
6670
</section>

index.jade

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ html(lang="en")
8080
hr
8181

8282
.large-window
83+
.window-tint
84+
.promo-text Fall Suits
85+
strong <span>from</span> $99
86+
a(href="").window-cta Shop Now
8387

8488

8589
div(style="height: 2000px")

js/functions.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,14 @@ $(window).scroll(function(){
2525

2626
}
2727

28+
if(wScroll > $('.large-window').offset().top - $(window).height()){
29+
30+
$('.large-window').css({'background-position':'center '+ (wScroll - $('.large-window').offset().top) +'px'});
31+
32+
var opacity = (wScroll - $('.large-window').offset().top + 400) / (wScroll / 5);
33+
34+
$('.window-tint').css({'opacity': opacity});
35+
36+
}
37+
2838
});

readme.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ Releases correspond to the videos. Visit the releases page on this repo to find
4646
- Grab the code we wrote in this video. [Get the code](https://github.com/DevTips/Parallax-on-the-Web-DevTips-/releases/tag/v0.4).
4747

4848

49+
50+
## Video 6 - "Promo-Scope"
51+
52+
<a href="https://youtu.be/zEXubVd_y_M"><img src="https://i.ytimg.com/vi/zEXubVd_y_M/mqdefault.jpg"><br>Watch on YouTube</a>
53+
54+
- Grab the code we wrote in this video. [Get the code](https://github.com/DevTips/Parallax-on-the-Web-DevTips-/releases/tag/v0.5).
55+
4956
---
5057

5158

0 commit comments

Comments
 (0)