๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

TIL_Today I Learn

๋ฏธ๋””์–ด์ฟผ๋ฆฌ ๋ฐ˜์‘ํ˜• ํŽ˜์ด์ง€ view

๐Ÿ’ ์˜ค๋Š˜์€ ์—ฌ๊ธฐ๊นŒ์ง€..

 

1. ํŒ€ํ”„๋กœ์ ํŠธ ๊นƒ ๋ ˆํฌ ๋‹ค์‹œ ์ƒ์„ฑ

2. ๋ฉ”์ธํŽ˜์ด์ง€(์–ด์ œ)-ํŽ€๋”ฉ ์ƒ์„ธํŽ˜์ด์ง€(์˜ค๋Š˜) view๊นŒ์ง€๋งŒ ๊ตฌํ˜„

โœ… ๋ฉ”์ธํŽ˜์ด์ง€ view

import React from 'react';
import { useNavigate } from 'react-router-dom';
import {
    MainContainer,
    LeftContainer,
    Logo,
    P,
    Button,
    RightContainer,
    Navbar,
    NavbarBtn,
    NavbarBtnDiv,
    Body,
    BannerImg,
    FundingDiv,
    FundingSection,
    FundingGrid,
    FundingImg,
    // FundingNewline,
    ProgressBar,
    Progress,
    BetweenDiv,
    TogatherDiv,
    Footer,
} from './HomeStyles';

// ์ด๋ฏธ์ง€ ํฌ๊ธฐ ์กฐ์ • ํ•จ์ˆ˜
// const resizeImg = (imgFile) => {
//   const maxWidth = 200;
//   const maxHeight = 140;

//   // canvas element๋ฅผ ์ƒ์„ฑํ•˜๊ณ  2D Context๋ฅผ ์–ป์Œ
//   const canvas = document.createElement("canvas");
//   const ctx = canvas.getContext("2d");

//   // img element๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ์ž…๋ ฅ ์ด๋ฏธ์ง€ ํŒŒ์ผ๋กœ ์„ค์ •
//   const img = new Image();
//   img.src = URL.createObjectURL(imgFile);

//   // ์กฐ์ ˆ๋œ ์ด๋ฏธ์ง€ Blob์œผ๋กœ resolve๋˜๋Š” Promis๋ฅผ ๋ฐ˜ํ™˜
//   return new Promise((resolve) => {
//     img.onload = () => {
//       let width = img.width;
//       let height = img.height;

//       // ์ด๋ฏธ์ง€ ๋†’์ด๊ฐ€ 140๋ณด๋‹ค ์ž‘์€ ๊ฒฝ์šฐ, ๋†’์ด๋ฅผ 140์œผ๋กœ ํ™•์žฅ
//       if (height < maxHeight) {
//         width *= maxHeight / height;
//         height = maxHeight;
//       }

//       // ์ด๋ฏธ์ง€ ๋†’์ด๊ฐ€ 140๋ณด๋‹ค ํฐ ๊ฒฝ์šฐ, ๋†’์ด๋ฅผ 140์œผ๋กœ ์ถ•์†Œ
//       if (height > maxHeight) {
//         width *= maxHeight / height;
//         height = maxHeight;
//       }

//       canvas.width = maxWidth;
//       canvas.height = maxHeight;

//       // ์ด๋ฏธ์ง€ ๊ฐ€์šด๋ฐ ์ •๋ ฌ
//       const xOffset = (maxWidth - width) / 2;
//       const yOffset = (maxHeight - height) / 2;
//       canvas.width = maxWidth;
//       canvas.height = maxHeight;
//       ctx.drawImage(img, xOffset, yOffset, width, height);

//       // canvas ๋‚ด์šฉ์„ Blob์œผ๋กœ ๋ณ€ํ™˜ํ•˜๊ณ  Promise๋ฅผ resolove
//       canvas.toBlob((blob) => {
//         resolve(blob);
//       }, imgFile.type);
//     };
//   });
// };

// ์ด๋ฏธ์ง€ ํฌ๊ธฐ ์กฐ์ ˆ
// const resizedImgBlob = await resizeImg(fundingImg);

