-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into mobile/landing
- Loading branch information
Showing
24 changed files
with
1,010 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./onboarding-character-mobile"; |
51 changes: 51 additions & 0 deletions
51
frontend/src/components/onboarding-character-mobile/onboarding-character-mobile.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { FC, useEffect, useState } from "react"; | ||
|
||
import { CharacterContainer, CharacterSwitchIcon, FifthIcon, FirstIcon, FourthIcon, ThirdIcon } from "./styles"; | ||
import { useViewport } from "../../hooks"; | ||
import { | ||
ArmaCitizen, | ||
ArmaPerk_I6, | ||
ArmaPerk_I7, | ||
ElephiaCitizen, | ||
Empty, | ||
Headpiece_Arma_3, | ||
Headpiece_Arma_5, | ||
Headpiece_Farma_4, | ||
Legendary_Garment_Arma_7, | ||
Mask_Elephia_24, | ||
Mask_Elephia_32, | ||
Mask_Mount_3, | ||
Rare_Garment_Arma_2, | ||
text, | ||
Uncommon_Garment_Arma_1, | ||
} from "../../assets"; | ||
import { zIndex } from "../../design"; | ||
|
||
const characterImages = [ArmaCitizen, ElephiaCitizen]; | ||
const headPieceImages = [Headpiece_Arma_3, Headpiece_Farma_4, Headpiece_Arma_5, Empty]; | ||
const perk1Images = [ArmaPerk_I6, ArmaPerk_I7, Empty]; | ||
const maskImages = [Mask_Mount_3, Mask_Elephia_24, Mask_Elephia_32]; | ||
const garmentImages = [Legendary_Garment_Arma_7, Rare_Garment_Arma_2, Uncommon_Garment_Arma_1]; | ||
|
||
export const OnboardingCharacterMobile: FC = () => { | ||
const { width, height } = useViewport(); | ||
const [currentIndex, setCurrentIndex] = useState(0); | ||
|
||
useEffect(() => { | ||
const intervalId = setInterval(() => { | ||
setCurrentIndex(Math.floor(Math.random() * 3.5)); | ||
}, 5000); | ||
|
||
return () => clearInterval(intervalId); | ||
}, []); | ||
|
||
return ( | ||
<CharacterContainer> | ||
<CharacterSwitchIcon src={characterImages[currentIndex] || ArmaCitizen} /> | ||
<FourthIcon src={perk1Images[currentIndex] || Empty} alt={text.character.perk1} width={width} height={height} zIndex={zIndex.perk1} /> | ||
<ThirdIcon src={headPieceImages[currentIndex] || Empty} alt={text.character.headPiece} zIndex={zIndex.headPiece} /> | ||
<FifthIcon src={maskImages[currentIndex] || Empty} alt={text.character.mask} width={width} height={height} zIndex={zIndex.mask} /> | ||
<FirstIcon src={garmentImages[currentIndex] || Empty} alt={text.character.garment} zIndex={zIndex.garment} /> | ||
</CharacterContainer> | ||
); | ||
}; |
56 changes: 56 additions & 0 deletions
56
frontend/src/components/onboarding-character-mobile/styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import styled from "@emotion/styled"; | ||
import { CharacterImgsMobile, sequentialFadeIn } from "../atoms"; | ||
import { zIndex as zIndexProps } from "../../design/spacing"; | ||
import { breakpoints } from "../../design"; | ||
|
||
export const CharacterContainer = styled.div` | ||
position: absolute; | ||
height: 100%; | ||
width: 100%; | ||
z-index: -1; | ||
@media (max-width: ${breakpoints.tablet}) { | ||
opacity: 0.5; | ||
} | ||
`; | ||
|
||
export const CharacterSwitchIcon = styled(CharacterImgsMobile)` | ||
opacity: 0; | ||
animation: ${sequentialFadeIn} 5s ease-in-out; | ||
animation-iteration-count: infinite; | ||
animation-delay: 1.5s; | ||
`; | ||
export const FirstIcon = styled(CharacterImgsMobile)` | ||
${({ zIndex }): string => `z-index: ${zIndex || zIndexProps.mid};`}; | ||
opacity: 0; | ||
animation: ${sequentialFadeIn} 5s ease-in-out; | ||
animation-iteration-count: infinite; | ||
animation-delay: 500ms; | ||
`; | ||
|
||
export const SecondIcon = styled(FirstIcon)` | ||
opacity: 0; | ||
animation: ${sequentialFadeIn} 5s ease-in-out; | ||
animation-iteration-count: infinite; | ||
animation-delay: 1s; | ||
`; | ||
|
||
export const ThirdIcon = styled(FirstIcon)` | ||
opacity: 0; | ||
animation: ${sequentialFadeIn} 5s ease-in-out; | ||
animation-iteration-count: infinite; | ||
animation-delay: 1.5s; | ||
`; | ||
|
||
export const FourthIcon = styled(FirstIcon)` | ||
opacity: 0; | ||
animation: ${sequentialFadeIn} 5s ease-in-out; | ||
animation-iteration-count: infinite; | ||
animation-delay: 2s; | ||
`; | ||
|
||
export const FifthIcon = styled(FirstIcon)` | ||
opacity: 0; | ||
animation: ${sequentialFadeIn} 5s ease-in-out; | ||
animation-iteration-count: infinite; | ||
animation-delay: 2.5s; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.