File size: 1,195 Bytes
f0743f4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
50
51
52
53
54
55
56
57
58
/* AnimatedTabs.css */
.animated-tab-panel {
  transition-property: opacity, translate;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
  animation-duration: 300ms;
}

/* Sliding underline animation for tabs */
.animated-tab-list {
  position: relative;
}

.animated-tab-list::after {
  content: '';
  position: absolute;
  bottom: 0;
  height: 2px;
  background-color: currentColor; /* Inherit color from active tab */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  left: var(--tab-left, 0);
  width: var(--tab-width, 0);
}

.animated-tab {
  position: relative;
}

.animated-tab[data-state='active'] {
  border-bottom-color: transparent !important;
}

.animated-tab-panel[data-enter] {
  opacity: 1 !important;
  translate: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  .animated-tab-panel {
    transition: none;
  }
}

.animated-tab-panel:not([data-open]) {
  position: absolute;
  top: 0px;
}

.animated-panels:has(> [data-was-open]) > .animated-tab-panel {
  opacity: 0;
  translate: -100%;
}

.animated-panels [data-was-open] ~ .animated-tab-panel,
.animated-panels [data-open] ~ .animated-tab-panel {
  translate: 100%;
}