Skip to content

Commit ed999a0

Browse files
committed
Added Push Sideward Hover Button
1 parent da9b574 commit ed999a0

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Styled Hover Button</title>
7+
<style>
8+
/* Centering the button */
9+
body {
10+
display: flex;
11+
justify-content: center;
12+
align-items: center;
13+
height: 100vh;
14+
background-color: #f4f4f4; /* Light background */
15+
}
16+
17+
/* Button Styling */
18+
.group {
19+
position: relative;
20+
display: inline-flex;
21+
height: 50px;
22+
width: 150px;
23+
align-items: center;
24+
justify-content: center;
25+
overflow: hidden;
26+
border-radius: 8px;
27+
border: 2px solid #525252;
28+
font-size: 16px;
29+
font-weight: 600;
30+
cursor: pointer;
31+
background-color: white;
32+
}
33+
34+
/* Default Text */
35+
.button-text {
36+
position: absolute;
37+
display: flex;
38+
height: 100%;
39+
width: 100%;
40+
align-items: center;
41+
justify-content: center;
42+
background-color: white;
43+
color: #222;
44+
transition: transform 0.3s ease-in-out;
45+
}
46+
47+
/* Hover Text */
48+
.button-hover {
49+
position: absolute;
50+
display: flex;
51+
height: 100%;
52+
width: 100%;
53+
align-items: center;
54+
justify-content: center;
55+
background-color: #3498db; /* Blue background */
56+
color: white;
57+
transform: translateX(100%);
58+
transition: transform 0.3s ease-in-out;
59+
}
60+
61+
/* Hover Effect */
62+
.group:hover .button-text {
63+
transform: translateX(-100%);
64+
}
65+
.group:hover .button-hover {
66+
transform: translateX(0);
67+
}
68+
</style>
69+
</head>
70+
<body>
71+
<button class="group">
72+
<div class="button-text">Hover me</div>
73+
<div class="button-hover">Hover me</div>
74+
</button>
75+
</body>
76+
</html>

assets/json_files/buttons.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@
199199
"previewLink": "../../Components/Buttons/Pulsing-Button/index.html",
200200
"sourceLink": "https://github.com/Rakesh9100/Beautiify/tree/main/Components/Buttons/Pulsing-Button"
201201
},
202+
{
203+
"title": "Push Sideward Hover Button",
204+
"previewLink": "../../Components/Buttons/Push-Sideward-Hover-Button/index.html",
205+
"sourceLink": "https://github.com/Rakesh9100/Beautiify/tree/main/Components/Buttons/Push-Sideward-Hover-Button"
206+
207+
},
202208
{
203209
"title": "Rainbow Animation Button",
204210
"previewLink": "../../Components/Buttons/Rainbow-Animation-Button/index.html",

0 commit comments

Comments
 (0)