|
| 1 | +import { keyframes, styled } from "styled-components"; |
| 2 | +import { Color } from "@styles/colors"; |
| 3 | +import { motion } from "motion/react"; |
| 4 | +import { BIG_BREAKPOINT } from "@constants/BreakPoints"; |
| 5 | + |
| 6 | +const revealAnimation = keyframes` |
| 7 | + from { |
| 8 | + opacity: 0; |
| 9 | + translate: 0 100px; |
| 10 | + } |
| 11 | + 50% { |
| 12 | + opacity: .5; |
| 13 | + } |
| 14 | + to { |
| 15 | + opacity: 1; |
| 16 | + translate: 0 0; |
| 17 | + }`; |
| 18 | + |
| 19 | +export type FaqCardType = { |
| 20 | + faq: { |
| 21 | + question: string; |
| 22 | + answer: string; |
| 23 | + }; |
| 24 | + index: number; |
| 25 | +}; |
| 26 | +export const StyledFaqSection = styled(motion.section)` |
| 27 | + display: flex; |
| 28 | + flex-direction: column; |
| 29 | + justify-content: center; |
| 30 | + align-items: center; |
| 31 | + padding: 3rem 2rem; |
| 32 | + position: relative; |
| 33 | + @media (min-width: 650px) { |
| 34 | + padding: 3rem 5rem; |
| 35 | + } |
| 36 | +`; |
| 37 | +export const StyledWaveContainer = styled.div` |
| 38 | + background: ${Color.DARK_BLUE}; |
| 39 | + overflow-y: hidden; |
| 40 | + height: 5rem; |
| 41 | + width: 100%; |
| 42 | +`; |
| 43 | +export const StyleMoreIcon = styled.img` |
| 44 | + position: absolute; |
| 45 | + right: 0; |
| 46 | + top: 5rem; |
| 47 | + height: 5rem; |
| 48 | + @media (min-width: 800px) { |
| 49 | + height: 10rem; |
| 50 | + } |
| 51 | +`; |
| 52 | +export const StyleLessIcon = styled.img` |
| 53 | + position: absolute; |
| 54 | + left: -1rem; |
| 55 | + top: 50%; |
| 56 | + height: 5rem; |
| 57 | + @media (min-width: 800px) { |
| 58 | + height: 10rem; |
| 59 | + } |
| 60 | +`; |
| 61 | +export const StyledImage = styled.img` |
| 62 | + margin: 3px; |
| 63 | + padding: 5px; |
| 64 | + aspect-ratio: 1.5; |
| 65 | + border: 1px solid ${Color.YELLOW}; |
| 66 | + border-radius: 100% 0 100% 0 / 15% 89% 11% 85%; |
| 67 | + animation: linear ${revealAnimation} both; |
| 68 | + animation-timeline: view(); |
| 69 | + animation-range: entry 5% cover 30%; |
| 70 | +
|
| 71 | + @media (max-width: ${BIG_BREAKPOINT}px) { |
| 72 | + width: 100%; |
| 73 | + } |
| 74 | +`; |
| 75 | +export const StyledH2 = styled.h2` |
| 76 | + color: white; |
| 77 | + margin-bottom: 10px; |
| 78 | +`; |
| 79 | +export const StyledP = styled.p` |
| 80 | + color: white; |
| 81 | + margin-bottom: 10px; |
| 82 | +`; |
| 83 | + |
| 84 | +export const StyledFaqCard = styled.div` |
| 85 | + display: flex; |
| 86 | + align-items: center; |
| 87 | + flex-direction: row; |
| 88 | + width: 90%; |
| 89 | + margin-bottom: 3rem; |
| 90 | + @media (min-width: 800px) { |
| 91 | + align-items: flex-start; |
| 92 | + max-width: 900px; |
| 93 | + margin-bottom: 4rem; |
| 94 | + } |
| 95 | +`; |
| 96 | +export const StyledFaqImageContainer = styled.div.withConfig({ |
| 97 | + shouldForwardProp: (prop) => !["padding"].includes(prop), |
| 98 | +})<{ padding: string }>` |
| 99 | + position: relative; |
| 100 | + @media (min-width: 800px) { |
| 101 | + height: auto; |
| 102 | +
|
| 103 | + padding: ${({ padding }) => { |
| 104 | + return padding; |
| 105 | + }}; |
| 106 | + } |
| 107 | +`; |
| 108 | +export const StyledFaqImage = styled(motion.img)` |
| 109 | + border: 1px solid ${Color.YELLOW}; |
| 110 | + display: block; |
| 111 | + height: 242px; |
| 112 | + margin: 3px; |
| 113 | + padding: 5px; |
| 114 | + width: 360px; |
| 115 | + border-radius: 92% 8% 90% 10% / 9% 90% 10% 91%; |
| 116 | + animation: linear ${revealAnimation} both; |
| 117 | + animation-timeline: view(); |
| 118 | + animation-range: entry 5% cover 30%; |
| 119 | +
|
| 120 | + @media (max-width: ${BIG_BREAKPOINT}px) { |
| 121 | + display: none; |
| 122 | + } |
| 123 | +`; |
| 124 | +export const StyledFaqInfo = styled(motion.div)<{ align: string }>` |
| 125 | + display: flex; |
| 126 | + flex-direction: column; |
| 127 | + color: ${Color.WHITE}; |
| 128 | + @media (min-width: 800px) { |
| 129 | + width: 60%; |
| 130 | + align-items: ${({ align }) => { |
| 131 | + return align; |
| 132 | + }}; |
| 133 | + } |
| 134 | +`; |
| 135 | +export const StyledFaqTitle = styled.h2` |
| 136 | + padding-top: 1rem; |
| 137 | + color: ${Color.YELLOW}; |
| 138 | + font-size: 1.3em; |
| 139 | + @media (min-width: 800px) { |
| 140 | + text-align: left; |
| 141 | + padding-top: unset; |
| 142 | + } |
| 143 | +`; |
| 144 | +export const StyledFaqText = styled.p` |
| 145 | + padding: 0.5rem 2rem; |
| 146 | + text-align: left; |
| 147 | + @media (min-width: 800px) { |
| 148 | + hyphens: auto; |
| 149 | + word-wrap: break-word; |
| 150 | + } |
| 151 | +
|
| 152 | + ul { |
| 153 | + margin: 0.5rem 2rem; |
| 154 | + } |
| 155 | +`; |
| 156 | +export const StyledSummaryLink = styled.a` |
| 157 | + color: ${Color.LIGHT_BLUE}; |
| 158 | + text-decoration: none !important; |
| 159 | + transition: all 0.25s ease-in-out; |
| 160 | +
|
| 161 | + &:hover { |
| 162 | + font-weight: bold; |
| 163 | + text-decoration: none; |
| 164 | + color: ${Color.YELLOW}; |
| 165 | + } |
| 166 | +
|
| 167 | + &:visited { |
| 168 | + color: ${Color.MAGENTA}; |
| 169 | + text-decoration: none; |
| 170 | + } |
| 171 | +`; |
0 commit comments