拖拽切换

coderljw 2024-10-13 CSS
  • Magic
  • 特效
小于 1 分钟

<main>
  <section>
    <div class="resize"></div>
  </section>
</main>
1
2
3
4
5
main {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  background: url(../../images/Wives/BingBing-6.webp) 0 20%/942px 522px
    no-repeat;
}

section {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  min-width: 0;
  max-width: 100%;
  background: url(../../images/Cover/National-Flag.png) 0 0/716px 478px
    no-repeat;
  -webkit-mask: linear-gradient(110deg, #000 10%, transparent 70%, transparent);
}

section::before {
  content: '↔';
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  right: 0;
  width: 15px;
  height: 100%;
  color: #ffb8c4ff;
  background: rgba(0, 0, 0, 0.5);
}

.resize {
  position: relative;
  opacity: 0;
  top: 50%;
  left: 0;
  width: 0;
  height: 15px;
  min-width: 15px;
  max-width: 100%;
  resize: horizontal;
  overflow: scroll;
  transform: scaleY(100);
  transform-origin: center;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
以父之名
周杰伦.mp3