// FormData๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ด๋ฏธ์ง€์™€ ๋ฐ์ดํ„ฐ๋ฅผ ์„œ๋ฒ„์— ์ „์†ก
// const formData = new FormData();
// formData.append("fundingImg", resizedImgBlob);
// formData.append("fundingTitle", fundingTitle);
// formData.append("fundingContents", fundingContents);

const Home = () => {
    const navigate = useNavigate();

    const meta = document.createElement('meta');
    meta.name = 'viewport';
    meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover';
    document.getElementsByTagName('head')[0].appendChild(meta);

    return (
        <MainContainer>
            <LeftContainer>
                <Logo>๐Ÿ˜‰ Giftipie</Logo>
                <P pt="25px" fs="16px" fw="800" pb="5px">
                    ๊ธฐํ”„ํ‹ฐํŒŒ์ด์—์„œ
                </P>
                <P fs="16px" fw="800" pb="5px">
                    ์ •๋ง ์›ํ•˜๋Š” ์„ ๋ฌผ์„
                </P>
                <P fs="16px" fw="800">
                    ์ฃผ๊ณ  ๋ฐ›์•„์š”
                </P>
                <Button onClick={() => navigate('/')}>ํŽ€๋”ฉ ์‹œ์ž‘ํ•˜๊ธฐ</Button>
            </LeftContainer>

            <RightContainer>
                <Navbar>
                    <NavbarBtn fs="20px" fw="800" pl="15px">
                        ๐Ÿ˜‰ Giftipie
                    </NavbarBtn>
                    <NavbarBtnDiv pr="15px">
                        <NavbarBtn fs="13px" fw="600">
                            ๋ฌธ์˜
                        </NavbarBtn>
                        <NavbarBtn fs="13px" fw="600">
                            ๋กœ๊ทธ์ธ/ํšŒ์›๊ฐ€์ž…
                        </NavbarBtn>
                    </NavbarBtnDiv>
                </Navbar>

                <Body>
                    <BannerImg src="/imgs/banner.png" alt="logo" />
                    <FundingDiv>
                        <P pt="30px" pl="20px" fs="14px" fw="800">
                            ์ง€๊ธˆ ์ง„ํ–‰์ค‘์ธ ํŽ€๋”ฉ
                        </P>
                        <FundingSection>
                            <FundingGrid onClick={() => navigate('/fundingdetail')}>
                                <FundingImg src="/imgs/airpodspro.jpeg" alt="logo" />
                                <P pt="10px" fs="12px" fw="800">
                                    ์„ค๋งž์ด AirPods Pro ์ŠคํŽ˜์…œ ์—๋””์…˜, ๊ฐ‘์ง„๋…„ ๊ธฐ๋…์œผ๋กœ ์‚ฌ์ฃผ์„ธ์š” ๐Ÿ˜˜
                                    {/* <FundingNewline></FundingNewline> */}
                                </P>
                                <P pt="10px" fs="10px" fw="800" color="gray">
                                    ์—์–ดํŒŸ ํ”„๋กœ
                                </P>
                                <ProgressBar>
                                    <Progress width={(65 / 100) * 100} />
                                </ProgressBar>
                                <BetweenDiv>
                                    <P pt="8px" fs="10px" fw="800">
                                        65%
                                    </P>
                                    <P pt="8px" pl="90px" fs="10px" fw="800">
                                        13์ผ ๋‚จ์Œ
                                    </P>
                                </BetweenDiv>
                            </FundingGrid>
                            <FundingGrid onClick={() => navigate('/fundingdetail')}>
                                <FundingImg src="/imgs/airpodspro.jpeg" alt="logo" />
                                <P pt="10px" fs="12px" fw="800">
                                    ์„ค๋งž์ด AirPods Pro ์ŠคํŽ˜์…œ ์—๋””์…˜, ๊ฐ‘์ง„๋…„ ๊ธฐ๋…์œผ๋กœ ์‚ฌ์ฃผ์„ธ์š” ๐Ÿ˜˜
                                </P>
                                <P pt="10px" fs="10px" fw="800" color="gray">
                                    ์—์–ดํŒŸ ํ”„๋กœ
                                </P>
                                <ProgressBar>
                                    <Progress width={(20 / 100) * 100} />
                                </ProgressBar>
                                <BetweenDiv>
                                    <P pt="8px" fs="10px" fw="800">
                                        20%
                                    </P>
                                    <P pt="8px" pl="90px" fs="10px" fw="800">
                                        28์ผ ๋‚จ์Œ
                                    </P>
                                </BetweenDiv>
                            </FundingGrid>
                            <FundingGrid onClick={() => navigate('/fundingdetail')}>
                                <FundingImg src="/imgs/airpodspro.jpeg" alt="logo" />
                                <P pt="10px" fs="12px" fw="800">
                                    ์„ค๋งž์ด AirPods Pro ์ŠคํŽ˜์…œ ์—๋””์…˜, ๊ฐ‘์ง„๋…„ ๊ธฐ๋…์œผ๋กœ ์‚ฌ์ฃผ์„ธ์š” ๐Ÿ˜˜
                                </P>
                                <P pt="10px" fs="10px" fw="800" color="gray">
                                    ์—์–ดํŒŸ ํ”„๋กœ
                                </P>
                                <ProgressBar>
                                    <Progress width={(20 / 100) * 100} />
                                </ProgressBar>
                                <BetweenDiv>
                                    <P pt="8px" fs="10px" fw="800">
                                        20%
                                    </P>
                                    <P pt="8px" pl="90px" fs="10px" fw="800">
                                        28์ผ ๋‚จ์Œ
                                    </P>
                                </BetweenDiv>
                            </FundingGrid>
                            <FundingGrid onClick={() => navigate('/fundingdetail')}>
                                <FundingImg src="/imgs/airpodspro.jpeg" alt="logo" />
                                <P pt="10px" fs="12px" fw="800">
                                    ์„ค๋งž์ด AirPods Pro ์ŠคํŽ˜์…œ ์—๋””์…˜, ๊ฐ‘์ง„๋…„ ๊ธฐ๋…์œผ๋กœ ์‚ฌ์ฃผ์„ธ์š” ๐Ÿ˜˜
                                </P>
                                <P pt="10px" fs="10px" fw="800" color="gray">
                                    ์—์–ดํŒŸ ํ”„๋กœ
                                </P>
                                <ProgressBar>
                                    <Progress width={(20 / 100) * 100} />
                                </ProgressBar>
                                <BetweenDiv>
                                    <P pt="8px" fs="10px" fw="800">
                                        20%
                                    </P>
                                    <P pt="8px" pl="90px" fs="10px" fw="800">
                                        28์ผ ๋‚จ์Œ
                                    </P>
                                </BetweenDiv>
                            </FundingGrid>
                        </FundingSection>
                    </FundingDiv>
                    <TogatherDiv>
                        <P pt="30px" pl="30px" fs="14px" fw="800">
                            Giftipie์—์„œ ํ•จ๊ป˜ ํ•˜๋Š” ๊ธฐ์จ
                        </P>
                        <BetweenDiv>
                            <P pt="40px" pl="30px" fs="13px" fw="800">
                                ํŽ€๋”ฉ์— ์ฐธ์—ฌํ•œ ์‚ฌ๋žŒ
                            </P>
                            <P pt="40px" pr="30px" fs="13px" fw="800">
                                11๋ช…
                            </P>
                        </BetweenDiv>
                        <BetweenDiv>
                            <P pt="20px" pl="30px" fs="13px" fw="800">
                                ์„ ๋ฌผ์„ ๋ฐ›์€ ์‚ฌ๋žŒ
                            </P>
                            <P pt="20px" pr="30px" fs="13px" fw="800">
                                11๋ช…
                            </P>
                        </BetweenDiv>
                        <BetweenDiv>
                            <P pt="20px" pl="30px" fs="13px" fw="800">
                                ๋ชจ์ธ ํŽ€๋”ฉ ๊ธˆ์•ก
                            </P>
                            <P pt="20px" pr="30px" fs="13px" fw="800">
                                89,345,000์›
                            </P>
                        </BetweenDiv>
                    </TogatherDiv>
                </Body>
                <Footer>Footer</Footer>
            </RightContainer>
        </MainContainer>
    );
};

