游客

CSS每日创意特效集锦 渐变色按钮到3D旋转立方体

一言准备中...

🌈 CSS 每日一练

🎨 渐变色按钮

.btn-gradient {
  background: linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.btn-gradient:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

✨ 卡片悬停效果

.card {
  width: 300px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: transform 0.5s ease;
}

.card:hover {
  transform: translateY(-10px) rotate(2deg);
}

.card-img {
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-img {
  transform: scale(1.1);
}

🌟 文字流光效果

.text-shine {
  font-size: 3rem;
  background: linear-gradient(90deg, #ff4d4d, #f9cb28, #ff4d4d);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shine 3s linear infinite;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

🍃 呼吸灯效果

.breathing-light {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #4facfe;
  box-shadow: 0 0 10px #4facfe;
  animation: breathing 3s ease-in-out infinite;
}

@keyframes breathing {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
    box-shadow: 0 0 20px #4facfe;
  }
}

🌀 3D旋转立方体

.cube-container {
  perspective: 1000px;
  width: 200px;
  height: 200px;
}

.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: spin 10s infinite linear;
}

.cube-face {
  position: absolute;
  width: 200px;
  height: 200px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
}

.front  { transform: rotateY(0deg) translateZ(100px); background: #ff5e62; }
.back   { transform: rotateY(180deg) translateZ(100px); background: #4facfe; }
.right  { transform: rotateY(90deg) translateZ(100px); background: #a6c1ee; }
.left   { transform: rotateY(-90deg) translateZ(100px); background: #fbc2eb; }
.top    { transform: rotateX(90deg) translateZ(100px); background: #84fab0; }
.bottom { transform: rotateX(-90deg) translateZ(100px); background: #8fd3f4; }

@keyframes spin {
  from { transform: rotateX(0) rotateY(0); }
  to { transform: rotateX(360deg) rotateY(360deg); }
}
  • 本文作者:菜鬼
  • 本文链接: https://caigui.net/post-104.html
  • 版权声明:本博客所有文章除特别声明外,均默认采用 CC BY-NC-SA 4.0 许可协议。
文章很赞!支持一下吧 还没有人为TA充电
为TA充电
还没有人为TA充电
0
0
  • 支付宝打赏
    支付宝扫一扫
  • 微信打赏
    微信扫一扫
感谢支持
文章很赞!支持一下吧
关于作者
130
4
0
1
梦想不大,创造神话。

CSS魔法每日精选 打造灵动视觉盛宴

上一篇

CSS渐变艺术 打造如晚霞绚丽的背景与彩虹文字

下一篇
评论区
内容为空

这一切,似未曾拥有