Skip to content

Commit

Permalink
1. finish section 5-5
Browse files Browse the repository at this point in the history
  • Loading branch information
andy922200 committed Feb 13, 2022
1 parent 6b86a49 commit 9781655
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
25 changes: 25 additions & 0 deletions section5/5-5/index.html
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Section 5-5 - Top and Bottom Reverse Effect</title>
<link rel="stylesheet" href="style.css">
</head>

<body>

<h2>Top and Bottom Reverse Effect</h2>

<div class="link-container">
<a href="#" class="link top-and-bottom-left-to-right">Top and Bottom Left to Right Reverse Effect</a>
</div>

<div class="link-container orange-red">
<a href="#" class="link top-and-bottom-right-to-left">Top and Bottom Right to Left Reverse Effect</a>
</div>
</body>

</html>
79 changes: 79 additions & 0 deletions section5/5-5/style.css
@@ -0,0 +1,79 @@
*{
box-sizing: border-box;
}

.link-container{
background-color: darkcyan;
padding:1rem;
height:200px;
display: flex;
justify-content: center;
align-items: center;
}

.link-container.orange-red{
background-color: orangered;
}

.link{
text-decoration: none;
font-size:24px;
color:white;
position:relative;
}

.top-and-bottom-left-to-right::before{
content: '';
position:absolute;
width:0;
height:5px;
background-color: yellow;
border-radius: 4px;
top:0;
left:0;
transition: width 0.75s ease;
}

.top-and-bottom-left-to-right::after{
content: '';
position:absolute;
width:0;
height:5px;
background-color: yellow;
border-radius: 4px;
bottom:0;
right:0;
transition: width 0.75s ease;
}

.top-and-bottom-left-to-right:hover::before, .top-and-bottom-left-to-right:hover::after{
width:100%;
}

.top-and-bottom-right-to-left::before{
content: '';
position:absolute;
width:0;
height:5px;
background-color: pink;
border-radius: 4px;
top:0;
right:0;
transition: width 0.75s ease;
}

.top-and-bottom-right-to-left::after{
content: '';
position:absolute;
width:0;
height:5px;
background-color: pink;
border-radius: 4px;
bottom:0;
left:0;
transition: width 0.75s ease;
}

.top-and-bottom-right-to-left:hover::before, .top-and-bottom-right-to-left:hover::after{
width:100%;
}

0 comments on commit 9781655

Please sign in to comment.