export default Home;
import styled from "styled-components";

// ์ „์ฒด ์ปจํ…Œ์ด๋„ˆ
export const MainContainer = styled.div`
  display: flex;
  justify-content: center; // ์ˆ˜์ •ํ•จ
  /* width: 1200px; */
  max-width: 1200px; // ์ˆ˜์ •ํ•จ
  min-height: 100vh;
  margin: 0 auto;
  flex-wrap: wrap;
`;

// ์™ผ์ชฝ ์ปจํ…Œ์ด๋„ˆ
export const LeftContainer = styled.div`
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 500px;
  height: 100vh;
  padding: 20px;
  border: 1px solid lightgray;
  border-radius: 8px;
  margin-right: 100px;

  @media (max-width: 1024px) {
    display: none;
  }
`;

export const Logo = styled.h1`
  font-size: 24px;
  font-weight: 800;
`;

export const P = styled.p`
  padding-top: ${(props) => props.pt};
  padding-bottom: ${(props) => props.pb};
  padding-left: ${(props) => props.pl};
  padding-right: ${(props) => props.pr};
  font-size: ${(props) => props.fs};
  font-weight: ${(props) => props.fw};
  color: ${(props) => props.color};
  align-items: center;
`;

export const Button = styled.button`
  justify-content: center;
  align-items: center;
  width: 200px;
  height: 50px;
  padding: 10px;
  background-color: orange;
  border-radius: 7px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  margin-top: 30px;
  margin-bottom: 20px;
  &:hover {
    color: white;
    background-color: violet;
    cursor: pointer;
  }
`;

