上下左右步进选择框动画效果

代码语言:html

所属分类:表单美化

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

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

<link href="https://fonts.googleapis.com/css?family=Roboto:900" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="http://repo.bfw.wiki/bfwrepo/css/font-awesome-4.7.0/css/font-awesome.min.css">
<style>
html,
body {
  height: 100%;
}

body {
  background: #FF6F72;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  font-size: 80px;
  font-family: 'Roboto', sans-serif;
  overflow: hidden;
}

.wrap {
  display: flex;
  align-items: center;
}

.stepper.vertical {
  position: relative;
  text-align: center;
  width: 300px;
  height: 300px;
}
.stepper.vertical .arrow {
  width: 70px;
  opacity: .5;
  transition: all .2s ease-in-out;
  cursor: pointer;
  position: relative;
}
.stepper.vertical .arrow:hover {
  opacity: 1;
}
.stepper.vertical .arrow.top {
  -webkit-transform: rotate(90deg);
          transform: rotate(90deg);
  top: 25px;
}
.stepper.vertical .arrow.bottom {
  -webkit-transform: rotate(-90deg);
          transform: rotate(-90deg);
  margin-top: 16px;
  top: -20px;
}
.stepper.vertical .box {
  overflow: hidden;
  height: 92px;
  position: relative;
  padding: 10px 0;
}
.stepper.vertical .box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to bottom, #ff6f72 0%, rgba(125, 185, 232, 0) 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff6f72', endColorstr='#007db9e8',GradientType=0 );
  z-index: 1;
}
.stepper.vertical .box::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to bottom, #ff6f72 0%, rgba(125, 185, 232, 0) 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff6f72', endColorstr='#007db9e8',GradientType=0 );
  z-index: 1;
  -webkit-transform: rotate(180deg);
          transform: rotate(180deg);
}
.stepper.vertical .box span {
  display: inline-block;
  letter-spacing: 1px;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}
.stepper.vertical .box .numbers1 {
  position: absolute;
  top: 12px;
  left: 80px;
  display: flex;
}
.stepper.vertical .box .numbers1 span {
  -webkit-transform: translateY(0);
          transform: translateY(0);
}
.stepper.vertical .box .numbers2 {
  position: absolute;
  top: 12px;
  left: 80px;
  display: flex;
}
.stepper.vertical .box .numbers2 span {
  -webkit-transform: translateY(90px);
          transform: translateY(90px);
}
.stepper.horizontal {
  position: relative;
  text-align: center;
  width: 300px;
  height: 119px;
}
.stepper.horizontal .arrow {
  width: 70px;
  opacity: .5;
  transition: all .2s ease-in-out;
  cursor: pointer;
  position: absolute;
}
.stepper.horizontal .arrow:hover {
  opacity: 1;
}
.stepper.horizontal .arrow.top {
  -webkit-transform: translateY(-50%);
          transform: translateY(-50%);
  top: 59px;
  left: -11px;
}
.stepper.horizontal .arrow.bottom {
  -webkit-transform: rotate(180deg) translateY(-50%);
          transform: rotate(180deg) translateY(-50%);
  top: -12px;
  right: -11px;
}
.stepper.horizontal .box {
  overflow: hidden;
  height: 92px;
  position: relative;
  padding: 10px 0;
  margin: 0 50px;
}
.stepper.horizontal .box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(to right, #ff6f72 0%, rgba(125, 185, 232, 0) 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff6f72', endColorstr='#007db9e8',GradientType=1 );
  z-index: 1;
}
.stepper.horizontal .box::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 20px;
  background: linear-gradient(to right, #ff6f72 0%, rgba(125, 185, 232, 0) 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff6f72', endColorstr='#007db9e8',GradientType=1 );
  z-index: 1;
  -webkit-transform: rotate(180deg);
          transform: rotate(180deg);
}
.stepper.horizontal .box span {
  display: inline-block;
  letter-spacing: 1px;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}
.stepper.horizontal .box .numbers1 {
  position: absolute;
  top: 12px;
  left: 31px;
  display: flex;
}
.stepper.horizontal .box .numbers1 span {
  -webkit-transform: translateX(0);
          transform: translateX(0);
}
.stepper.horizontal .box .numbers2 {
  position: absolute;
  top: 12px;
  left: 31px;
  display: flex;
}
.stepper.horizontal .box .numbers2 span {
  -webkit-transform: translateX(185px);
          transform: translateX(185px);
}
</style>

</head>
<body translate="no">
<div class="wrap">
<div class="stepper vertical" data-start="255">
    <i class="fa fa-angle-left arrow top"></i>

<div class="box">
<div class="numbers1 active">
<span>2</span>
<span>5</span>
<span>5</span>
</div>
<div class="numbers2">
<span></span>
<span></span>
<span></span>
</div>
</div>
 <i class="fa fa-angle-left arrow bottom"></i>

</div.........完整代码请登录后点击上方下载按钮下载查看

网友评论0