css实现照片悬浮翻书翻页显示文字动画效果代码
代码语言:html
所属分类:悬停
代码描述:css实现照片悬浮翻书翻页显示文字动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Grape+Nuts&display=swap");
*, *::before, *::after {
padding: 0;
margin: 0 auto;
box-sizing: border-box;
}
body {
font-family: "Grape Nuts", cursive;
background-color: #eee;
text-align: center;
padding: 4em 1em;
}
.gallery {
display: grid;
width: 100%;
max-width: 1002px;
grid-gap: 50px;
grid-template-columns: repeat(auto-fit, 300px);
grid-template-rows: auto;
justify-content: center;
margin-top: 50px;
}
figure {
width: 300px;
perspective: 900px;
}
figure:nth-child(1) {
--imageUrl: url("//repo.bfw.wiki/bfwrepo/image/625a18709b084.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_200,/quality,q_90");
}
figure:nth-child(2) {
--imageUrl: url("//repo.bfw.wiki/bfwrepo/image/625a1881508fa.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_200,/quality,q_90");
}
figure:nth-child(3) {
--imageUrl: url("//repo.bfw.wiki/bfwrepo/image/625a188caa9f1.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_200,/quality,q_90");
}
figure:nth-child(4) {
--imageUrl: url("//repo.bfw.wiki/bfwrepo/image/625a189cc1b7b.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_200,/quality,q_90");
}
figure:nth-child(5) {
--imageUrl: url("//repo.bfw.wiki/bfwrepo/image/625a18b16d81a.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_200,/quality,q_90");
}
figure:nth-child(6) {
--imageUrl: url("//repo.bfw.wiki/bfwrepo/image/625a188caa9f1.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_200,/quality,q_90");
}
figure img {
width: 100%;
}
.imageRoll {
position: relative;
width: 300px;
height: 300px;
background-color: #fff;
box-shadow: 1em 0.5em 2em #1234, 0 0 5em #1234 inset;
}
.imageRoll i {
position: absolute;
left: calc(100% - 1px);
width: 6px;
height: 100%;
transform-style: preserve-3d;
transform-origin: left;
transition: transform 0.6s var(--delay, 0s) ease-in-out;
background-image: linear-gradient(#0003, #0000 5% 95%, #0003), var(--imageUrl, "");
background-position-x: calc(var(--bpx, 0) + 1px);
background-size: 300px 300px;
}
.imageRoll > i {
left: 0;
width: 5px;
}
.imageRoll:hover i {
transform: rotateY(var(--angle, 0deg)) skewY(var(--skew, 0deg));
transition-delay: var(--delay2, 0s);
}
.imageRoll > i {
--bpx: 0px;
--delay: 0s;
--delay2: 0.6s;
--angle: -10deg;
--skew: 0deg;
}
.imageRoll > i > i {
--bpx: -5px;
--delay: 0.01s;
--delay2: 0.59s;
--angle: -10.1deg;
--skew: -0.1deg;
}
.imageRoll > i > i > i {
--bpx: -10px;
--delay: 0.02s;
--delay2: 0.58s;
--angle: -10.2deg;
--skew: -0.2deg;
}
.imageRoll > i > i > i > i {
--bpx: -15px;
--delay: 0.03s;
--delay2: 0.57s;
--angle: -10.3deg;
--skew: -0.3deg;
}
.imageRoll > i > i > i > i > i {
--bpx: -20px;
--delay: 0.04s;
--delay2: 0.56s;
--angle: -10.4deg;
--skew: -0.4deg;
}
.imageRoll > i > i > i > i > i > i {
--bpx: -25px;
--delay: 0.05s;
--delay2: 0.55s;
--angle: -10.5deg;
--skew: -0.5deg;
}
.imageRoll > i > i > i > i > i > i > i {
--bpx: -30px;
--delay: 0.06s;
--delay2: 0.54s;
--angle: -10.6deg;
--skew: -0.6deg;
}
.imageRoll > i > i > i > i > i > i > i > i {
--bpx: -35px;
--delay: 0.07s;
--delay2: 0.53s;
--angle: -10.7deg;
--skew: -0.7deg;
}
.imageRoll > i > i > i > i > i > i > i > i > i {
--bpx: -40px;
--delay: 0.08s;
--delay2: 0.52s;
--angle: -10.8deg;
--skew: -0.8deg;
}
.imageRoll > i > i > i > i > i > i > i > i > i > i {
--bpx: -45px;
--delay: 0.09s;
--delay2: 0.51s;
--angle: -10.9deg;
--skew: -0.9deg;
}
.imageRoll > i > i > i > i > i > i > i > i > i > i > i {
--bpx: -50px;
--delay: 0.1s;
--delay2: 0.5s;
--angle: -11deg;
--skew: -1deg;
}
.imageRoll > i > i > i > i > i > i > i > i > i > i > i > i {
--bpx: -55px;
--delay: 0.11s;
--delay2: 0.49s;
--angle: -11.1deg;
--skew: -1.1deg;
}
.imageRoll > i > i > i > i > i > i > i > i > i > i > i > i > i {
--bpx: -60px;
--delay: 0.12s;
--delay2: 0.48s;
--angle: -11.2deg;
--skew: -1.2deg;
}
.imageRoll > i > i > i > i > i > i > i > i > i > i > i > i > i > i {
--bpx: -65px;
--delay: 0.13s;
--delay2: 0.47s;
--angle: -11.3deg;
--skew: -1.3deg;
}
.imageRoll > i > i > i > i > i > i > i > i > i > i > i .........完整代码请登录后点击上方下载按钮下载查看
















网友评论0