// ์˜ค๋ฅธ์ชฝ ์ปจํ…Œ์ด๋„ˆ
export const RightContainer = styled.div`
  position: relative;
  /* width: 470px; */
  width: 442px;
  /* margin-left: auto; */
  border: 1px solid lightgray;

  /* @media (max-width: 1024px) { */
  @media (max-width: 442px) {
    width: 100%;
  }
`;

// ๋„ค๋ธŒ๋ฐ” ์˜์—ญ
export const Navbar = styled.div`
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  height: 70px;
`;

export const NavbarBtn = styled.button`
  font-size: ${(props) => props.fs};
  font-weight: ${(props) => props.fw};
  padding-left: ${(props) => props.pl};
  padding-right: ${(props) => props.pr};
`;

export const NavbarBtnDiv = styled.div`
  flex-direction: row;
  padding-right: ${(props) => props.pr};
`;

// ๋ฐ”๋”” ์˜์—ญ
export const Body = styled.div`
  font-size: 24px;
  font-weight: 800;
  height: 1500px;
`;

export const BannerImg = styled.img`
  width: 100%;
  /* max-width: 470px; */
  max-width: 442px;
  height: auto;
`;

export const FundingDiv = styled.div`
  justify-content: center;
  width: 100%;
  /* max-width: 470px; */
  max-width: 442px;
  height: auto;
`;

export const FundingSection = styled.div`
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  /* width: 100%; */
  gap: 10px;
  padding: 10px;
`;

export const FundingGrid = styled.div`
  /* width: 200px; */
  /* width: 195px; */
  width: 100%;
  max-width: 190px;

  /* @media (max-width: 470px) { */
  /* @media (max-width: 195px) {
    width: 100%; // FundingGrid๊ฐ€ ๋ถ€๋ชจ ์ปจํ…Œ์ด๋„ˆ์— ๊ฝ‰ ์ฐจ๋„๋ก ์„ค์ •
  } */
`;

export const FundingImg = styled.img`
  /* width: 200px; */
  max-width: 190px;
  max-height: 140px;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  margin-top: 10px;
`;

