css+div实现自适应响应式手风琴式全屏图文折叠海报效果代码

代码语言:html

所属分类:响应式

代码描述:css+div实现自适应响应式手风琴式全屏图文折叠海报效果代码

代码标签: css div 自适应 响应式 手风琴 全屏 图文 折叠 海报

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

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

<head>
  <meta charset="UTF-8">
  


  
  
<style>
@charset "UTF-8";
@import url("https://fonts.googleapis.com/css2?family=Asap:ital,wght@0,400;1,400");
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Asap", "Poppins", sans-serif;
  text-shadow: #000 0 0 10px;
}

.container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background: #111;
}
@media (min-width: 1024px) {
  .container {
    flex-direction: row;
  }
}

.item {
  position: relative;
  flex: calc(100vw / 6) 1 1;
  background-size: cover;
  overflow: hidden;
  filter: saturate(90%);
  transition: 1s;
}

.item:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(25deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0));
}

.item:not(:last-child) {
  border-bottom: 1px solid #ccc;
  animation: borderPulse 5s infinite;
}
@media (min-width: 1024px) {
  .item:not(:last-child) {
    border-right: 1px solid #ccc;
    border-bottom: none;
  }
}

.item:hover {
  flex-basis: 40%;
  filter: saturate(120%);
}
@media (min-width: 1024px) {
  .item:hover {
    flex-basis: 75%;
  }
}
.item:hover .quote {
  opacity: 1;
  transform: translateX(0);
}

.item:nth-child(1) {
  background-image: url("//repo.bfw.wiki/bfwrepo/image/6454c5130564f.png");
  background-position: 72% 35%;
}

.item:nth-child(2) {
  background-image: url("//repo.bfw.wiki/bfwrepo/image/6454c4fd64064.png");
  background-position: 60% 8%;
}

.item:nth-child(3) {
  background-image: url("//repo.bfw.wiki/bfwrepo/image/6454c4e71fb2f.png");
  background-position: 52% 8%;
}

.item:nth-child(4) {
  background-image: url("//repo.bfw.wiki/bfwrepo/image/6454c4ca0d59b.png");
  background-position: 45% 8%;
}

.item:nth-child(5) {
  background-image: url("//repo.bfw.wiki/bfwrepo/image/6454c4e71fb2f.png");
  background-position: 45% 25%;
}

.item:nth-child(6) {
  background-image: url("//repo.bfw.wiki/bfwrepo/image/6454c5130564f.png");
  background-position: 65% 2%;
}

.quote {
  position: absolute;
  color: #fff;
  bottom: 35%;
  left: 5rem;
  width: calc(100% - 10rem);
  opacity: 0;
  transition: 1s;
  transform: translateX(50%);
}
@media (min-width: 512px) {
  .quote {
    left: 15%;
    bottom: 35%;
    width: 20vw;.........完整代码请登录后点击上方下载按钮下载查看

网友评论0