gsap+svg实现炫酷古典菜单悬停动画效果代码
代码语言:html
所属分类:菜单导航
代码描述:gsap+svg实现炫酷古典菜单悬停动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@1,500&display=swap");
html,
body {
height: 100%;
}
body {
background-color: #3d3e4a;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.container {
align-items: center;
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.radio-btn-group {
margin: 10px;
}
input[type=radio] {
opacity: 0;
position: absolute;
}
input[type=radio]:checked + label::before {
box-shadow: 0 0 25px 2px #244f2e;
}
input[type=radio]:checked + label span {
color: #fff;
}
input[type=radio]:focus + label::before {
box-shadow: 0 0 25px 2px #244f2e;
}
label {
color: #fff;
cursor: pointer;
display: flex;
font-weight: 500;
font-style: italic;
align-items: center;
justify-content: center;
font-family: "IBM Plex Mono", monospace;
height: 50px;
padding: 0 30px;
position: relative;
}
label::before {
background-color: #24252c;
background-image: repeating-linear-gradient(0deg, #181a29, #181a29 1px, #202436 1px, #202436 2px);
border-radius: 10px;
box-shadow: 0 0 0 0 #244f2e;
content: "";
height: 100%;
position: absolute;
left: 0;
top: 0;
overflow: hidden;
transform: skew(-15deg);
transition: box-shadow 700ms;
width: 100%;
z-index: -1;
}
label span {
transition: color 350ms;
z-index: 1;
}
label svg {
border-radius: 10px;
overflow: hidden;
position: absolute;
transform: skew(-15deg);
}
label svg rect {
fill: #76b3fa;
shape-rendering: crispEdges;
}
</style>
</head>
<body translate="no">
<div class="container">
<div class="radio-btn-group">
<input type="radio" name="stagger-radio-group" value="1" id="input-one" />
<label for="input-one">
<span>Opt.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0