Skip to content

Commit 0ef8d31

Browse files
author
Joseph Harvey Angeles
committed
Section 2 completion
1 parent 2e1ad1f commit 0ef8d31

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

Natours/starter/css/style.css

+66
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ body {
3737
top: 40%;
3838
left: 50%;
3939
transform: translate(-50%, -50%);
40+
text-align: center;
4041
}
4142

4243
.header {
@@ -53,6 +54,7 @@ body {
5354
color: #FFF;
5455
text-transform: uppercase;
5556
backface-visibility: hidden; /* hide the background so that when children animates, it doesn't interfere */
57+
margin-bottom: 60px;
5658
}
5759

5860
.heading-primary-main {
@@ -100,4 +102,68 @@ body {
100102
opacity: 1;
101103
transform: translate(0); /* reset to original */
102104
}
105+
}
106+
107+
@keyframes moveInBottom {
108+
0% {
109+
opacity: 0;
110+
transform: translateY(30px);
111+
}
112+
100% {
113+
opacity: 1;
114+
transform: translate(0); /* reset to original */
115+
}
116+
}
117+
118+
.btn:link, .btn:visited {
119+
text-transform: uppercase;
120+
text-decoration: none;
121+
padding: 15px 40px;
122+
display: inline-block;
123+
border-radius: 100px;
124+
transition: all .2s;
125+
position: relative;
126+
}
127+
128+
.btn:hover {
129+
transform: translateY(-3px);
130+
/* box-shadow: x-dir y-dir blur color */
131+
box-shadow: 0 10px 20px rgba(0, 0, 0, .2);
132+
}
133+
134+
.btn:active { /* clicked state */
135+
transform: translateY(-1px); /* minus 1 to initial state not to hover */
136+
box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
137+
}
138+
139+
.btn-white {
140+
background-color: #fff;
141+
color: #777;
142+
}
143+
144+
.btn::after {
145+
content: "";
146+
display: inline-block;
147+
height: 100%;
148+
width: 100%;
149+
border-radius: 100px;
150+
position: absolute;
151+
top: 0;
152+
left: 0;
153+
z-index: -1;
154+
transition: all .4s;
155+
}
156+
157+
.btn-white::after {
158+
background-color: #fff;
159+
}
160+
161+
.btn:hover::after { /* apply style on hover::after*/
162+
transform: scaleX(1.4) scaleY(1.6);
163+
opacity: 0;
164+
}
165+
166+
.btn-animated {
167+
animation: moveInBottom .5s ease-out .75s;
168+
animation-fill-mode: backwards; /* apply all initial 0% state of the animation before the animation starts */
103169
}

Natours/starter/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ <h1 class="heading-primary"> <!-- SEO checks for h1, we want the whole slogan to
2222
<span class="heading-primary-main">Outdoors</span>
2323
<span class="heading-primary-sub">is where life happens</span>
2424
</h1>
25+
<a href="#" class="btn btn-white btn-animated">Discover our tours</a>
2526
</div>
2627
</header>
2728

0 commit comments

Comments
 (0)