css实现带缩略图幻灯片代码

代码语言:html

所属分类:幻灯片

代码描述:css实现带缩略图幻灯片代码,无js代码

代码标签: css 缩略图 幻灯片 代码

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


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

<head>

  <meta charset="UTF-8">


 
  
  <link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Quicksand:wght@700&amp;display=swap'>
  
<style>
@import url('https://fonts.googleapis.com/css2?family=Londrina+Solid:wght@300&display=swap');

:root {
	--img: url(//repo.bfw.wiki/bfwrepo/image/5e62eef0d452a.png);
}

html {
	background-color: #fff;
}

body {
	margin: 0;
	padding: 0;
	width: 100vw;
	height: 100vh;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background-size: cover;
	background-position: center center;
	background-image: var(--img, url(//repo.bfw.wiki/bfwrepo/image/5e62eef0d452a.png));
	transition: background 0.5s ease 0s;
	font-family: 'Londrina Solid', cursive;
}

body:before {
	content: "";
	position: absolute;
	width: 100%;
	height: 100%;
	background: #000000c9;
	z-index: 0;
}

.content {
	width: 60vmin;
	height: 60vmin;
	display: flex;
	align-items: center;
	justify-content: center;
	background-size: cover;
	background-position: center center;
	background-image: var(--img, url(//repo.bfw.wiki/bfwrepo/image/5e62eef0d452a.png));
	transition: background 0.5s ease 0s;
	max-width: 500px;
	max-height: 500px;
	box-shadow: 0 0 0vmin 1vmin #fff, 0 0 10vmin 5vmin #000;
	border-radius: 2px;
	z-index: 0;
	background-color: #fff;
}

.content:before {
	content: "cuadernodeescaladas.com";
	position: absolute;
	width: 100%;
	text-align: center;
	margin-bottom: -55vmin;
	text-shadow: -1px -1px 0 #0007;
	color: #fff4;
	font-size: 18px;
}

/* CONTROLS */
.controls {
	width: 100vw;
	height: 100vh;
	overflow: hidden;
	display: flex;
	justify-content: flex-end;
	flex-direction: row;
	flex-wrap: wrap;
	position: absolute;
}

input[type=radio] {
	display: none;
}		

label {
	width: 50vw;
	height: 100vh;
	position: relative;
	cursor: pointer;
	opacity: 0.15;
}

label:hover {
	opacity: 1;
}

input:first-child:checked ~ .content .controls label:first-child,
input:last-of-type:checked ~ .content .controls label:last-of-type {
	cursor: default;
	opacity: 0.025;
}


/* HIDE LABELS */
#b2:checked ~ .content .controls label[for=b2], 
#b3:checked ~ .content .controls label[for=b3], 
#b4:checked ~ .content .controls label[for=b4], 
#b5:checked ~ .content .controls label[for=b5], 
#b6:checked ~ .content .controls label[for=b6], 
#b7:checked ~ .content .controls label[for=b7], 
#b8:checked ~ .content .controls label[for=b8], 
#b9:checked ~ .content .controls label[for=b9], 

#b3:checked ~ .content .controls label[for=b1],
#b4:checked ~ .content .controls label[for=b1],
#b4:checked ~ .content .controls label[for=b2],
#b5:checked ~ .content .controls label[for=b1],
#b5:checked ~ .content .controls label[for=b2],
#b5:checked ~ .content .controls label[for=b3],
#b6:checked ~ .content .controls label[for=b1],
#b6:checked ~ .content .controls label[for=b2],
#b6:checked ~ .content .controls label[for=b3],
#b6:checked ~ .content .controls label[for=b4],
#b7:checked ~ .content .controls label[for=b1],
#b7:checked ~ .content .controls label[for=b2],
#b7:checked ~ .content .controls label[for=b3],
#b7:checked ~ .content .controls label[for=b4],
#b7:checked ~ .content .controls label[for=b5],
#b8:checked ~ .content .controls label[for=b1],
#b8:checked ~ .content .controls label[for=b2],
#b8:checked ~ .content .controls label[for=b3],
#b8:checked ~ .content .controls label[for=b4],
#b8:checked ~ .content .controls label[for=b5],
#b8:checked ~ .content .controls label[for=b6],
#b9:checked ~ .content .controls label[for=b1],
#b9:checked ~ .content .controls label[for=b2],
#b9:checked ~ .content .controls label[for=b3],
#b9:checked ~ .content .controls label[for=b4],
#b9:checked ~ .content .controls label[for=b5],
#b9:checked ~ .content .controls label[for=b6],
#b9:checked ~ .content .controls label[for=b7],
#b10:checked ~ .content .controls label[for=b1] ,
#b10:checked ~ .content .controls label[for=b2] ,
#b10:checked ~ .content .controls label[for=b3] ,
#b10:checked ~ .content .controls label[for=b4] ,
#b10:checked ~ .content .controls label[for=b5] ,
#b10:checked ~ .content .controls label[for=b6] ,
#b10:checked ~ .content .controls label[for=b7] ,
#b10:checked ~ .content .controls label[for=b8] {
	display: none;
}


/* ARROWS */
label:before {
	content: "";
	position: absolute;
	background: 
		linear-gradient(30deg, #fff0 60%, #fff calc(60% + 1px)), 
		linear-gradient(-30deg, #fff 40%, #fff0 calc(40% + 1px)), 
		linear-gradient(-90deg, #fff0 70%, #fff calc(70% + 1px));
	width: 6vmin;
	height: 6vmin;
	border-radius: 5px;
	right: 7vmin;
	top: calc(50% - 3vmin);
}

/* LEFT ARROW */
#b1:checked ~ .content .controls label[for=b1]:before,
#b2:checked ~ .content .controls label[for=b1]:before,
#b3:checked ~ .content .controls label[for=b2]:before,
#b4:checked ~ .content .controls label[for=b3]:before,
#b5:checked ~ .content .controls label[for=b4]:before,
#b6:checked ~ .content .controls label[for=b5]:before,
#b7:checked ~ .content .controls label[for=b6]:before,
#b8:checked ~ .content .controls label[for=b7]:before,
#b9:checked ~ .content .controls label[for=b8]:before,
#b10:checked ~ .content .controls label[for=b9]:before {
	left: 7vmin;
	transform: rotate(180deg);
}




/* TITLES  */
body:after {
	content: "Saqueadores de Conventos (6b+) \a RISCO DE LOS SAQUEADORES";
	position: absolute;
	top: 2vh;
	color: #fff;
	font-size: 35px;
	line-height: 45px;
	transition: all 0.5s ease 0s;
	text-shadow: 0px 1px 0 #000000d9;
	white-space: pre-wrap;
	text-align: center;
	width: 100vw;
	padding: 1vmin;
	background: #ffffff05;
	font-weight: 300;
}

body:has(input#b1:checked):after {
	content: "Saqueadores de Conventos (6b+) \a RISCO DE LOS SAQUEADORES";
}

body:has(input#b2:checked):after {
	content: "Lucas (A2/V+) \a EL HUESO";
}

body:has(input#b3:checke.........完整代码请登录后点击上方下载按钮下载查看

网友评论0