export const FundingNewline = styled.div`
  width: 100%;
  height: 12px;
`;

export const ProgressBar = styled.div`
  width: 100%;
  height: 10px;
  background-color: #dedede;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.8rem;
  margin-top: 20px;
  overflow: hidden;
`;

export const Progress = styled.div`
  width: ${(props) => props.width}%;
  height: 10px;
  padding: 0;
  text-align: center;
  background-color: orange;
  border-radius: 15px; // ์ถ”๊ฐ€
  color: #111;
`;

export const BetweenDiv = styled.div`
  display: flex;
  flex-direction: row;
  justify-content: space-between;
`;

export const TogatherDiv = styled.div`
  margin-top: 20px;
  /* width: 470px; */
  width: 442px;
  /* height: 200px; */
  height: 210px;
  background-color: orange;
`;

export const Footer = styled.div`
  border: 1px solid lightgray;
  font-size: 24px;
  font-weight: 800;
  height: 80px;
`;

โœ… ํŽ€๋”ฉ ์ƒ์„ธํŽ˜์ด์ง€ view

import React from 'react';
import {
    MainContainer,
    LeftContainer,
    Logo,
    P,
    Button,
    RightContainer,
    Navbar,
    NavbarBtn,
    NavbarBtnDiv,
    Body,
    BannerImg,
    FundingDiv,
    FundingSection,
    FundingGrid,
    FundingImg,
    SponsorImg,
    ProgressBar,
    Progress,
    BetweenDiv,
    TogatherDiv,
    Footer,
} from './FundingDetailStyles';

