Skip to content

Commit

Permalink
Merge pull request #469 from Mile-Writings/refactor/#461/webp
Browse files Browse the repository at this point in the history
[Refactor/#461] 큰 일러 webp로 교체 및 대체이미지 설정
  • Loading branch information
ljh0608 authored Nov 5, 2024
2 parents f5f3944 + 412435a commit 3bd947a
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 24 deletions.
Binary file modified src/assets/images/errorIlust.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/webps/creategroup.webp
Binary file not shown.
Binary file added src/assets/webps/error.webp
Binary file not shown.
Binary file added src/assets/webps/joincongratulation.webp
Binary file not shown.
Binary file added src/assets/webps/login.webp
Binary file not shown.
Binary file added src/assets/webps/mainmanualcurious.webp
Binary file not shown.
Binary file added src/assets/webps/mainmanualjoin.webp
Binary file not shown.
Binary file added src/assets/webps/mainmanuallook.webp
Binary file not shown.
Binary file added src/assets/webps/mainmanualmake.webp
Binary file not shown.
Binary file added src/assets/webps/mainmanualshare.webp
Binary file not shown.
Binary file added src/assets/webps/mainmanualwrite.webp
Binary file not shown.
Binary file added src/assets/webps/mainonboarding.webp
Binary file not shown.
14 changes: 5 additions & 9 deletions src/pages/createGroup/components/CreateGroupInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from '@emotion/styled';
import { AxiosError } from 'axios';
import { ChangeEvent, Dispatch, SetStateAction, useEffect, useRef, useState } from 'react';

import createGroupWebp from '/src/assets/webps/creategroup.webp';
import {
CreateGroupImageUpload,
CreateGroupImageUploadedIc,
Expand Down Expand Up @@ -190,7 +190,10 @@ const CreateGroupInfo = ({
<Spacing marginBottom="1.1" />
<Title>나만의 글 모임을 만들어보세요</Title>
<Spacing marginBottom="2.4" />
<IllustImg src={createGroupIlust} />
<picture>
<source srcSet={createGroupWebp} />
<img src={createGroupIlust} />
</picture>
</TitleWrapper>
<WhiteInputWrapper isValid={!isGroupNameEmpty}>
<GroupInputWrapper>
Expand Down Expand Up @@ -623,13 +626,6 @@ const SubTitle = styled.h2`
${({ theme }) => theme.fonts.title5};
`;

const IllustImg = styled.img`
display: flex;
flex-shrink: 0;
width: 100%;
height: 36.6rem;
`;

const WhiteInputWrapper = styled.section<{ isValid: boolean }>`
display: flex;
align-items: center;
Expand Down
11 changes: 5 additions & 6 deletions src/pages/error/Error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useNavigate } from 'react-router-dom';

import Spacing from '../../components/commons/Spacing';
import errorIlust from '/src/assets/images/errorIlust.png';
import errorWebp from '/src/assets/webps/error.webp';

const Error = () => {
const navigate = useNavigate();
Expand All @@ -12,7 +13,10 @@ const Error = () => {

return (
<ErrorWrapper>
<ErrorIlustImage src={errorIlust} />
<picture>
<source srcSet={errorWebp} type="image/webp" />
<img src={errorIlust} />
</picture>
<Spacing marginBottom="0.8" />
<Title>페이지를 찾지 못했어요</Title>
<Spacing marginBottom="1.2" />
Expand Down Expand Up @@ -69,8 +73,3 @@ const BackToPrevPageBtn = styled.button`
${({ theme }) => theme.fonts.button3};
border-radius: 8px;
`;

const ErrorIlustImage = styled.img`
width: 51rem;
height: 24.5rem;
`;
6 changes: 5 additions & 1 deletion src/pages/groupJoinCongrats/GroupJoinCongrats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useLocation, useNavigate, useParams } from 'react-router-dom';
import { DefaultHeader } from '../../components/commons/Header';
import Spacing from '../../components/commons/Spacing';
import groupJoinCongratsIlust from '/src/assets/images/createGroupCongrats.png';
import groupJoinCongratsWebp from '/src/assets/webps/joincongratulation.webp';

const GroupJoinCongrats = () => {
const { groupId } = useParams() as { groupId: string };
Expand All @@ -25,7 +26,10 @@ const GroupJoinCongrats = () => {
<GroupJoinText>글 모임에서 당신의 소중한 이야기를 들려주세요.</GroupJoinText>
</GroupJoinTitleWrapper>
<Spacing marginBottom="4.8" />
<img src={groupJoinCongratsIlust} />
<picture>
<source srcSet={groupJoinCongratsWebp} />
<img src={groupJoinCongratsIlust} />
</picture>
<Spacing marginBottom="4.8" />
<GoToGroupFeedBtn onClick={onClickGoToGroupFeedBtn}>모임 페이지 보러가기</GoToGroupFeedBtn>
</GroupJoinCongratsContainer>
Expand Down
6 changes: 5 additions & 1 deletion src/pages/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useLocation, useNavigate } from 'react-router-dom';
import { HeaderLogoIc, KakaoLoginBtnIc } from '../../assets/svgs';
import Spacing from '../../components/commons/Spacing';
import loginIlust from '/src/assets/images/loginIlust.png';
import loginWebP from '/src/assets/webps/login.webp';

const Login = () => {
//const REDIRECT_URL = 'https://www.milewriting.com/redirect-kakao';
Expand Down Expand Up @@ -39,7 +40,10 @@ const Login = () => {
<SubText>Make it look easy 글쓰기를 쉽고 편안하게</SubText>
</LoginTextBox>
<Spacing marginBottom="2.4" />
<img src={loginIlust} />
<picture>
<source srcSet={loginWebP} type="image/webp" />
<img src={loginIlust} />
</picture>
<Spacing marginBottom="2.4" />
<KakaoLoginBtnIcon onClick={handleKakaoLogin} />
</LoginContainer>
Expand Down
10 changes: 7 additions & 3 deletions src/pages/main/components/Manual.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import styled from '@emotion/styled';

import Spacing from '../../../components/commons/Spacing';
import { MAIN_MANUAL_IMG_URL } from '../constants/mainManualImgURL';
import { MAIN_MANUAL_IMG_URL, MAIN_MANUAL_WEBP_URL } from '../constants/mainManualImgURL';

const Manual = () => {
return (
<ManualWrapper>
<ManualTitle>마일 메뉴얼</ManualTitle>
<Spacing marginBottom="3.6" />
<ManualLayout>
{MAIN_MANUAL_IMG_URL.map((item, idx) => (
<ManualImg src={item} alt={`매뉴얼 이미지${idx}`} key={idx} />
{MAIN_MANUAL_WEBP_URL.map((webpSrc, idx) => (
<picture key={idx}>
<source srcSet={webpSrc} type="image/webp" />
<ManualImg src={MAIN_MANUAL_IMG_URL[idx]} alt={`매뉴얼 이미지 ${idx}`} />
</picture>
))}
</ManualLayout>
</ManualWrapper>
Expand Down
9 changes: 6 additions & 3 deletions src/pages/main/components/OnBoarding.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import styled from '@emotion/styled';
import Spacing from '../../../components/commons/Spacing';
import mainOnBoradingImg from '/src/assets/images/mainOnBoarding.png';
import mainOnBoardingImg from '/src/assets/images/mainOnBoarding.png';
import mainOnBoardingWebp from '/src/assets/webps/mainonboarding.webp';
const OnBoarding = () => {
return (
<OnBoardingWrapper>
Expand All @@ -15,8 +16,10 @@ const OnBoarding = () => {
</SubText>
</TextLayout>
<Spacing marginBottom="3.2" />

<MainOnboardingImg src={mainOnBoradingImg} alt="메인 온보딩 이미지" />
<picture>
<source srcSet={mainOnBoardingWebp} type="image/webp" />
<MainOnboardingImg src={mainOnBoardingImg} alt="메인 온보딩 이미지" />
</picture>
</OnBoardingIcWithTextLayout>
</OnBoardingWrapper>
);
Expand Down
15 changes: 15 additions & 0 deletions src/pages/main/constants/mainManualImgURL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import mainManualLook from '/src/assets/images/mainManualLook.jpg';
import mainManualMake from '/src/assets/images/mainManualMake.jpg';
import mainManualShare from '/src/assets/images/mainManualShare.jpg';
import mainManualWrite from '/src/assets/images/mainManualWrite.jpg';
import mainManualCuriousWebp from '/src/assets/webps/mainmanualcurious.webp';
import mainManualJoinWebp from '/src/assets/webps/mainmanualjoin.webp';
import mainManualLookWebp from '/src/assets/webps/mainmanuallook.webp';
import mainManualMakeWebp from '/src/assets/webps/mainmanualmake.webp';
import mainManualShareWebp from '/src/assets/webps/mainmanualshare.webp';
import mainManualWriteWebp from '/src/assets/webps/mainmanualwrite.webp';

export const MAIN_MANUAL_IMG_URL = [
mainManualMake,
Expand All @@ -13,3 +19,12 @@ export const MAIN_MANUAL_IMG_URL = [
mainManualCurious,
mainManualLook,
];

export const MAIN_MANUAL_WEBP_URL = [
mainManualMakeWebp,
mainManualJoinWebp,
mainManualWriteWebp,
mainManualShareWebp,
mainManualCuriousWebp,
mainManualLookWebp,
];
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default defineConfig({
visualizer() as PluginOption,
],
build: {
sourcemap: true,
sourcemap: false,
rollupOptions: {
output: {
manualChunks: {
Expand Down

0 comments on commit 3bd947a

Please sign in to comment.