css+div实现三维立体图片幻灯片滚动效果代码

代码语言:html

所属分类:幻灯片

代码描述:css+div实现三维立体图片幻灯片滚动效果代码,鼠标滚轮可滚动翻页,空格键也能操控。

代码标签: cs div 三维 立体 图片 幻灯片 滚动

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

<!DOCTYPE html>
<html lang="en" style="--n: 18" >

<head>
  <meta charset="UTF-8">
  
  <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@500&family=Saira:ital@0;1&family=Sour+Gummy:wdth,wght@125,300&display=swap" rel="stylesheet">
  
  
  
<style>
@property --k {
	syntax: '<number>';
	initial-value: -1;
	inherits: true
}

@property --ang {
	syntax: '<angle>';
	initial-value: 0deg;
	inherits: false
}

* { margin: 0 }

html {
	scrollbar-width: none;
	height: calc(var(--n)*100%)
}

body, header, main, section, 
article, figure { display: grid }

body {
	--dir: 0;
	grid-template-rows: max-content 1fr max-content;
	position: fixed;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	color: #dedede;
	font: clamp(.625em, 3vmin, 1.5em)/ 1.25 saira, sans-serif;
	animation: k 1s linear;
	animation-timeline: scroll();
	
	&::before {
		position: absolute;
		inset: 0;
		z-index: -1;
		background: #000;
		filter: url(#grain);
		content: ''
	}
	
	@media (max-aspect-ratio: 2/ 3) { --dir: 1 }
}

svg[height='0'][aria-hidden='true'] { position: fixed }

header {
	place-content: center;
	place-items: center;
	padding: .5em;
	text-align: center;
	text-wrap: balance
}

h1, h2 {
	//font-family: sour gummy, cursive;
	//font-weight: 300
}

em { max-width: 32em }

main {
	overflow: hidden;
	perspective: 50em
}

@keyframes k { to { --k: 1 } }

section, article { transform-style: preserv.........完整代码请登录后点击上方下载按钮下载查看

网友评论0