gsap实现文字卡片立体折叠轮播动画效果代码
代码语言:html
所属分类:幻灯片
代码描述:gsap实现文字卡片立体折叠轮播动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: "Tagesschrift", system-ui;
background: linear-gradient(135deg, #f5e7e9, #e1c4d7);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
overflow: hidden;
padding: 20px;
}
.carousel-container {
width: 100%;
max-width: 800px;
height: 450px;
position: relative;
perspective: 1500px;
}
.carousel {
width: 100%;
height: 100%;
position: absolute;
transform-style: preserve-3d;
}
.card {
width: 280px;
height: 300px;
background: rgba(255, 255, 255, 1.0);
border-radius: 20px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
cursor: pointer;
transition: box-shadow 0.3s ease;
border: solid brown 8px;
}
.card:hover {
box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}
.card-content {
padding: 20px;
text-align: center;
color: #333;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.word {
font-size: 2em;
font-weight: 700;
color: #b71c1c;
margin-bottom: 8px;
text-transform: capitalize;
}
.gender {
font-size: 1.1em;
color: #555;
font-style: italic;
margin-bottom: 10px;
}
.meaning {
font-size: 1.3em;
color: #333;
margin-bottom: 15px;
}
.example {
font-size: 1.1em;
color: #444;
margin-bottom: 8px;
font-style: italic;
}
.translation {
font-size: 1.1em;
color: #666;
}
.card::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(
135deg,
rgba(183, 28, 28, 0.1),
rgba(225, 196, 215, 0.2)
);
z-index: -1;
border-radius: 20px;
}
.controls {
display: flex;
justify-content: center;
margin-top.........完整代码请登录后点击上方下载按钮下载查看
网友评论0