gsap+svg实现带数字过渡动画的幻灯片效果代码
代码语言:html
所属分类:幻灯片
代码描述:gsap+svg实现带数字过渡动画的幻灯片效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
@font-face {
font-family: Cyber;
src: url("//repo.bfw.wiki/bfwrepo/fonts/Blender-Pro-Bold.otf");
font-display: swap;
}
* {
box-sizing: border-box;
}
:root {
--size: 300px;
}
body {
min-height: 100vh;
display: grid;
place-items: center;
--primary: hsl(58, 100%, calc((48 - var(--lightness, 0)) * 1%));
--secondary: hsl(58, 100%, calc((45 - var(--lightness, 0)) * 1%));
background: linear-gradient(90deg, var(--primary) 70%, var(--secondary) 70%), var(--primary);
overflow: hidden;
}
ul {
height: var(--size);
aspect-ratio: 1/1;
list-style-type: none;
padding: 0;
margin: 0;
position: relative;
-webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 90% 100%, 90% 95%, 70% 95%, 70% 100%, 10% 100%, 0 90%);
clip-path: polygon(0 0, 100% 0, 100% 100%, 90% 100%, 90% 95%, 70% 95%, 70% 100%, 10% 100%, 0 90%);
border-right: 6px solid #3df5f5;
}
li {
position: relative;
}
li,
img {
height: 100%;
width: 100%;
position: absolute;
}
img {
position: absolute;
left: 0;
top: 0;
background-size: cover;
clip-path: var(--clip);
-webkit-clip-path: var(--clip);
}
svg {
height: var(--size);
width: var(--size);
position: absolute;
}
.direction-button {
position: absolute;
top: 50%;
transform: translate(calc(var(--offset) * 50%), -50%);
}
.direction-button--next {
--offset: 1;
left: 100%;
}
.direction-button--prev {
--offset: -1;
right: 100%;
}
.cybr-sldr {
display: none;
position: relative;
height: var(--size);
aspect-ratio: 1/1;.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0