const FundingDetail = () => {
    const meta = document.createElement('meta');
    meta.name = 'viewport';
    meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover';
    document.getElementsByTagName('head')[0].appendChild(meta);

    return (
        <MainContainer>
            <LeftContainer>
                <Logo>๐Ÿ˜‰ Giftipie</Logo>
                <P pt="25px" fs="16px" fw="800" pb="5px">
                    ๊ธฐํ”„ํ‹ฐํŒŒ์ด์—์„œ
                </P>
                <P fs="16px" fw="800" pb="5px">
                    ์ •๋ง ์›ํ•˜๋Š” ์„ ๋ฌผ์„
                </P>
                <P fs="16px" fw="800">
                    ์ฃผ๊ณ  ๋ฐ›์•„์š”
                </P>
                <Button mt="20px" w="200px" h="50px" fs="17px" color="white">
                    ํŽ€๋”ฉ ์‹œ์ž‘ํ•˜๊ธฐ
                </Button>
            </LeftContainer>

            <RightContainer>
                <Navbar>
                    <NavbarBtn fs="20px" fw="800" pl="15px">
                        ๐Ÿ˜‰ Giftipie
                    </NavbarBtn>
                    <NavbarBtnDiv pr="15px">
                        <NavbarBtn fs="13px" fw="600">
                            ๋ฌธ์˜
                        </NavbarBtn>
                        <NavbarBtn fs="13px" fw="600">
                            ๋กœ๊ทธ์ธ/ํšŒ์›๊ฐ€์ž…
                        </NavbarBtn>
                    </NavbarBtnDiv>
                </Navbar>

                <Body>
                    <BannerImg src="/imgs/airpodspro2.jpg" alt="image" />
                    <FundingDiv>
                        <P pt="20px" fs="13px" fw="800">
                            ์ง„ํ–‰์ค‘
                        </P>
                        <P pt="10px" fs="20px" fw="900">
                            ์ธ์ƒ ์ฒซ ์—์–ดํŒŸ์„ ์„ ๋ฌผํ•ด์ฃผ์„ธ์š” ๐Ÿ˜˜
                        </P>
                        <BetweenDiv>
                            <P pt="10px" fs="15px" fw="800">
                                D-5
                            </P>
                            <P pt="10px" fs="15px" fw="800">
                                2์›” 1์ผ 23:59 ๋งˆ๊ฐ
                            </P>
                        </BetweenDiv>
                        <P pt="10px" fs="15px" fw="800">
                            ์œค๋‹ค์ธ
                        </P>
                        <ProgressBar>
                            <Progress width={(65 / 100) * 100} />
                        </ProgressBar>
                        <BetweenDiv>
                            <P pt="8px" fs="15px" fw="800">
                                65%
                            </P>
                            <P pt="8px" pl="90px" fs="15px" fw="800">
                                13์ผ ๋‚จ์Œ
                            </P>
                        </BetweenDiv>
                    </FundingDiv>

                    <TogatherDiv bc="orange">
                        <P pt="30px" pl="30px" fs="14px" fw="800">
                            ์•ˆ๋…•ํ•˜์„ธ์š” ์—ฌ๋Ÿฌ๋ถ„
                            <br />
                            ์ผ๋‹จ ์—ฌ๊ธฐ๊นŒ์ง€ ์™€์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค ใ…Žใ…Ž
                        </P>
                        <P pt="20px" pl="30px" fs="14px" fw="800">
                            ์ด๋ฒˆ 20๋ฒˆ์งธ ์ƒ์ผ๋กœ
                            <br />
                            ์ธ์ƒ ์ฒซ ์—์–ดํŒŸ์„ ๊ฐ€์ง€๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค!!!
                        </P>
                        <P pt="20px" pl="30px" fs="14px" fw="800">
                            ์—ฌ๋Ÿฌ๋ถ„์˜ ์†Œ์ค‘ํ•œ ์„ ๋ฌผ ๊ณ ์ด๊ณ ์ด ๋ชจ์‹œ๋ฉด์„œ
                            <br />
                            ์•Œ๋œฐ์‚ด๋œฐ ์‚ฌ์šฉํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
                            <br />
                            ๋„์™€์ฃผ์„ธ์š” ๐Ÿ˜˜๐Ÿ˜˜๐Ÿ˜˜
                            <br />
                        </P>
                    </TogatherDiv>

                    <FundingDiv>
                        <P pt="20px" fs="16px" fw="900">
                            ํ›„์›์ž
                        </P>
                        <P pt="20px" fs="13px" fw="800">
                            ์•„**
                        </P>
                        <SponsorImg src="/imgs/iu.jpg" alt="image" />

                        <P pt="20px" fs="13px" fw="800">
                            ์†ก**
                        </P>
                        <SponsorImg src="/imgs/songjoongy.jpg" alt="logo" />

                        <P pt="20px" fs="13px" fw="800">
                            ์ „**
                        </P>
                        <SponsorImg src="/imgs/junjihyun.jpg" alt="logo" />
                        <P pt="20px" pl="160px" fs="14px" fw="800">
                            ์ „์ฒด๋ณด๊ธฐ โ–ถ
                        </P>
                    </FundingDiv>

                    <FundingDiv>
                        <P pt="20px" fs="16px" fw="900">
                            ํŽ€๋”ฉ ์ฐธ์—ฌํ•˜๊ธฐ
                        </P>
                        <ProgressBar>
                            <Progress width={(36 / 100) * 100} />
                        </ProgressBar>
                        <BetweenDiv>
                            <P pt="8px" fs="15px" fw="800">
                                36%
                            </P>
                            <P pt="8px" pl="90px" fs="15px" fw="800">
                                210,500์› ๋‚จ์•˜์–ด์š”
                            </P>
                        </BetweenDiv>
                        <Button mt="30px" w="375px" h="60px">
                            <BetweenDiv>
                                <P pt="2px" pl="20px" fs="15px" fw="800" color="black">
                                    ์ปคํ”ผ ํ•œ์ž” ์„ ๋ฌผํ•˜๊ธฐ
                                </P>
                                <P pt="2px" pr="20px" fs="15px" fw="700" color="black">
                                    5,000์›
                                </P>
                            </BetweenDiv>
                        </Button>
                        <Button mt="10px" w="375px" h="60px">
                            <BetweenDiv>
                                <P pt="2px" pl="20px" fs="15px" fw="800" color="black">
                                    ํŒŒ์ธํŠธ ์•„์ด์Šคํฌ๋ฆผ ์„ ๋ฌผํ•˜๊ธฐ
                                </P>
                                <P pt="2px" pr="20px" fs="15px" fw="700" color="black">
                                    10,000์›
                                </P>
                            </BetweenDiv>
                        </Button>
                        <Button mt="10px" w="375px" h="60px">
                            <BetweenDiv>
                                <P pt="2px" pl="20px" fs="15px" fw="800" color="black">
                                    ์›ํ•˜๋Š”๋งŒํผ ์„ ๋ฌผํ•˜๊ธฐ
                                </P>
                                <P pt="2px" pr="20px" fs="15px" fw="700" color="black">
                                    ์ง์ ‘์ž…๋ ฅ
                                </P>
                            </BetweenDiv>
                        </Button>
                        <Button mt="10px" w="375px" h="60px">
                            <BetweenDiv>
                                <P pt="2px" pl="20px" fs="15px" fw="800" color="black">
                                    ์ด ํŽ€๋”ฉ์„ ๋๋‚ด๋Ÿฌ ์™”๋‹ค
                                </P>
                                <P pt="2px" pr="20px" fs="15px" fw="700" color="black">
                                    210,500์›
                                </P>
                            </BetweenDiv>
                        </Button>
                    </FundingDiv>
                    <TogatherDiv bc="violet">
                        <P pt="30px" pl="30px" fs="16px" fw="800">
                            Giftipie์—์„œ ํ•จ๊ป˜ ํ•˜๋Š” ๊ธฐ์จ
                        </P>
                        <BetweenDiv>
                            <P pt="40px" pl="30px" fs="13px" fw="800">
                                ํŽ€๋”ฉ์— ์ฐธ์—ฌํ•œ ์‚ฌ๋žŒ
                            </P>
                            <P pt="40px" pr="30px" fs="13px" fw="800">
                                11๋ช…
                            </P>
                        </BetweenDiv>
                        <BetweenDiv>
                            <P pt="20px" pl="30px" fs="13px" fw="800">
                                ์„ ๋ฌผ์„ ๋ฐ›์€ ์‚ฌ๋žŒ
                            </P>
                            <P pt="20px" pr="30px" fs="13px" fw="800">
                                11๋ช…
                            </P>
                        </BetweenDiv>
                        <BetweenDiv>
                            <P pt="20px" pl="30px" fs="13px" fw="800">
                                ๋ชจ์ธ ํŽ€๋”ฉ ๊ธˆ์•ก
                            </P>
                            <P pt="20px" pr="30px" fs="13px" fw="800">
                                200,000์›
                            </P>
                        </BetweenDiv>
                    </TogatherDiv>

                    <Button mt="30px" w="442px" h="70px" color="black" fs="19px">
                        ์„ ๋ฌผํ•˜๊ธฐ
                    </Button>
                </Body>
                <Footer>Footer</Footer>
            </RightContainer>
        </MainContainer>
    );
};

