css+js实现图文手风琴折叠卡片展示效果代码

代码语言:html

所属分类:布局界面

代码描述:css+js实现图文手风琴折叠卡片展示效果代码

代码标签: css js 图文 手风琴 折叠 卡片 展示

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

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

<head>
  <meta charset="UTF-8">
  
  
  
  
<style>
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	background: #f0f2f5;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.slider-container {
	width: 100%;
	max-width: 1200px;
	height: 100vh;
	position: relative;
	overflow: hidden;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.now-showing {
	position: absolute;
	top: 20px;
	left: 20px;
	color: #9fff6b;
	font-size: 14px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 8px;
	z-index: 10;
}

.now-showing::before {
	content: "";
	width: 6px;
	height: 6px;
	background: #9fff6b;
	border-radius: 50%;
}

.accordion-slider {
	display: flex;
	height: 100%;
	position: relative;
}

.slide {
	flex: 1;
	position: relative;
	cursor: pointer;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
	overflow: hidden;
	filter: grayscale(1);
}

.slide:hover {
	filter: grayscale(0);
}

.slide.active {
	flex: 2.5;
	filter: grayscale(0);
}

.slide::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 80%);
}

.slide-content {
	position: absolute;
	bottom: 30px;
	left: 30px;
	right: 30px;
	color: white;
	z-index: 2;
}

.slide.active .slide-content {
	bottom: 80px;
	transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.slide-number {
	font-size: 64px;
	font-weight: 300;
	color: rgba(255, 255, 255, 0.6);
	line-height: 1;
	position: absolute;
	bottom: 30px;
	left: 30px;
	transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide.active .slide-number {
	bottom: auto;
	top: -50px;
	font-size: 48px;
	left: 0;
}

.car-brand {
	font-size: 16px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.8);
	margin-bottom: 5px;
	transform: rotate(-90deg);
	transform-origin: left bottom;
	position: absolute;
	bottom: 100px;
	left: 30px;
	white-space: nowrap;
	transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide.active .car-brand {
	transform: rotate(0deg);
	position: static;
	transform-origin: unset;
}

.car-name {
	font-size: 28px;
	font-weight: 700;
	margin-bottom: 8px;
	opacity: 0;
	transform: translateY(30px);
	transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	transition-delay: 0s;
}

.slide.active .car-name {
	opacity: 1;
	transform: translateY(0);
	transition-delay: 0.3s;
}

.car-subtitle {
	font-size: 16px;
	color: rgba(255, 255, 255, 0.8);
	margin-bottom: 20px;
	opacity.........完整代码请登录后点击上方下载按钮下载查看

网友评论0