js+css实现个人行程记录卡片折叠堆叠选项卡效果代码

代码语言:html

所属分类:选项卡

代码描述:js+css实现个人行程记录卡片折叠堆叠选项卡效果代码

代码标签: js css 个人 行程 记录 卡片 折叠 堆叠 选项卡

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

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

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

    <meta name="viewport" content="width=device-width, initial-scale=.75">
<style>
    .schedules__time::after, .schedules__time::before, .card__title::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -1.5rem;
  z-index: 1;
  transform: translate(-50%, -50%);
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background-color: inherit;
  box-shadow: inset 0 0 0 0.3428571429rem;
  transition: all 0.5s;
}

.cards {
  position: relative;
  height: 600px;
  overflow: hidden;
}

.card {
  position: absolute;
  z-index: 1;
  height: 100%;
  overflow: hidden;
  border-radius: 1.5rem;
  color: #fff;
  transition: all 0.5s;
  background-image: linear-gradient(to right, transparent calc(1.5rem - 3px), #fff calc(1.5rem - 3px), #fff calc(1.5rem + 3px), transparent calc(1.5rem + 3px));
  counter-increment: card;
}
.card:nth-of-type(1)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.5rem;
  z-index: 0;
  transform: translateX(-50%);
  width: 12px;
  height: 2rem;
  background-color: inherit;
}
.card:nth-of-type(1) {
  transform: translateY(calc(0 * (100% - 1.5rem)));
}
.card:nth-of-type(5n + 1) {
  background-color: #6dcff6;
}
.card:nth-of-type(2) {
  transform: translateY(calc(0.2 * (100% - 1.5rem)));
}
.card:nth-of-type(5n + 2) {
  background-color: #8882ee;
}
.card:nth-of-type(3) {
  transform: translateY(calc(0.4 * (100% - 1.5rem)));
}
.card:nth-of-type(5n + 3) {
  background-color: #dee170;
}
.card:nth-of-type(4) {
  transform: translateY(calc(0.6 * (100% - 1.5rem)));
}
.card:nth-of-type(5n + 4) {
  background-color: #71b8ca;
}
.card:nth-of-type(5) {
  transform: translateY(calc(0.8 * (100% - 1.5rem)));
}
.card:nth-of-type(5n + 5) {
  background-color: #e77fa0;
}

.cards.is-active .card {
  transform: translateY(0) !important;
}
.cards.is-active .card.is-active {
  transform: translateY(7.5%) !important;
}
.cards.is-active .card.is-active .card__title {
  transform: translateY(0);
}
.cards.is-active .card.is-active .card__title::after {
  transform: scale(1);
}
.cards.is-active .card.is-active .schedules {
  opacity: 1;
}
.cards.is-active .card:nth-of-type(1).is-active {
  transform: translateY(0%) !important;
}
.cards.is-active .card.is-active ~ .card {
  transform: translateY(100%) !important;
}
.cards.is-active .card.is-active + .card {
  transform: translateY(calc(92.5% - 1.5rem)) !important;
}
.cards.is-active .card__title {
  transform: translateY(-25%);
}
.cards.is-active .card__title::after {
  transform: scale(0.6);
}

.card__title {
  position: relative;
  margin: 0 1.5rem 0.25em 3rem;
  padding-top: 1rem;
  background-color: inherit;
  font-size: 2rem;
  font-weight: 900;
  text-transform: capitalize;
  cursor: pointer;
  transition: transform 0.3s;
}
.card__title::after {
  content: "day " counter(card);
  display: block;
  transition: transform 0.3s;
  transform-origin: 0% 50%;
}
.card__title::before {
  top: calc(50% + .5rem);
  box-shadow: inset 0 0 0 0.3428571429rem;
}
.card.is-active .card__title::before {
  box-shadow: inset 0 0 0 1.2rem;
}

.schedules {
  background-color: inherit;
  max-height: calc(100% - 4rem);
  background-image: inherit;
  padding-left: 3rem;
  padding-right: 1.5rem;
  padding-bottom: 114px;
  overflow: auto;
  transition: opacity 0.3s;
  opacity: 0;
}

.schedules__time {
  position: relative;
  margin-botto.........完整代码请登录后点击上方下载按钮下载查看

网友评论0