div+css实现齿轮搭建木拼图动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现齿轮搭建木拼图动画效果代码

代码标签: div css 齿轮 搭建 木拼 动画

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

<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">

  
  
  
  
<style>
* {
	transform-style: preserve-3d;
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	width: 100vw;
	height: 100vh;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	perspective: 500vmin;
	background: radial-gradient(circle at 50% -10%, #201534, #fff0), radial-gradient(circle at 50% 110%, #201534, #101010);
}

body:before, body:after {
	content: "HOVER TO ROTATE SCENE";
	font-family: Arial, Helvetica, serif;
	font-size: 12px;
	position: absolute;
	width: 100%;
	text-align: center;
	top: 20px;
	color: #fff4;
	z-index: -1;
	color: #3b265c;
	z-index: -1;
	text-shadow: 0px -1px 0 #0008, 0 1px 0 #fff3;
}

body:after {
	content: "CLICK & HOLD TO PAUSE";
	top: inherit;
	bottom: 20px;
}

body:hover:before {
	color: #d1b6ff;
	text-shadow: 0px -1px 0 #0008, 0 1px 0 #fff3;
}

body:active:after {
	color: #d1b6ff;
	text-shadow: 0px -1px 0 #0008, 0 1px 0 #fff3;
}

.content {
	width: 80vmin;
	height: 80vmin;
	display: flex;
	align-items: center;
	justify-content: center;
	transform: rotateX(-165deg) rotateY(-25deg);
	transition: all 2s ease 0s;
	transform: rotateX(-17deg) rotateY(-25deg);
	transition: all 0.5s ease 0s;
	position: absolute;
}

.cuboid {
	--height: 10;
	--width: 10;
	--depth: 8;
	--hue: 100;
	--sat: 80%;
	height: calc(var(--height) * 1vmin);
	width: calc(var(--width) * 1vmin);
	position: absolute;
	animation: cube1 0.6s linear 0s infinite;
	transform: translate3d(0vmin, 0vmin, 0vmin);
}

.cuboid .side {
	position: absolute;
	top: 50%;
	left: 50%;
	height: 100%;
	width: 100%;
	border-radius: 1px;
	background: hsl(var(--hue), var(--sat), var(--lum));
}

.cuboid .side:nth-of.........完整代码请登录后点击上方下载按钮下载查看

网友评论0