div+css实现80年代的磁带效果代码

代码语言:html

所属分类:布局界面

代码描述:div+css实现80年代的磁带效果代码

代码标签: div css 80 年代 磁带

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


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

<head>

  <meta charset="UTF-8">

<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;1,400;1,500&display=swap" rel="stylesheet">

  <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/reset.min.css">
  
<style>

#container {
	width: 100vw;
	height: 100vh;
	background: linear-gradient(
		#fd004c 16.7%,
		#fe9000 16.7%,
		#fe9000 33.4%,
		#fff020 33.4%,
		#fff020 50.1%,
		#3edf4b 50.1%,
		#3edf4b 66.8%,
		#3363ff 66.8%,
		#3363ff 83.5%,
		#b102b7 83.5%
	);
	animation: rainbow 40s linear infinite;
}

@keyframes rainbow {
	100% {
		background-position: 0 60em;
	}
}

#casette {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 84vmin;
	height: 53vmin;
	border-radius: 3vmin;
	background-image: linear-gradient(90deg, #395a9c, #365c97, #395a9a);
}

#casetteLowerPart {
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translate(-50%, 0);
	width: 99%;
	height: 22vmin;
	background: repeating-linear-gradient(
		to top,
		#334f80,
		#334f80 0.2rem,
		#395a9a 0.2rem,
		#395a9a 0.3rem
	);
	border-radius: 0 0 3vmin 3vmin;
}

#casetteSticker {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -65%);
	width: 75vmin;
	height: 34vmin;
	background: #e6e7d5;
	border-radius: 0 0 2vmin 2vmin;
}

#triangle-topleft {
	width: 0;
	height: 0;
	transform: translate(-2%, -2%);
	border-top: 4vmin solid #395a9c;
	border-right: 4vmin solid transparent;
}

#triangle-topright {
	width: 0;
	height: 0;
	position: absolute;
	right: 0;
	transform: translate(2%, -2%);
	border-top: 4vmin solid #395a9a;
	border-left: 4vmin solid transparent;
}

#blackLine1 {
	position: absolute;
	left: 50%;
	top: 12%;
	transform: translate(-50%, -50%);
	height: 0.1vmin;
	width: 95%;
	background-color: #0d0d0d;
}

#blackLine2 {
	position: absolute;
	left: 50%;
	top: 22%;
	transform: translate(-50%, -50%);
	height: 0.1vmin;
	width: 95%;
	background-color: #0d0d0d;
}

#redLine {
	position: absolute;
	left: 50%;
	top: 40%;
	transform: translate(-50%, -50%);
	height: 3.5vmin;
	width: 99.9%;
	background-color: #f34638;
}

#yellowLine {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	height: 3.5vmin;
	width: 99.9%;
	background-color: #eac93f;
}

#centralPart {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -45%);
	width: 46vmin;
	height: 14vmin;
	border-radius: 100vmin;
	background-image: linear-gradient(90deg, #395a9c, #365c97, #395a9a);
}

#stereoP {
	font-family: "Roboto", sans-serif;
	font-weight: 600;
	font-style: italic;
	font-size: 7vmin;
	color: #343432;
	position: absolute;
	left: 50%;
	top: 86%;
	transform: translate(-50%, -50%);
}

#aLetterP {
	font-family: "Roboto", sans-serif;
	font-weight: 600;
	font-size: 7vmin;
	color: #f34638;
	position: absolute;
	left: 10%;
	top: 72%;
	transform: translate(-50%, -50%);
}

#sideP {
	font-family: "Roboto", sans-serif;
	font-weight: 500;
	font-size: 3.5vmin;
	color: #343432;
	position: absolute;
	left: 10%;
	top: 87%;
	transform: translate(-50%, -50%);
}

#numberP {
	font-family: "Roboto", sans-serif;
	font-weight: 600;
	font-size: 7vmin;
	color: #395a9c;
	position: absolute;
	left: 89%;
	top: 72%;
	transform: translate(-50%, -50%);
}

#minP {
	font-family: "Roboto", sans-serif;
	font-weight: 600;
	font-size: 2.8vmin;
	color: #343432;
	position: absolute;
	left: 89%;
	top: 87%;
	transform: translate(-50%, -50%);
}

.screws {
	width: 3vmin;
	height: 3vmin;
	border-radius: 50%;
	background: linear-gradient(180deg, #cdcbcf, #3f3e3f);
	position: absolute;
	z-index: 10;
}

.screws span {
	color: #343432;
	font-size: 0.8rem;
	position: absolute;
	left: 52%;
	top: 50%;
	transform: translate(-50%, -50%);
}

div.screws:nth-of-type(1) {
	left: 0;
	top: 0;
	transform: translate(65%, 65%);
}
div.screws:nth-of-type(2) {
	right: 0;
	top: 0;
	transform: translate(-65%, 65%);
}
div.screws:nth-of-type(3) {
	left: 0;
	bottom: 0;
	transform: translate(65%, -65%);
}
div.screws:nth-of-type(4) {
	right: 0;
	bottom: 0;
	transform: translate(-65%, -65%);
}

.circleEl {
	width: 9vmin;
	height: 9vmin;
	background: white;
	border-radius: 50%;
	position: absolute;
	animation: rotation 8s infinite linear;
}
.circleEl:nth-of-type(1) {
	left: 6%;
	top: 18%;
	transform: translate(30%, -50%);
}
.circleEl:nth-of-type(2) {
	right: 6%;
	top: 18%;
	transform: translate(-30%, -50%);
}

.yellowOutline {
	width: 9vmin;
	height: 9vmin;
	border-radius: 50%;
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	border: 1vmin solid #ffb043;
	-webkit-box-shadow: inset 0px 0px 0px 0.2vmin #ffb043;
	-moz-box-shadow: inset 0px 0px 0px 0.2vmin #ffb043;
	box-shadow: inset 0px 0px 0px 0.2vmin #ffb043;
}

.yellowThingies {
	width: 1.2vmin;
	height: 1.2vmin;
	background: #ffb043;
	position: absolute.........完整代码请登录后点击上方下载按钮下载查看

网友评论0