gsap Flip实现一个滚动游戏选择角色图片切换效果代码

代码语言:html

所属分类:幻灯片

代码描述:gsap结合ScrollTrigger及Flip实现一个滚动游戏选择角色图片切换效果代码,直接滚动鼠标滚轮进行横向图片滚动选择。

代码标签: gsap Flip 滚动 切换 选择 幻灯

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">





    <style>
        @import url("https://fonts.googleapis.com/css2?family=Nunito&display=swap");
        

        
        body {
        	padding: 0;
        	margin: 0;
        	height: 600vh;
        	width: 100vw;
        	font-family: "Nunito", sans-serif;
        	background-color: #e34f37;
        	color: white;
        }
        
        h1 {
        	font-family: "longline";
        }
        
        .slider-section {
        	height: 22vh;
        	bottom: 0;
        	position: fixed;
        	width: 100%;
        }
        
        h1 {
        	font-size: 10vw;
        }
        
        .wheel {
        	position: absolute;
        	top: 0;
        	display: flex;
        	align-items: center;
        	justify-content: center;
        	width: 300vw;
        	height: 300vw;
        	max-width: 2000px;
        	max-height: 2000px;
        	left: 50%;
        	transform: translateX(-50%);
        }
        
        .wheel__card {
        	position: absolute;
        	top: 0;
        	left: 0;
        	width: 6%;
        	max-width: 200px;
        	aspect-ratio: 1 / 1;
        	cursor: pointer;
        }
        
        img {
        	width: 100%;
        	pointer-events: none;
        	z-index: 999;
        	cursor: pointer;
        }
        
        .header {
        	position: fixed;
        	top: 0;
        	left: 0;
        	width: 100%;
        	height: 60vh;
        	display: flex;
        	align-items: center;
        	justify-content: center;
        	cursor: pointer;
        }
        
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0