export default FundingDetail;
import styled from "styled-components";

// ์ „์ฒด ์ปจํ…Œ์ด๋„ˆ
export const MainContainer = styled.div`
  display: flex;
  justify-content: center; // ์ˆ˜์ •ํ•จ
  /* width: 1200px; */
  max-width: 1200px; // ์ˆ˜์ •ํ•จ
  min-height: 100vh;
  margin: 0 auto;
  flex-wrap: wrap;
`;

// ์™ผ์ชฝ ์ปจํ…Œ์ด๋„ˆ
export const LeftContainer = styled.div`
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 500px;
  height: 100vh;
  padding: 20px;
  border: 1px solid lightgray;
  border-radius: 8px;
  margin-right: 100px;

  @media (max-width: 1024px) {
    display: none;
  }
`;

export const Logo = styled.h1`
  font-size: 24px;
  font-weight: 800;
`;

export const P = styled.p`
  padding-top: ${(props) => props.pt};
  padding-bottom: ${(props) => props.pb};
  padding-left: ${(props) => props.pl};
  padding-right: ${(props) => props.pr};
  font-size: ${(props) => props.fs};
  font-weight: ${(props) => props.fw};
  color: ${(props) => props.color};
  align-items: center;
`;

export const Button = styled.button`
  justify-content: center;
  align-items: center;
  width: ${(props) => props.w};
  height: ${(props) => props.h};
  padding: 10px;
  background-color: orange;
  border-radius: 7px;
  color: ${(props) => props.color};
  font-size: ${(props) => props.fs};
  font-weight: 600;
  margin-top: ${(props) => props.mt};
  margin-bottom: ${(props) => props.mb};
  &:hover {
    color: white;
    background-color: violet;
    cursor: pointer;
  }
`;

