滚动弹出列表动画效果
代码语言:html
所属分类:加载滚动
代码描述:滚动弹出列表动画效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
#btn--yp {
box-sizing: content-box;
position: fixed;
z-index: 9;
bottom: 1em;
right: 1em;
border: solid 1em transparent;
width: 4.625em;
height: 3.25em;
background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/2017/icon-yp.svg) 50%/cover content-box;
font: 16px/ 1.25 trebuchet ms, sans-serif;
text-indent: 200vw;
text-shadow: none;
filter: grayscale(1) drop-shadow(0 0 1px #e8e0e0);
transition: .5s;
white-space: nowrap;
}
#btn--yp:before {
box-sizing: inherit;
position: absolute;
left: 0;
bottom: 100%;
margin: 1em -.5em;
padding: .5em;
width: 100%;
border-radius: 5px;
background: #e8e0e0;
color: #000;
text-align: center;
text-decoration: none;
text-indent: 0vw;
white-space: normal;
animation: float 1s ease-in-out infinite alternate;
content: attr(data-txt);
}
#btn--yp:hover, #btn--yp:focus {
outline: none;
filter: grayscale(0) drop-shadow(0 0 1px crimson);
}
@keyframes float {
to {
transform: translateY(0.75em);
}
}
@property --floor {
syntax: '<integer>';
initial-value: 0;
inherits: true;
}
* {
margin: 0;
padding: 0;
}
html {
height: 100%;
}
body {
overflow-x: hidden;
}
ol {
list-style: none;
padding: .5em 0;
background: #ccc;
font: 400 calc(.875em + 1.125vw)/1.375 ubuntu mono, consolas, monaco, monospace;
}
li {
--hid: 0;
--not-hid: calc(1 - var(--hid));
--floor: calc((var(--i) + 1)/2 - .5);
--mod: calc(var(--i) + 1 - var(--floor)*2);
--sgn: calc(2*var(--mod) - 1);
--c: hsl(calc(2*var(--i)*360/var(--n)), 85%, 65%);
display: flex;
overflow: hidden;
margin: 0 auto;
width: Min(90%, 27em);
border-radius: 1.5em 0 0 1.5em;
transform-origin: 1.5em 50%;
transform: translate(calc(var(--sgn)*var(--hid)*(50vw + 50%))) rotate(var(--az)) scale(var(--not-hid));
opacity: var(--not-hid);
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0