您当前的位置:首页 > 计算机 > 编程开发 > Html+Div+Css(前端)

CSSFX 简单漂亮的 CSS 动画特效库

时间:12-14来源:作者:点击数:

精心设计的 CSS 动画特效库,注重流动性、简洁性和易用性。由 CSS 支持,代码量最少。完全开放源码项目。

安装运行

在本地运行,npm install 然后 npm run dev

使用方法

<div>
  <input type="text" placeholder="Input Underline">
  <span></span>
</div>
div {
  position: relative;
}

input {
  width: 6.5em;
  color: white;
  font-size: inherit;
  font-family: inherit;
  background-color: transparent;
  border: 1px solid transparent;
  border-bottom-color: hsla(341, 97%, 59%, 0.2);
}

input:focus {
  outline: none;
}

input::placeholder {
  color: hsla(0, 0%, 100%, 0.6);
}

span {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100%;
  height: 1px;
  opacity: 0;
  background-color: #fc2f70;
  transform-origin: center;
  transform: translate(-50%, 0) scaleX(0);
  transition: all 0.3s ease;
}

input:focus ~ span {
  transform: translate(-50%, 0) scaleX(1);
  opacity: 1;
}

官网: cssfx.netlify 商业网/

方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门
本栏推荐