Skip to content

Commit

Permalink
Added button hover animation (#2228)
Browse files Browse the repository at this point in the history
* 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
shag1802 and sophiabrandt authored Oct 27, 2023
1 parent 5c52bba commit e52130d
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 1 deletion.
Binary file added Art/shag1802/hover_ani.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions Art/shag1802/index.html
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>
62 changes: 62 additions & 0 deletions Art/shag1802/style.css
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;
}
11 changes: 10 additions & 1 deletion include.js
Original file line number Diff line number Diff line change
Expand Up @@ -2210,13 +2210,22 @@ let cards = [
githubLink: 'https://github.com/ishanchaskar'
},
{
artName: 'Button Fill Animation',
pageLink: './Art/shag1802/index.html',
imageLink: './Art/shag1802/hover_ani.gif',
author: 'Shaurya Agrawal',
githubLink: 'https://github.com/shag1802'
},
{
artName: 'Circle',
artName: 'Magic Card',
pageLink: './Art/URK21CS1064/index.html',
imageLink: './Art/URK21CS1064/hacktober.png',
author: 'URK21CS1064',
githubLink: 'https://github.com/URK21CS1064'
},
{ artName: 'Circle',
{
artName: 'Circle',
pageLink: './Art/rishiiiidha/index.html',
imageLink: './Art/rishiiiidha/animation.gif',
author: 'Rishidha',
Expand Down

0 comments on commit e52130d

Please sign in to comment.