标签:动画 效果 clip hue 优秀 inset path 95% linear
<!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>Document</title>
<style>
body {
background-color: black;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
div {
height: 100px;
width: 150px;
position: relative;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
background-image: linear-gradient(45deg, gold, deeppink);
animation: hue 3s infinite linear;
}
div::before,
div::after {
content: "";
position: absolute;
top: -15px;
bottom: -15px;
left: -15px;
right: -15px;
border: 5px solid #24acf2;
border-image: linear-gradient(45deg, gold, deeppink) 1;
clip-path: inset(0px round 10px);
animation: clippath 3s infinite linear;
}
div::after {
animation: clippath 3s infinite -1.5s linear;
}
span {
color: white;
font-size: 20px;
}
@keyframes hue {
0% {
filter: hue-rotate(0deg);
}
100% {
filter: hue-rotate(360deg);
}
}
@keyframes clippath {
0% {
clip-path: inset(0 0 95% 0);
filter: hue-rotate(0deg);
}
25% {
clip-path: inset(0 95% 0 0);
}
50% {
clip-path: inset(95% 0 0 0);
}
75% {
clip-path: inset(0 0 0 95%);
}
100% {
clip-path: inset(0 0 95% 0);
filter: hue-rotate(360deg);
}
}
</style>
</head>
<body>
<div>
<span>hello world</span>
</div>
</body>
</html>
传送门:https://juejin.cn/post/7076371912711995423
标签:动画,效果,clip,hue,优秀,inset,path,95%,linear 来源: https://www.cnblogs.com/DL-CODER/p/16602257.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。