style1.css 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. :root {
  2. font-size: calc(16px + (20 - 16) * (100vw - 320px)/(980 - 320));
  3. --rotateTimes: 0;
  4. }
  5. nav,
  6. ul,
  7. li {
  8. transform-style: preserve-3d;
  9. }
  10. nav,
  11. li {
  12. position: absolute;
  13. top: 30%;
  14. left: 50%;
  15. }
  16. nav,
  17. li a {
  18. border-radius: 50%;
  19. }
  20. nav {
  21. width: 100em;
  22. height: 70em;
  23. transform: translate(-50%, -50%) rotateX(75deg);
  24. position: relative;
  25. }
  26. ul,
  27. li a {
  28. width: 100%;
  29. height: 100%;
  30. }
  31. ul {
  32. list-style: none;
  33. }
  34. li {
  35. animation: idle 4s ease-in-out infinite;
  36. text-align: center;
  37. width: 15em;
  38. height: 15em;
  39. transform: translate(-50%, -50%);
  40. }
  41. li a {
  42. box-shadow: 0 0 0 0.1em #0cf inset, 0 0 1em #0cf inset;
  43. color: currentColor;
  44. display: inline-block;
  45. text-decoration: none;
  46. transition: transform 0.4s linear, box-shadow 0.15s linear, margin 0.1s linear, width 0.1s linear, height 0.1s linear;
  47. }
  48. li a span {
  49. transition: color 0.15s linear;
  50. }
  51. li a:before {
  52. background-color: #fff;
  53. border-radius: 50%;
  54. content: "";
  55. display: block;
  56. opacity: 0.5;
  57. position: absolute;
  58. top: 2.75em;
  59. left: 3.75em;
  60. width: 1em;
  61. height: 0.5em;
  62. transform: rotate(-45deg);
  63. }
  64. li a:focus,
  65. li a.current {
  66. box-shadow: 0 0 0 0.1em #ff0 inset, 0 0 1em #ff0 inset;
  67. outline: 0;
  68. }
  69. li a:focus span,
  70. li a.current span {
  71. color: #ff0;
  72. }
  73. li a:hover {
  74. margin: -5% 0 0 -5%;
  75. width: 110%;
  76. height: 110%;
  77. box-shadow: 0 0 0 0.1em #ff0 inset, 0 0 1em #ff0 inset;
  78. }
  79. li a:hover svg {
  80. width: 3em;
  81. height: 3em;
  82. }
  83. @media (prefers-reduced-motion) {
  84. li {
  85. animation: none;
  86. }
  87. }
  88. svg {
  89. display: block;
  90. margin: 1.25em auto 1.5em auto;
  91. transition: width 0.1s linear, height 0.1s linear;
  92. width: 2.5em;
  93. height: 2.5em;
  94. }
  95. /* Position bubbles */
  96. li:nth-of-type(1) {
  97. animation-delay: 0s;
  98. }
  99. li:nth-of-type(1) a {
  100. transform: rotate(calc(0deg + var(--rotateTimes) * 51.4285714286deg)) translateY(9em) rotate(calc(0deg - var(--rotateTimes) * 51.4285714286deg)) rotateX(-75deg);
  101. }
  102. li:nth-of-type(2) {
  103. animation-delay: -0.5s;
  104. }
  105. li:nth-of-type(2) a {
  106. transform: rotate(calc(-51.4285714286deg + var(--rotateTimes) * 51.4285714286deg)) translateY(9em) rotate(calc(51.4285714286deg - var(--rotateTimes) * 51.4285714286deg)) rotateX(-75deg);
  107. }
  108. li:nth-of-type(3) {
  109. animation-delay: -1s;
  110. }
  111. li:nth-of-type(3) a {
  112. transform: rotate(calc(-102.8571428571deg + var(--rotateTimes) * 51.4285714286deg)) translateY(9em) rotate(calc(102.8571428571deg - var(--rotateTimes) * 51.4285714286deg)) rotateX(-75deg);
  113. }
  114. li:nth-of-type(4) {
  115. animation-delay: -1.5s;
  116. }
  117. li:nth-of-type(4) a {
  118. transform: rotate(calc(-154.2857142857deg + var(--rotateTimes) * 51.4285714286deg)) translateY(9em) rotate(calc(154.2857142857deg - var(--rotateTimes) * 51.4285714286deg)) rotateX(-75deg);
  119. }
  120. li:nth-of-type(5) {
  121. animation-delay: -2s;
  122. }
  123. li:nth-of-type(5) a {
  124. transform: rotate(calc(-205.7142857143deg + var(--rotateTimes) * 51.4285714286deg)) translateY(9em) rotate(calc(205.7142857143deg - var(--rotateTimes) * 51.4285714286deg)) rotateX(-75deg);
  125. }
  126. /* Animations */
  127. .rise {
  128. animation: rise 1s ease-out;
  129. }
  130. .rise a {
  131. animation: fadeOut 1s ease-out;
  132. }
  133. .rise a.pop {
  134. animation: pop 1s linear;
  135. }
  136. .rise a.pop svg,
  137. .rise a.pop span {
  138. visibility: hidden;
  139. }
  140. @keyframes rise {
  141. from {
  142. transform: translateZ(0);
  143. }
  144. 15% {
  145. transform: translateZ(-1em);
  146. }
  147. to {
  148. transform: translateZ(35em);
  149. }
  150. }
  151. @keyframes fadeOut {
  152. from,
  153. 15% {
  154. opacity: 1;
  155. }
  156. 50%,
  157. to {
  158. opacity: 0;
  159. }
  160. }
  161. @keyframes pop {
  162. from {
  163. margin: -5% 0 0 -5%;
  164. width: 110%;
  165. height: 110%;
  166. opacity: 1;
  167. }
  168. 10%,
  169. to {
  170. margin: -20% 0 0 -20%;
  171. width: 140%;
  172. height: 140%;
  173. opacity: 0;
  174. }
  175. }
  176. @keyframes idle {
  177. from,
  178. to {
  179. transform: translate(-50%, -48%);
  180. }
  181. 25% {
  182. transform: translate(-52%, -50%);
  183. }
  184. 50% {
  185. transform: translate(-50%, -52%);
  186. }
  187. 75% {
  188. transform: translate(-48%, -50%);
  189. }
  190. }