// ์˜ค๋ฅธ์ชฝ ์ปจํ…Œ์ด๋„ˆ
export const RightContainer = styled.div`
  position: relative;
  /* width: 470px; */
  width: 442px;
  /* margin-left: auto; */
  border: 1px solid lightgray;

  /* @media (max-width: 1024px) { */
  @media (max-width: 442px) {
    width: 100%;
  }
`;

// ๋„ค๋ธŒ๋ฐ” ์˜์—ญ
export const Navbar = styled.div`
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  height: 70px;
`;

export const NavbarBtn = styled.button`
  font-size: ${(props) => props.fs};
  font-weight: ${(props) => props.fw};
  padding-left: ${(props) => props.pl};
  padding-right: ${(props) => props.pr};
`;

export const NavbarBtnDiv = styled.div`
  flex-direction: row;
  padding-right: ${(props) => props.pr};
`;

// ๋ฐ”๋”” ์˜์—ญ
export const Body = styled.div`
  font-size: 24px;
  font-weight: 800;
  height: 2100px;
`;

export const BannerImg = styled.img`
  width: 100%;
  /* max-width: 470px; */
  max-width: 442px;
  height: auto;
`;

export const FundingDiv = styled.div`
  justify-content: center;
  width: 100%;
  /* max-width: 470px; */
  max-width: 442px;
  height: auto;
  padding: 30px;
`;

export const FundingSection = styled.div`
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  /* width: 100%; */
  gap: 10px;
  padding: 10px;
`;

export const FundingGrid = styled.div`
  /* width: 200px; */
  /* width: 195px; */
  width: 100%;
  max-width: 190px;

  /* @media (max-width: 470px) { */
  /* @media (max-width: 195px) {
    width: 100%; // FundingGrid๊ฐ€ ๋ถ€๋ชจ ์ปจํ…Œ์ด๋„ˆ์— ๊ฝ‰ ์ฐจ๋„๋ก ์„ค์ •
  } */
`;

export const FundingImg = styled.img`
  /* width: 200px; */
  max-width: 190px;
  max-height: 140px;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  margin-top: 10px;
`;

export const SponsorImg = styled.img`
  /* width: 200px; */
  width: 60px;
  height: 60px;
  border-radius: 100px;
  margin-top: 10px;
`;

export const FundingNewline = styled.div`
  width: 100%;
  height: 12px;
`;

export const ProgressBar = styled.div`
  width: 100%;
  height: 10px;
  background-color: #dedede;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.8rem;
  margin-top: 20px;
  overflow: hidden;
  padding-left: ${(props) => props.pl};
  padding-right: ${(props) => props.pr};
`;

export const Progress = styled.div`
  width: ${(props) => props.width}%;
  height: 10px;
  padding: 0;
  text-align: center;
  background-color: orange;
  border-radius: 15px; // ์ถ”๊ฐ€
  color: #111;
  padding-left: ${(props) => props.pl};
  padding-right: ${(props) => props.pr};
`;

export const BetweenDiv = styled.div`
  display: flex;
  flex-direction: row;
  justify-content: space-between;
`;

export const TogatherDiv = styled.div`
  margin-top: 20px;
  /* width: 470px; */
  width: 442px;
  /* height: 200px; */
  height: 215px;
  background-color: ${(props) => props.bc};
`;

export const Footer = styled.div`
  border: 1px solid lightgray;
  font-size: 24px;
  font-weight: 800;
  height: 80px;
`;