CSS动态阴影效果:舞动的影子

SHADOW

这款动态阴影效果,营造出生动的动画效果,文字的阴影在对角线上动态移动。阴影在两种颜色之间平滑交替,不断扩张和收缩,从而产生运动的错觉。


代码

<div class="shadow-dance-container">
<h1 class="shadow-dance-text">SHADOW</h1>
</div>

<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background: #121212;
font-family: 'Arial', sans-serif;
}

.shadow-dance-text {
font-size: 4rem;
color: #fff;
text-shadow: 5px 5px 0 #ff005e, 10px 10px 0 #00d4ff;
animation: shadow-dance 2s infinite;
}

@keyframes shadow-dance {
0%, 100% {
text-shadow: 5px 5px 0 #ff005e, 10px 10px 0 #00d4ff;
}
50% {
text-shadow: -5px -5px 0 #00d4ff, -10px -10px 0 #ff005e;
}
}
</style>


本文内容仅供个人学习/研究/参考使用,不构成任何决策建议或专业指导。分享/转载时请标明原文来源,同时请勿将内容用于商业售卖、虚假宣传等非学习用途哦~感谢您的理解与支持!

链接: https://fly63.com/course/33_2162

目录选择