背景

作者: 老板下碗面 | 来源:发表于2022-08-05 17:53 被阅读0次
效果 GIF.gif

上demo

<div class="card"></div>
@property --rotate {
  syntax: "<angle>";
  initial-value: 132deg;
  inherits: false;
}

:root {
  --card-height: 65vh;
  --card-width: calc(var(--card-height) / 1.5);
}


body {
  min-height: 100vh;
  background: #000;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding-top: 2rem;
  padding-bottom: 2rem;
  box-sizing: border-box;
}


.card {
  background: #191c29;
  width: var(--card-width);
  height: var(--card-height);
  padding: 3px;
  position: relative;
  border-radius: 6px;
  justify-content: center;
  align-items: center;
  text-align: center;
  display: flex;
  font-size: 1.5em;
  color: rgb(88 199 250 / 0%);
  cursor: pointer;
  font-family: cursive;
}

.card:hover {
  color: rgb(88 199 250 / 100%);
  transition: color 1s;
}
.card:hover:before, .card:hover:after {
  animation: none;
  opacity: 0;
}


.card::before {
  content: "";
  width: 104%;
  height: 102%;
  border-radius: 8px;
  background-image: linear-gradient(
    var(--rotate)
    , #5ddcff, #3c67e3 43%, #4e00c2);
    position: absolute;
    z-index: -1;
    top: -1%;
    left: -2%;
    animation: spin 2.5s linear infinite;
}

.card::after {
  position: absolute;
  content: "";
  top: calc(var(--card-height) / 6);
  left: 0;
  right: 0;
  z-index: -1;
  height: 100%;
  width: 100%;
  margin: 0 auto;
  transform: scale(0.8);
  filter: blur(calc(var(--card-height) / 6));
  background-image: linear-gradient(
    var(--rotate)
    , #5ddcff, #3c67e3 43%, #4e00c2);
    opacity: 1;
  transition: opacity .5s;
  animation: spin 2.5s linear infinite;
}

@keyframes spin {
  0% {
    --rotate: 0deg;
  }
  100% {
    --rotate: 360deg;
  }
}

a {
  color: #212534;
  text-decoration: none;
  font-family: sans-serif;
  font-weight: bold;
  margin-top: 2rem;
}

相关文章

  • CSS条纹背景,点阵背景,圆点背景。

    1、背景图片 废话不多说,上代码: 效果图如下: 投影:box-shadow: X坐标/ Y坐标/ 模糊/ 扩展/...

  • 背景

    当今世界,不得不说网络媒体的力量确实强大。最近几天网上在热传一则消息,浙江温州一对高颜值双胞胎姐妹双双...

  • 背景

    这个城市的高楼不断的在推陈出新,这个城市的房价不断的在节节攀升,这个城市的人口不断的在膨胀增长,这是我们所了解到的...

  • 背景

    设置背景样式:backgrou-color: #bfa;设置背景图片;使用background-image来设置背...

  • 背景

    背景: 图片做背景,background-image:url(img/**.ipg 相对路径);背景图片小于块大小...

  • 背景

    设置背景 背景的偏移和定位 按钮练习 作业

  • 背景

    其实这也是一种利益这段话。他并没有实际上的去使用父母的背景。 而父母却会暗地里使用自己的背景去帮助他。 这样子他记...

  • 背景

    请认真思考一下你的身份: 一个毫无任何背景的普通人。 父母是普通老百姓,上半辈子一直是面朝黄土背朝天,以土为生。下...

  • 背景

    你站在人群里,一言不发 周围的车流和人流不过是一张背景 你是走是停,没有人能够决定 那一句句埋在心里的话 只能说给...

  • 背景

    人类的孤注一掷成功了。在史蒂芬教授和白鹤少校的带领下,仅有四百万余人和凝聚了人类千年智慧结晶的大量机器成功...

网友评论

      本文标题:背景

      本文链接:https://www.haomeiwen.com/subject/taipwrtx.html