All files / src/components/ui/splash/credits style.ts

0% Statements 0/23
0% Branches 0/20
0% Functions 0/10
0% Lines 0/23

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199                                                                                                                                                                                                                                                                                                                                                                                                             
import API from "renderer/lib/api";
import styled, { css, keyframes } from "styled-components";
import { StyledButton } from "ui/buttons/style";
 
const fadeIn = keyframes`
  from {
    opacity: 0;
  }
 
  to {
    opacity: 1;
  }
`;
 
const scrollAnim = keyframes`
  from {
    transform: translateY(0px);
  }
 
  to {
    transform: translateY(-200%);
  }
`;
 
export const StyledCredits = styled.div`
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overflow: hidden;
  overflow: clip;
  animation: ${fadeIn} 1s linear;
  animation-fill-mode: forwards;
  -webkit-app-region: drag;
  background: red;
  z-index: 100000;
 
  ${() =>
    API.env === "web" &&
    `@media (max-width: 840px) {
    position: fixed;
  }`}
`;
 
export const StyledCreditsTitle = styled.div`
  display: block;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  text-decoration: none;
  margin-bottom: 80px;
 
  ${() =>
    API.env === "web" &&
    `@media (max-width: 840px) {
    font-size: 30px;
  }`}
`;
 
export const StyledCreditsSubHeading = styled.div`
  display: block;
  color: #fff;
  font-size: 30px;
  font-weight: bold;
  text-decoration: none;
  margin-top: 80px;
  margin-bottom: 60px;
 
  ${() =>
    API.env === "web" &&
    `@media (max-width: 840px) {
    font-size: 20px;
  }`}
`;
 
interface StyledCreditsPersonProps {
  $gold?: boolean;
}
 
const goldPersonAnimation = keyframes`
    0%   {background-position: 0px 0px}
    40%  {background-position: 0px 0px}
    60%  {background-position: 200px 0px}
    100% {background-position: 200px 0px}
  `;
 
export const StyledCreditsPerson = styled.a<StyledCreditsPersonProps>`
  display: block;
  color: #fff;
  font-size: 20px;
  text-decoration: none;
  margin-bottom: 30px;
  touch-action: manipulation;
 
  ${(props) =>
    props.onClick
      ? css`
          > span:hover {
            color: #ffff00;
            cursor: pointer;
          }
        `
      : ""}
 
  ${(props) =>
    props.$gold
      ? css`
          font-weight: bold;
          background: linear-gradient(
            to right,
            #ffc107 0px,
            #fff 2px,
            #fff 6px,
            #ffeb3b 8px,
            #ffd08b 200px
          );
          -webkit-background-clip: text;
          -webkit-text-fill-color: transparent;
          filter: drop-shadow(0px 1px 1px #333);
          animation: ${goldPersonAnimation} 2s linear infinite;
        `
      : ""}
 
  ${() =>
    API.env === "web" &&
    `@media (max-width: 840px) {
    align-self: center;
  }`}
`;
 
interface StyledCreditsContentProps {
  $duration: number;
  $paused: boolean;
}
 
export const StyledCreditsContent = styled.div<StyledCreditsContentProps>`
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  animation: ${scrollAnim} ${(props) => props.$duration}s linear infinite;
  animation-play-state: ${(props) => (props.$paused ? "paused" : "running")};
 
  &:has(${StyledCreditsPerson} > span:hover) {
    animation-play-state: paused;
  }
 
  ${(props) =>
    API.env === "web" &&
    `@media (max-width: 840px) {
    &:has(${StyledCreditsPerson} > span:hover) {
      animation-play-state: ${props.$paused ? "paused" : "running"};
    }
  }`}
`;
 
export const StyledCreditsCloseButton = styled.div`
  position: absolute;
  top: 10px;
  right: 10px;
 
  & > * {
    height: 100%;
  }
 
  ${StyledButton} {
    padding: 0 5px;
    margin: 0;
  }
 
  ${StyledButton} svg {
    fill: #fff;
    width: 16px;
    max-width: none;
  }
`;
 
export const StyledCreditsGrid = styled.div`
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
 
  & > * {
    width: 30%;
  }
 
  ${() =>
    API.env === "web" &&
    `@media (max-width: 840px) {
    & > * {
      width: 50%;
    }
  }`}
`;