|
1 | | -.root { |
2 | | - background-color: var(--text-color); |
3 | | - --hover-letter-spacing: 0.15em; |
4 | | - display: grid; |
5 | | - width: min-content; |
6 | | - align-items: center; |
7 | | - font: var(--heading5); |
8 | | - font-size: 24px; |
9 | | - letter-spacing: 0.04em; |
10 | | - text-align: left; |
11 | | - cursor: pointer; |
12 | | - padding: 0px; |
13 | | - justify-items: center; |
14 | | - color: var(--primary1); |
15 | | - border-radius: 360px; |
16 | | - box-sizing: border-box; |
17 | | - clip-path: border-box; |
18 | | - grid-template-columns: var(--horizontalSpacing) min-content var(--horizontalSpacing); |
19 | | - grid-template-rows: var(--verticalSpacing) 1fr var(--verticalSpacing); |
20 | | -} |
21 | | - |
22 | | -.label { |
23 | | - display: flex; |
24 | | - white-space: nowrap; |
25 | | - |
26 | | - z-index: 1; |
27 | | - |
28 | | - height: 100%; |
29 | | - align-items: center; |
30 | | - box-sizing: border-box; |
31 | | - border-radius: 360px; |
32 | | - mix-blend-mode: exclusion; |
33 | | - grid-row: 2 / 3; |
34 | | - grid-column: 2 / 3; |
35 | | -} |
36 | | - |
37 | | -.icon { |
38 | | - width: 50px; |
39 | | - max-width: unset; |
40 | | -} |
41 | | - |
42 | | -@keyframes buttonHover { |
| 1 | +@keyframes bgbuttonHover { |
43 | 2 | 0% { |
44 | | - transform: translateY(-5px); |
| 3 | + background-position-y: 0%; |
45 | 4 | } |
46 | 5 | 100% { |
47 | | - transform: translateY(calc(-33.333%)); |
| 6 | + background-position-y: 50%; |
48 | 7 | } |
49 | 8 | } |
50 | | -@keyframes buttonOut { |
| 9 | +@keyframes bgbuttonOut { |
51 | 10 | 0% { |
52 | | - transform: translateY(calc(-33.333%)); |
| 11 | + background-position-y: 50%; |
53 | 12 | } |
54 | 13 | 100% { |
55 | | - transform: translateY(calc(-66.666%)); |
| 14 | + background-position-y: 100%; |
56 | 15 | } |
57 | 16 | } |
58 | | -.movingUp { |
59 | | - background: linear-gradient( |
60 | | - var(--bgColor1) 33.333%, |
61 | | - var(--bgColor2) 33.33%, |
62 | | - var(--bgColor2) 66.66%, |
63 | | - var(--bgColor1) 66.666% |
64 | | - ); |
65 | | - |
66 | | - height: calc(300% + 30px); |
67 | | - width: calc(100% + 20px); |
68 | | - transform: translateY(-5px); |
69 | | - animation-duration: 0.3s; |
| 17 | +.root { |
| 18 | + display: flex; |
| 19 | + user-select: none; |
| 20 | + border-radius: 360px; |
| 21 | + box-sizing: border-box; |
| 22 | + cursor: pointer; |
| 23 | + width: max-content; |
| 24 | + align-items: center; |
| 25 | + font: var(--heading5); |
| 26 | + font-size: 24px; |
| 27 | + letter-spacing: 0.04em; |
| 28 | + text-align: center; |
| 29 | + animation-duration: 0.0s; |
70 | 30 | animation-fill-mode: backwards; |
71 | 31 | animation-iteration-count: 1; |
72 | | - animation-timing-function: ease-out; |
73 | | - align-self: start; |
| 32 | + animation-timing-function: ease-in-out; |
74 | 33 | animation-play-state: running; |
75 | | - animation-name: buttonOut; |
76 | | - grid-row: 1 / 4; |
77 | | - grid-column: 1 / 4; |
| 34 | + animation-name: bgbuttonOut; |
| 35 | + background-size: 100% 300%; |
| 36 | + background-image: linear-gradient(var(--bgColor1) 33.333%, var(--bgColor2) 33.33%, var(--bgColor2) 66.66%, var(--bgColor1) 66.666%); |
| 37 | + padding: var(--verticalSpacing) var(--horizontalSpacing); |
| 38 | + color: var(--primary1); |
| 39 | + border: solid 1px var(--bgColor1); |
| 40 | + background-position-y: 100%; |
78 | 41 | } |
79 | | -.root:hover .movingUp { |
| 42 | +.root[loaded="true"]{ |
| 43 | + animation-duration: 0.3s; |
| 44 | +} |
| 45 | +.root:hover { |
80 | 46 | animation-duration: 0.3s; |
81 | 47 | animation-fill-mode: forwards; |
82 | | - animation-name: buttonHover; |
83 | | - animation-timing-function: ease-in; |
| 48 | + animation-name: bgbuttonHover; |
| 49 | + animation-timing-function: ease-in-out; |
84 | 50 | } |
| 51 | + |
85 | 52 | .border { |
86 | 53 | border: solid 1px var(--bgColor1); |
87 | 54 | border-radius: 360px; |
|
92 | 59 | grid-column: 1 / 4; |
93 | 60 | font-weight: 800; |
94 | 61 | font: var(--heading5); |
| 62 | + |
| 63 | +.root > span{ |
| 64 | + mix-blend-mode: exclusion; |
| 65 | + white-space: nowrap; |
| 66 | + |
95 | 67 | } |
| 68 | + |
| 69 | +.icon { |
| 70 | + width: 50px; |
| 71 | + max-width: unset; |
| 72 | +} |
| 73 | + |
0 commit comments