|
| 1 | +@mixin sp-layout { |
| 2 | + @media screen and (max-width: 750px) { |
| 3 | + @content; |
| 4 | + } |
| 5 | +} |
| 6 | + |
| 7 | +@function random_range($min, $max) { |
| 8 | + $rand: random(); |
| 9 | + $random_range: $min + floor($rand * (($max - $min) + 1)); |
| 10 | + @return $random_range; |
| 11 | +} |
| 12 | + |
| 13 | +@keyframes fall { |
| 14 | + to { |
| 15 | + visibility: visible; |
| 16 | + transform: translate3d(-30em, 0, 0); |
| 17 | + } |
| 18 | +} |
| 19 | + |
| 20 | +@keyframes tail-fade { |
| 21 | + 0%, 50% { |
| 22 | + visibility: visible; |
| 23 | + width: var(--star-tail-length); |
| 24 | + opacity: 1; |
| 25 | + } |
| 26 | + |
| 27 | + 70%, 80% { |
| 28 | + visibility: visible; |
| 29 | + width: 0; |
| 30 | + opacity: 0.4; |
| 31 | + } |
| 32 | + |
| 33 | + 100% { |
| 34 | + visibility: visible; |
| 35 | + width: 0; |
| 36 | + opacity: 0; |
| 37 | + } |
| 38 | +} |
| 39 | + |
| 40 | +@keyframes blink { |
| 41 | + 50% { |
| 42 | + visibility: visible; |
| 43 | + opacity: 0.6; |
| 44 | + } |
| 45 | +} |
| 46 | + |
| 47 | +@font-face { |
| 48 | + font-family: 'Fyodor-Bold'; |
| 49 | + src: url('/fonts/Fyodor-Bold.eot'); |
| 50 | + src: url('/fonts/Fyodor-Bold.eot?#iefix') format('embedded-opentype'), |
| 51 | + url('/fonts/Fyodor-Bold.woff2') format('woff2'), |
| 52 | + url('/fonts/Fyodor-Bold.woff') format('woff'); |
| 53 | + font-weight: normal; |
| 54 | + font-style: normal; |
| 55 | +} |
| 56 | + |
| 57 | +.gagarin { |
| 58 | + |
| 59 | + background-color: #e5ddbc; |
| 60 | + //background: url(/img/gagarin/space.jpg); |
| 61 | + background-size: cover; |
| 62 | + overflow: hidden; |
| 63 | + font-family: "Fyodor-Bold", serif!important; |
| 64 | + position: relative; |
| 65 | + @extend .rounded; |
| 66 | + |
| 67 | + |
| 68 | + svg { |
| 69 | + display: block; |
| 70 | + background-image: url('/img/gagarin/space.jpg') ; |
| 71 | + border-radius: 0.5rem; |
| 72 | + background-size: cover; |
| 73 | + } |
| 74 | + |
| 75 | + #ship, #comet { |
| 76 | + border-radius: 8px; |
| 77 | + } |
| 78 | + |
| 79 | + .assets { |
| 80 | + display: none; |
| 81 | + } |
| 82 | + |
| 83 | + #timer { |
| 84 | + color: #fff; |
| 85 | + font-size: 2rem; |
| 86 | + } |
| 87 | + |
| 88 | + .stats { |
| 89 | + margin: 1rem; |
| 90 | + color: rgba(255, 255, 255, 0.5); |
| 91 | + font-size: 2rem; |
| 92 | + } |
| 93 | + |
| 94 | + #message { |
| 95 | + border-radius: 0.5rem 0.5rem 0 0 ; |
| 96 | + color: #e5ddbc; |
| 97 | + font-size: 4rem; |
| 98 | + text-align: center; |
| 99 | + background: #c44b43; |
| 100 | + } |
| 101 | + |
| 102 | + .wrapper { |
| 103 | + background: #c44b43; |
| 104 | + color: #e5ddbc; |
| 105 | + border-radius: 0.35rem; |
| 106 | + padding: 1rem 1rem 0 1rem; |
| 107 | + z-index: 2 |
| 108 | + } |
| 109 | + |
| 110 | + .stars { |
| 111 | + position: fixed; |
| 112 | + top: 0; |
| 113 | + left: 0; |
| 114 | + width: 100%; |
| 115 | + height: 120%; |
| 116 | + transform: rotate(-45deg); |
| 117 | + z-index: 1; |
| 118 | + } |
| 119 | + |
| 120 | + .star { |
| 121 | + $star-count: 50; |
| 122 | + --star-color: var(--primary-color); |
| 123 | + --star-tail-length: 6em; |
| 124 | + --star-tail-height: 2px; |
| 125 | + --star-width: calc(var(--star-tail-length) / 6); |
| 126 | + --fall-duration: 9s; |
| 127 | + --tail-fade-duration: var(--fall-duration); |
| 128 | + |
| 129 | + position: absolute; |
| 130 | + top: var(--top-offset); |
| 131 | + left: 0; |
| 132 | + width: var(--star-tail-length); |
| 133 | + height: var(--star-tail-height); |
| 134 | + color: var(--star-color); |
| 135 | + background: linear-gradient(45deg, #6c7a9a, transparent); |
| 136 | + border-radius: 50%; |
| 137 | + filter: drop-shadow(0 0 6px currentColor); |
| 138 | + transform: translate3d(104em, 0, 0); |
| 139 | + visibility: hidden; |
| 140 | + animation: fall var(--fall-duration) var(--fall-delay) linear infinite, tail-fade var(--tail-fade-duration) var(--fall-delay) ease-out infinite; |
| 141 | + |
| 142 | + @include sp-layout { |
| 143 | + // For mobile performance, tail-fade animation will be removed QAQ |
| 144 | + animation: fall var(--fall-duration) var(--fall-delay) linear infinite; |
| 145 | + } |
| 146 | + |
| 147 | + @for $i from 1 through $star-count { |
| 148 | + &:nth-child(#{$i}) { |
| 149 | + --star-tail-length: #{max(600, random(750)) / 100}em; |
| 150 | + --top-offset: #{random(10000) / 100}vh; |
| 151 | + --fall-duration: #{max(6000, random(12000)) / 1000}s; |
| 152 | + --fall-delay: #{random(10000) / 1000}s; |
| 153 | + } |
| 154 | + } |
| 155 | + |
| 156 | + &::before, &::after { |
| 157 | + position: absolute; |
| 158 | + content: ''; |
| 159 | + top: 0; |
| 160 | + left: calc(var(--star-width) / -2); |
| 161 | + width: var(--star-width); |
| 162 | + height: 100%; |
| 163 | + background: linear-gradient(45deg, transparent, currentColor, transparent); |
| 164 | + border-radius: inherit; |
| 165 | + animation: blink 2s linear infinite; |
| 166 | + } |
| 167 | + |
| 168 | + &::before { |
| 169 | + transform: rotate(45deg); |
| 170 | + } |
| 171 | + |
| 172 | + &::after { |
| 173 | + transform: rotate(-45deg); |
| 174 | + } |
| 175 | + } |
| 176 | + |
| 177 | + |
| 178 | +} |
0 commit comments