Skip to content

Commit

Permalink
fix: 레이아웃 시프트 개선 및 기타 UI 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kimjh96 committed Nov 23, 2024
1 parent ccf3ead commit 4479add
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 28 deletions.
Binary file modified bun.lockb
Binary file not shown.
4 changes: 4 additions & 0 deletions src/components/molecules/Header/Header.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ export const Adornment = styled.div`
display: flex;
align-items: center;
gap: ${({ theme: { spacing } }) => `${spacing(1)}px`};
& #language-button {
min-width: 77px;
}
`;
1 change: 1 addition & 0 deletions src/components/molecules/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function Header() {
</Button>
</Link>
<Select
id="language-button"
data-testid="language-button"
aria-label={language}
size="small"
Expand Down
16 changes: 8 additions & 8 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ GoogleFirebase.initialize();

createRoot(document.getElementById("root")!).render(
<StrictMode>
<Suspense fallback={<Loading />}>
<HelmetProvider>
<ThemeProvider>
<BrowserRouter>
<HelmetProvider>
<ThemeProvider>
<BrowserRouter>
<Suspense fallback={<Loading />}>
<App />
</BrowserRouter>
</ThemeProvider>
</HelmetProvider>
</Suspense>
</Suspense>
</BrowserRouter>
</ThemeProvider>
</HelmetProvider>
</StrictMode>
);
30 changes: 19 additions & 11 deletions src/pages/_components/Intro/Intro.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const StyledIntro = styled.section`
display: flex;
justify-content: space-between;
align-items: center;
gap: ${({ theme: { spacing } }) => `${spacing(4)}px`};
gap: ${({ theme: { spacing } }) => `${spacing(6)}px`};
font-family: "Paperlogy";
@media (max-width: ${({ theme: { breakpoints } }) => `${breakpoints.sm}px`}) {
Expand All @@ -16,6 +16,7 @@ export const StyledIntro = styled.section`
export const TitleBox = styled.div`
display: flex;
flex-direction: column;
min-width: 370px;
gap: ${({ theme: { spacing } }) => `${spacing(1)}px`};
padding: ${({ theme: { spacing } }) => `${spacing(20)}px 0px`};
Expand All @@ -33,8 +34,8 @@ export const TitleBox = styled.div`
export const Title = styled.h1`
background: linear-gradient(
90deg,
${({ theme: { palette } }) => palette.secondary} 5%,
${({ theme: { palette } }) => palette.primary} 90%
${({ theme: { palette } }) => palette.primary} 5%,
${({ theme: { palette } }) => palette.secondary} 90%
);
background-clip: text;
-webkit-text-fill-color: transparent;
Expand Down Expand Up @@ -89,26 +90,33 @@ export const SubTitle = styled.h2`

export const ImageBox = styled.div`
text-align: right;
width: 100%;
flex-grow: 1;
padding: ${({ theme: { spacing } }) => `${spacing(10)}px 0 ${spacing(10)}px ${spacing(8)}px`};
background-color: ${({ theme: { palette } }) => palette.grey["100"]};
border-radius: ${({ theme: { spacing } }) => `${spacing(4)}px`};
overflow: hidden;
@media (max-width: ${({ theme: { breakpoints } }) => `${breakpoints.sm}px`}) {
text-align: center;
padding: 0;
border-radius: 0;
}
`;

export const ImageRatioBox = styled.div`
position: relative;
padding-top: calc(100% / 750 * 568);
& > img {
max-width: 750px;
position: absolute;
top: 0;
left: 0;
width: 100%;
max-height: 574px;
height: auto;
@media (max-width: ${({ theme: { breakpoints } }) => `${breakpoints.sm}px`}) {
width: 120%;
}
}
@media (max-width: ${({ theme: { breakpoints } }) => `${breakpoints.sm}px`}) {
text-align: center;
padding: 0;
border-radius: 0;
}
`;
23 changes: 14 additions & 9 deletions src/pages/_components/Intro/Intro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Typography from "@components/atoms/Typography";

import i18n from "@utils/i18n";

import { ImageBox, StyledIntro, SubTitle, Title, TitleBox } from "./Intro.styles";
import { ImageBox, StyledIntro, SubTitle, Title, TitleBox, ImageRatioBox } from "./Intro.styles";

const PlandyMockupImage = {
en: PlandyMockupEn,
Expand All @@ -29,7 +29,7 @@ function Intro() {
<Box mt={2}>
<Button
variant="text"
startIcon={<img src={AppStoreIcon} alt="App Store" width="24px" />}
startIcon={<img src={AppStoreIcon} width={24} height={24} alt="App Store" />}
onClick={() => window.open("https://apps.apple.com/us/app/id6736831438")}
>
<Typography ml={1}>Download on</Typography>
Expand All @@ -40,13 +40,18 @@ function Intro() {
</Box>
</TitleBox>
<ImageBox>
<img
src={
i18n.language.toString() in PlandyMockupImage
? PlandyMockupImage[i18n.language.toString() as keyof typeof PlandyMockupImage]
: PlandyMockupImage.en
}
/>
<ImageRatioBox>
<img
width={750}
height={568}
src={
i18n.language.toString() in PlandyMockupImage
? PlandyMockupImage[i18n.language.toString() as keyof typeof PlandyMockupImage]
: PlandyMockupImage.en
}
alt="Plandy Mockup"
/>
</ImageRatioBox>
</ImageBox>
</StyledIntro>
);
Expand Down

0 comments on commit 4479add

Please sign in to comment.