文字悬浮填充背景色动画

代码语言:html

所属分类:悬停

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Roboto:900'>
<style>
/*--------------------
Body
--------------------*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  padding: 50px 0;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse farthest-corner at center bottom, #6beace, #2e9aa4);
  color: #8b9095;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  font-size: 80px;
  letter-spacing: 0.02em;
  display: -webkit-box;
  display: flex;
  -webkit-box-pack: center;
          justify-content: center;
  -webkit-box-align: center;
          align-items: center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
          flex-direction: column;
}
@media (max-width: 400px) {
  body {
    font-size: 50px;
  }
}

span {
  cursor: pointer;
  -webkit-text-stroke-color: #fff;
  -webkit-text-stroke-width: 0.02em;
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-repeat: no-repeat;
  -webkit-transition: background-size 0.5s cubic-bezier(0.67, 0.01, 0.15, 0.98);
  transition: background-size 0.5s cubic-bezier(0.67, 0.01, 0.15, 0.98);
}

.top {
  background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), color-stop(50%, #fff), color-stop(50.1%, transparent));
  background-image: linear-gradient(180deg, #fff 0%, #fff 50%, transparent 50.1%);
  background-position: 100% 0%;
  background-size: 100% 0%;
}
.top:hover {
  background-size: 100% 200%;
}

.right {
  background-image: -webkit-gradient(linear, right top, lef.........完整代码请登录后点击上方下载按钮下载查看

网友评论0