|
| 1 | +@use "../colors" as colors; |
| 2 | + |
| 3 | +:root { |
| 4 | + --tagcloud-transition-duration: 250ms; |
| 5 | + --tagcloud-transition-ease: ease-out; |
| 6 | + --tagcloud-animation-duration: 120s; |
| 7 | + --tagcloud-animation-direction: normal; |
| 8 | + --tagcloud-animation-play-state: running; |
| 9 | + --tagcloud-diameter: 32rem; |
| 10 | + --tagcloud-start-rotation: 54; |
| 11 | + --tag-diameter: 6rem; |
| 12 | + --tag-font-size: 0.75rem; |
| 13 | +} |
| 14 | + |
| 15 | +.contributors { |
| 16 | + margin-top: -4rem; |
| 17 | + display: flex; |
| 18 | + align-items: center; |
| 19 | + justify-content: center; |
| 20 | + height: 748px; |
| 21 | + overflow: hidden; |
| 22 | +} |
| 23 | + |
| 24 | +.tagcloud-wrapper { |
| 25 | + --_control-radius: calc(var(--_control-diamater) / 2); |
| 26 | + --_diameter: var(--tagcloud-diameter); |
| 27 | + --_radius: calc(calc(var(--_diameter) / 2) - calc(var(--tag-diameter) / 2)); |
| 28 | + width: var(--control-diameter); |
| 29 | + aspect-ratio: 1 / 1; |
| 30 | + font-size: var(--tag-font-size); |
| 31 | +} |
| 32 | + |
| 33 | +@media only screen and (max-width: 48rem) { |
| 34 | + .tagcloud-wrapper { |
| 35 | + --_diameter: calc(var(--tagcloud-diameter) * 0.88); |
| 36 | + } |
| 37 | +} |
| 38 | + |
| 39 | +@media only screen and (max-width: 32rem) { |
| 40 | + .tagcloud-wrapper { |
| 41 | + --_diameter: calc(var(--tagcloud-diameter) * 0.75); |
| 42 | + } |
| 43 | +} |
| 44 | + |
| 45 | +.tagcloud-wrapper .tagcloud-tags { |
| 46 | + position: absolute; |
| 47 | + width: var(--_diameter); |
| 48 | + aspect-ratio: 1 / 1; |
| 49 | + left: 50%; |
| 50 | + top: 50%; |
| 51 | + transform: translate(-50%, -50%); |
| 52 | + list-style-type: none; |
| 53 | + position: relative; |
| 54 | + transform-style: inherit; |
| 55 | + animation: tagcloud-rotation var(--tagcloud-animation-duration) var(--tagcloud-animation-direction) linear infinite var(--tagcloud-animation-play-state); |
| 56 | +} |
| 57 | + |
| 58 | +@keyframes tagcloud-rotation { |
| 59 | + from { |
| 60 | + transform: translate(-50%, -50%) rotateX(0deg); |
| 61 | + } |
| 62 | + |
| 63 | + to { |
| 64 | + transform: translate(-50%, -50%) rotateX(360deg); |
| 65 | + } |
| 66 | +} |
| 67 | + |
| 68 | +.tagcloud-wrapper .tagcloud-tags:has(.tagcloud-tag div a:hover) .tagcloud-tag:not(:has(div a:hover)) { |
| 69 | + opacity: 0.25; |
| 70 | +} |
| 71 | + |
| 72 | +.tagcloud-wrapper .tagcloud-tag { |
| 73 | + --_phi: acos(calc(-1 + (2 * var(--index)) / var(--num-elements))); |
| 74 | + --_theta: calc(sqrt(calc(var(--num-elements) * 3.141592653589793)) * var(--_phi)); |
| 75 | + --_x: calc(cos(var(--_theta)) * sin(var(--_phi))); |
| 76 | + --_y: calc(sin(var(--_theta)) * sin(var(--_phi))); |
| 77 | + --_z: calc(cos(var(--_phi))); |
| 78 | + --_vector-length: sqrt(var(--_x) * var(--_x) + var(--_y) * var(--_y) + var(--_z) * var(--_z)); |
| 79 | + --_normalized-x: calc(var(--_x) / var(--_vector-length)); |
| 80 | + --_normalized-y: calc(var(--_y) / var(--_vector-length)); |
| 81 | + --_normalized-z: calc(var(--_z) / var(--_vector-length)); |
| 82 | + --_scaled-x: calc(var(--_normalized-x) * var(--_radius)); |
| 83 | + --_scaled-y: calc(var(--_normalized-y) * var(--_radius)); |
| 84 | + --_scaled-z: calc(var(--_normalized-z) * var(--_radius)); |
| 85 | + --_final-x: calc(var(--_scaled-x) + var(--_radius)); |
| 86 | + --_final-y: calc(var(--_scaled-y) + var(--_radius)); |
| 87 | + --_final-z: var(--_scaled-z); |
| 88 | + pointer-events: none; |
| 89 | + width: var(--tag-diameter); |
| 90 | + height: var(--tag-diameter); |
| 91 | + display: flex; |
| 92 | + align-items: center; |
| 93 | + justify-content: center; |
| 94 | + position: absolute; |
| 95 | + transition: opacity var(--tagcloud-transition-duration) var(--tagcloud-transition-ease); |
| 96 | + transform: translate3d(var(--_final-x), var(--_final-y), var(--_final-z)); |
| 97 | + animation: tagcloud-tag-rotation var(--tagcloud-animation-duration) var(--tagcloud-animation-direction) linear infinite var(--tagcloud-animation-play-state); |
| 98 | +} |
| 99 | + |
| 100 | +@keyframes tagcloud-tag-rotation { |
| 101 | + from { |
| 102 | + transform: translate3d(var(--_final-x), var(--_final-y), var(--_final-z)) rotateX(360deg); |
| 103 | + } |
| 104 | + |
| 105 | + to { |
| 106 | + transform: translate3d(var(--_final-x), var(--_final-y), var(--_final-z)) rotateX(0deg); |
| 107 | + } |
| 108 | +} |
| 109 | + |
| 110 | +.tagcloud-wrapper .tagcloud-tag div { |
| 111 | + transform: rotateZ(calc(var(--_current-rotation) * -1deg)); |
| 112 | +} |
| 113 | + |
| 114 | +.tagcloud-wrapper .tagcloud-tag div a { |
| 115 | + pointer-events: initial; |
| 116 | + text-decoration: none; |
| 117 | + |
| 118 | + @include colors.light-theme { |
| 119 | + color: var(--col-light-fg); |
| 120 | + } |
| 121 | + |
| 122 | + @include colors.dark-theme { |
| 123 | + color: var(--col-dark-fg); |
| 124 | + } |
| 125 | +} |
| 126 | + |
| 127 | +.tagcloud-wrapper .tagcloud-controls { |
| 128 | + width: var(--_control-diamater); |
| 129 | + aspect-ratio: 1 / 1; |
| 130 | + position: relative; |
| 131 | + --_current-rotation: var(--tagcloud-start-rotation); |
| 132 | + transform-style: inherit; |
| 133 | +} |
| 134 | + |
| 135 | +.tagcloud-wrapper .tagcloud-controls .tagcloud-control-button:has(input:checked)~.tagcloud-rotation { |
| 136 | + transform: translate(-50%, -50%) rotate(calc(var(--_current-rotation) * 1deg)); |
| 137 | +} |
| 138 | + |
| 139 | +.tagcloud-wrapper .tagcloud-controls .tagcloud-control-button:has(input:checked)~.tagcloud-rotation .tagcloud-tags .tagcloud-tag div { |
| 140 | + transform: rotateZ(calc(var(--_current-rotation) * -1deg)); |
| 141 | +} |
| 142 | + |
| 143 | +.tagcloud-wrapper .tagcloud-controls .tagcloud-rotation { |
| 144 | + position: absolute; |
| 145 | + width: var(--_diameter); |
| 146 | + aspect-ratio: 1 / 1; |
| 147 | + perspective: calc(var(--_diameter) * 3); |
| 148 | + transform-style: preserve-3d; |
| 149 | + left: 50%; |
| 150 | + top: 50%; |
| 151 | + border-radius: 50%; |
| 152 | + transform: translate(-50%, -50%) rotate(calc(var(--_current-rotation) * 1deg)); |
| 153 | + transition: transform var(--tagcloud-transition-user-duration) var(--tagcloud-transition-user-ease); |
| 154 | + |
| 155 | + @include colors.light-theme { |
| 156 | + $color-from: rgba(colors.$col-light-bg, 0.75); |
| 157 | + $color-to: rgba(colors.$col-light-bg, 0); |
| 158 | + |
| 159 | + background: radial-gradient(circle at center, |
| 160 | + $color-from 15%, |
| 161 | + $color-to calc(75% - #{var(--tag-diameter)})); |
| 162 | + } |
| 163 | + |
| 164 | + @include colors.dark-theme { |
| 165 | + $color-from: rgba(colors.$col-dark-bg, 0.75); |
| 166 | + $color-to: rgba(colors.$col-dark-bg, 0); |
| 167 | + |
| 168 | + background: radial-gradient(circle at center, |
| 169 | + $color-from 15%, |
| 170 | + $color-to calc(75% - #{var(--tag-diameter)})); |
| 171 | + } |
| 172 | +} |
| 173 | + |
| 174 | +.tagcloud-wrapper .tagcloud-tag { |
| 175 | + will-change: transform; |
| 176 | +} |
| 177 | + |
| 178 | +.tagcloud-wrapper .tagcloud-tag div, |
| 179 | +.tagcloud-wrapper .tagcloud-tag a { |
| 180 | + backface-visibility: hidden; |
| 181 | + -webkit-font-smoothing: antialiased; |
| 182 | +} |
0 commit comments