Created
April 16, 2024 15:59
-
-
Save codepediair/03542d1ff4df6f7b676bd8dfbd4330d3 to your computer and use it in GitHub Desktop.
animation Menu
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
<ul> | |
<li style="--clr:#5E81AC"> | |
<a href="#" data-text=" Home"> Home </a> | |
</li> | |
<li style="--clr:#BF616A"> | |
<a href="#" data-text=" About"> About </a> | |
</li> | |
<li style="--clr:#EBCB8B"> | |
<a href="#" data-text=" Services"> Services </a> | |
</li> | |
<li style="--clr:#A3BE8C"> | |
<a href="#" data-text=" Blog"> Blog </a> | |
</li> | |
<li style="--clr:#B48EAD"> | |
<a href="#" data-text=" Contact"> Contact </a> | |
</ul> |
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
@import url('https://fonts.googleapis.com/css2?family=Mochiy+Pop+One&display=swap'); | |
* { | |
box-sizing: border-box; | |
padding: 0; | |
margin: 0; | |
font-family: 'Mochiy Pop One', sans-serif; | |
} | |
body { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
min-height: 100vh; | |
background: #E5E9F0; | |
} | |
ul { | |
position: relative; | |
display: flex; | |
flex-direction: column; | |
gap: 30px; | |
} | |
ul li { | |
position: relative; | |
list-style: none; | |
} | |
ul li a { | |
font-size: 4em; | |
text-decoration: none; | |
letter-spacing: 2px; | |
line-height: 1em; | |
text-transform: uppercase; | |
color: transparent; | |
-webkit-text-stroke: 1px #2E3440; | |
} | |
ul li a::before { | |
content: attr(data-text); | |
position: absolute; | |
color: var(--clr); | |
width: 0; | |
overflow: hidden; | |
transition: 1s; | |
border-right: 8px solid var(--clr); | |
-webkit-text-stroke: 1px var(--clr); | |
} | |
ul li a:hover::before { | |
width: 100%; | |
filter: drop-shadow(0 0 25px var(--clr)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment