-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added button hover animation (#2228)
* added button hover animation * Change in include.js * removing access comments * added missing comma at the end of my entry --------- Co-authored-by: Sophia Brandt <16630701+sophiabrandt@users.noreply.github.com>
- Loading branch information
1 parent
5c52bba
commit e52130d
Showing
4 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Button Hover</title> | ||
<link rel="stylesheet" href="./style.css"> | ||
</head> | ||
<body> | ||
<div class="button"> | ||
<a href="#"> | ||
HOVER ME | ||
</a> | ||
</div> | ||
</body > | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
*{ | ||
padding: 0; | ||
margin: 0; | ||
box-sizing: border-box; | ||
} | ||
body { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
background-color: #0c002b; | ||
} | ||
|
||
.button{ | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 400px; | ||
height: 100px; | ||
position: relative; | ||
overflow: hidden; | ||
border: 1px solid #1779ff; | ||
border-radius: 20px; | ||
} | ||
|
||
.button a{ | ||
text-decoration: none; | ||
color: white; | ||
font-size: 48px; | ||
transition: 0.5s letter-spacing , 0.5s color; | ||
} | ||
.button::after{ | ||
content :""; | ||
width: 100%; | ||
height: 50%; | ||
background-color: #1779ff; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
transform: translateX(100%) translateY(-100%); | ||
transition: 0.5s transform; | ||
z-index: -1; | ||
} | ||
.button::before{ | ||
content :""; | ||
width: 100%; | ||
height: 50%; | ||
background-color: #1779ff; | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
transform: translateX(-100%) translateY(+100%); | ||
transition: 0.5s transform; | ||
z-index: -1; | ||
} | ||
.button:hover::after,.button:hover::before{ | ||
transform: translateX(0%) translateY(0%); | ||
} | ||
.button:hover a{ | ||
letter-spacing: 2px; | ||
color: #0c002b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters