div+css实现联系人列表滚动进入退出动画效果代码
代码语言:html
所属分类:加载滚动
代码描述:div+css实现联系人列表滚动进入退出动画效果代码滚动页面代码动画效果代码
代码标签: div css 联系人 列表 滚动 进入 退出 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@keyframes fadeInOnEnter-fadeOutOnExit{
entry 0% {
opacity: 0;
translate: 100% 0;
}
entry 100% {
opacity: 1;
translate: 0 0;
}
exit 0% {
opacity: 1;
translate: 0 0;
}
exit 100% {
opacity: 0;
translate: 100% 0;
}
}
.contactList__item {
animation: linear fadeInOnEnter-fadeOutOnExit ;
animation-timeline: view();
}
/* COMPONENT COSMETIC */
.contactList {
border: 1px solid var(--txt-color);
list-style: none;
margin: 0;
padding: 5px;
height: min(15em, 50vh);
color: #bbb;
font-size: 2em;
overflow-y: scroll;
overflow-x: hidden;
transition: .4s ease-out;
border-radius: .5rem;
}
.contactList:hover {
border-color:#1ADEFF;
box-shadow:0 0 10px rgba(25,222,255,.5);
}
.contactList__item{
background: #444;
overflow: hidden;
display: flex;
align-items: center;
gap: 1em;
padding: 0.5em;
margin-bottom: 1px;
}
.contactList__pic{
border-radius: 100%;
width: 2em;
height: 2em;
}
/* GENERAL DOCUMENT COSMETIC */
:root {
--txt-color: #bbb;
}
img {
width: 100%;
}
body{
margin: 0;
padding: 0;
padding-top: 2rem;
font-family: sans-serif;
background: #222;
color: var(--txt-color);
height: 100vh;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
scroll-behavior: smooth;
}
h1 {
width: 100%;
position:sticky;
top: 0;
color: var(--primary-color);
background: #222;
font-size: 5em;
line-height: 0.9;
z-index: 1;
padding-block: 2rem;
margin-inline: -2em;
padding-inline: 2em;
}
p{
line-height: 1.75;
}
</style>
</head>
<body translate="no">
<ul class="contactList glow"&g.........完整代码请登录后点击上方下载按钮下载查看
网友评论0