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.........完整代码请登录后点击上方下载按钮下载查看

网友评论0