Skip to content

Commit aa445aa

Browse files
committed
btn swip with text effect
1 parent 14fcfb4 commit aa445aa

File tree

3 files changed

+70
-6
lines changed

3 files changed

+70
-6
lines changed

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<a href="#" class="button-1">Hover Me</a>
1414
<a href="#" class="button-2">Hover Me</a>
1515
<a href="#" class="button-3">Hover Me</a>
16+
<a href="#" class="button-4">Hover Me</a>
1617
</div>
1718

1819
</body>

sass/style.scss

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ body {
1313
}
1414

1515
.button-container {
16-
width: 100%;
17-
height: 100vh;
16+
width: 90%;
17+
height: 30%;
1818
margin-left: auto;
1919
margin-right: auto;
2020
display: flex;
@@ -30,7 +30,7 @@ body {
3030
border: 2px solid #272727;
3131
padding: 20px 40px;
3232
position: relative;
33-
margin: 25px;
33+
margin: 5px 25px;
3434
}
3535

3636
.button-1 {
@@ -126,4 +126,36 @@ body {
126126
.button-3:hover:after {
127127
transform: rotateY(0deg);
128128
}
129+
130+
.button-4 {
131+
color: #fff;
132+
border-color: #fff;
133+
background-color: #222;
134+
overflow: hidden;
135+
transition: all 1s;
136+
}
137+
138+
.button-4:before {
139+
display: flex;
140+
align-items: center;
141+
justify-content: center;
142+
content: "YEAH!";
143+
position: absolute;
144+
top: 0;
145+
left: 0;
146+
background-color: #f44336;
147+
height: 100%;
148+
width: 100%;
149+
// z-index: -3;
150+
transform: translateY(-100%);
151+
transition: all 1s;
152+
}
153+
154+
.button-4:hover:before {
155+
transform: translateY(0);
156+
}
157+
158+
.button-4:hover {
159+
color: #fff;
160+
}
129161
}

style/style.css

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ body {
1313
}
1414

1515
.button-container {
16-
width: 100%;
17-
height: 100vh;
16+
width: 90%;
17+
height: 30%;
1818
margin-left: auto;
1919
margin-right: auto;
2020
display: flex;
@@ -31,7 +31,7 @@ body {
3131
border: 2px solid #272727;
3232
padding: 20px 40px;
3333
position: relative;
34-
margin: 25px;
34+
margin: 5px 25px;
3535
}
3636

3737
.button-container .button-1 {
@@ -127,3 +127,34 @@ body {
127127
.button-container .button-3:hover:after {
128128
transform: rotateY(0deg);
129129
}
130+
131+
.button-container .button-4 {
132+
color: #fff;
133+
border-color: #fff;
134+
background-color: #222;
135+
overflow: hidden;
136+
transition: all 1s;
137+
}
138+
139+
.button-container .button-4:before {
140+
display: flex;
141+
align-items: center;
142+
justify-content: center;
143+
content: "YEAH!";
144+
position: absolute;
145+
top: 0;
146+
left: 0;
147+
background-color: #f44336;
148+
height: 100%;
149+
width: 100%;
150+
transform: translateY(-100%);
151+
transition: all 1s;
152+
}
153+
154+
.button-container .button-4:hover:before {
155+
transform: translateY(0);
156+
}
157+
158+
.button-container .button-4:hover {
159+
color: #fff;
160+
}

0 commit comments

Comments
 (0)