aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/forms/flipping-label/flipping-label.module.scss
blob: 88ef3ec12ce5b08c332fd50b56fa85e9dfabdf85 (plain)
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
59
60
61
62
63
@use "../../../../styles/abstracts/functions" as fun;

.label {
  display: block;
  width: var(--btn-size, #{fun.convert-px(60)});
  height: var(--btn-size, #{fun.convert-px(60)});
}

.front,
.back {
  display: flex;
  place-content: center;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  right: 0;
  backface-visibility: hidden;
  transition: all 0.6s ease-in 0s;
}

.front {
  z-index: 20;
}

.back {
  z-index: 10;
}

.wrapper {
  --icon-size: 60%;

  display: flex;
  place-content: center;
  place-items: center;
  width: 100%;
  height: 100%;
  position: relative;
  transition: all 0.5s ease-in-out 0s;
  transform-style: preserve-3d;

  &--active {
    transform: rotateY(180deg);

    .front {
      transform: scale(0.2);
    }

    .back {
      transform: scale(1) rotateY(180deg);
    }
  }

  &--inactive {
    .front {
      transform: scale(1);
    }

    .back {
      transform: scale(0.2) rotateY(180deg);
    }
  }
}