๐Ÿ“’ [ TIL ] 2022.04.29_10์ผ์ฐจ # ์ธ์Šคํƒ€UIํด๋ก (2)

๋ฌธ๋ช…์ฃผยท2022๋…„ 4์›” 29์ผ
0
post-thumbnail

[ 2022-04-29 (๊ธˆ) ์˜ค๋Š˜์˜ TIL ]

[ Today Project ]

  • ์ธ์Šคํƒ€ UIํด๋ก  ํ”„๋ก ํŠธ๊ฐœ๋ฐœ
    : ์ด๋ฒˆ ํ”„๋กœ์ ํŠธ๋Š” ๊ฐœ์ธํ”„๋กœ์ ํŠธ๋กœ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

[ Today Learn ]

  • ๋ถ€ํŠธ์ŠคํŠธ๋žฉ carousel์„ ์ด์šฉํ•˜์—ฌ ํ”ผ๋“œ๊ฒŒ์‹œ
  • ๋ถ€ํŠธ์ŠคํŠธ๋žฉ modal ์ ์šฉํ•˜๊ธฐ

โœ๏ธ ๋‚ด๊ฐ€ ๋ฐฐ์šด๊ฒƒ, ์–ป์€๊ฒƒ

  • ๋ถ€ํŠธ์ŠคํŠธ๋žฉ์˜ carousel์„ ์ด์šฉํ•˜์—ฌ ํ”ผ๋“œ๋ฅผ ์—ฌ๋Ÿฌ์žฅ ๊ฒŒ์‹œํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•˜๊ธฐ

์–ด์ œ ๋งŒ๋“  ์ฝ”๋“œ๊ฐ™์€ ๊ฒฝ์šฐ์—๋Š” ๋ถ€ํŠธ์ŠคํŠธ๋žฉ์„ ์ด์šฉํ•˜์ง€ ์•Š๊ณ  ๋‚ด๊ฐ€ ์ง์ ‘ ๊ฒŒ์‹œํ”ผ๋“œ๋ฅผ ๋งŒ๋“ค์—ˆ๊ธฐ๋•Œ๋ฌธ์— ์‚ฌ์ง„์„ ํ•œ์žฅ๋งŒ ๊ฒŒ์‹œํ•  ์ˆ˜ ์žˆ๋„๋ก ๋˜์–ด์žˆ์—ˆ๋Š”๋ฐ, ๋ฆฌํŒฉํ† ๋ง์„ ํ•˜๋‹ค๋ณด๋‹ˆ ์—ฌ๋Ÿฌ์žฅ ๊ฒŒ์‹œํ•  ์ˆ˜ ์—†๋Š” ๋ถˆํŽธํ•จ์ด ์žˆ์–ด์„œ ๋ถ€ํŠธ์ŠคํŠธ๋žฉ์˜ carousel์„ ์ ์šฉ์‹œ์ผฐ๋‹ค.

๐Ÿงฉ ์ ์šฉ์˜ˆ์‹œ

<div id="carouselExampleControls" class="carousel slide" data-ride="carousel" data-interval="false">
                <div class="carousel-inner">
                    <div class="carousel-item active">
                        <img class="feed-img"
                             src="https://images.mypetlife.co.kr/content/uploads/2021/10/22152410/IMG_2087-scaled-e1634883900174-1024x739.jpg"
                             class="d-block w-100" alt="...">
                    </div>
                    <div class="carousel-item">
                        <img class="feed-img"
                             src="http://www.songjs.com/files/attach/images/1800/667/459/7b1715231faf21abeca83cdfae628c78.jpg"
                             class="d-block w-100" alt="...">
                    </div>
                    <div class="carousel-item">
                        <img class="feed-img"
                             src="https://images.mypetlife.co.kr/content/uploads/2021/12/06142637/sehee-park-473fli-b_Mo-unsplash-scaled-768x1024-2-edited.jpg"
                             class="d-block w-100" alt="...">
                    </div>
                </div>
                <a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
                    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                    <span class="sr-only">Previous</span>
                </a>
                <a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
                    <span class="carousel-control-next-icon" aria-hidden="true"></span>
                    <span class="sr-only">Next</span>
                </a>
            </div>

๐Ÿšซ ์—ฌ๊ธฐ์„œ ์ƒ๊ธด ๋ฌธ์ œ๊ฐ€ ํ•œ ๊ฐ€์ง€ ์žˆ์—ˆ๋‹ค.

๋ฐ”๋กœ ์‚ฌ์ง„์„ ์—ฌ๋Ÿฌ์žฅ ๊ฒŒ์‹œํ–ˆ์„๋•Œ ์ž๋™์œผ๋กœ carousel์ด ๋„˜์–ด๊ฐ€๋ฒ„๋ฆฌ๋Š” ๊ฒƒ์ด๋‹ค. ๋”ฐ๋ผ์„œ data-interval="false" ์†์„ฑ์„ ์ด์šฉํ•ด์„œ ์ž๋™์œผ๋กœ ์‚ฌ์ง„์ด ๋„˜์–ด๊ฐ€๋Š” ๊ฒƒ์„ ๋ฐฉ์ง€ํ•˜๊ณ  ์˜ค๋กœ์ง€ ๋‹ค์Œ ํ™”์‚ดํ‘œ๋ฅผ ๋ˆŒ๋ €์„๋•Œ ๋„˜์–ด๊ฐˆ ์ˆ˜ ์žˆ๋„๋ก ์กฐ์ •ํ•˜์˜€๋‹ค.

  • ๋ถ€ํŠธ์ŠคํŠธ๋žฉ modal์„ ์ด์šฉํ•˜์—ฌ ํŠน์ •๋ถ€๋ถ„ ํด๋ฆญ์‹œ modal ๋„์šฐ๊ธฐ

์•„๋ž˜๋ชจ์–‘์˜ ๋ถ€ํŠธ์ŠคํŠธ๋žฉ modal์„ ์ด์šฉํ•˜์˜€๊ณ ,

๐Ÿงฉ ์ ์šฉ์˜ˆ์‹œ

<!-- ํ”ผ๋“œ๋ฐ•์Šค ์šฐ์ธก์ƒ๋‹จ ...๋ฒ„ํŠผ-->
                <div class="dotdotdot">
                    <button type="button"
                            style="margin: auto; color: black; height: 30px; background-color: transparent; border: 0px;"
                            class="btn btn-primary" data-toggle="modal"
                            data-target="#exampleModal">
                        <span class="material-symbols-outlined" style="cursor: pointer; padding-bottom: 30px;">more_horiz</span>
                    </button>
                </div>
                <!-- Modal -->
                <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog"
                     aria-labelledby="exampleModalLabel"
                     aria-hidden="true">
                    <div class="modal-dialog" style="background-color: transparent" role="document">
                        <div class="modal-body" style="padding-top: 300px;">
                            <button type="button"
                                    style="border:1px solid lightgrey ; width: 410px; height: 50px; color: crimson; border-top-left-radius: 20px; border-top-right-radius: 20px;">
                                <b>์‹ ๊ณ </b></button>
                            <button type="button"
                                    style="border:1px solid lightgrey ; width: 410px; height: 50px;color: crimson;">
                                <b>ํŒ”๋กœ์šฐ ์ทจ์†Œ</b></button>
                            <button type="button" style="border:1px solid lightgrey ; width: 410px; height: 50px;">
                                ๊ฒŒ์‹œ๋ฌผ๋กœ ์ด๋™
                            </button>
                            <button type="button" style="border:1px solid lightgrey ; width: 410px; height: 50px;">
                                ๊ณต์œ  ๋Œ€์ƒ...
                            </button>
                            <button type="button" style="border:1px solid lightgrey ; width: 410px; height: 50px;">
                                ๋งํฌ ๋ณต์‚ฌ
                            </button>
                            <button type="button" style="border:1px solid lightgrey ; width: 410px; height: 50px;">
                                ํผ๊ฐ€๊ธฐ
                            </button>
                            <button type="button"
                                    style="border:1px solid lightgrey ; width: 410px; height: 50px; border-bottom-left-radius: 20px; border-bottom-right-radius: 20px;">
                                ์ทจ์†Œ
                            </button>
                        </div>
                    </div>
                </div>

์œ„์˜ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜์—ฌ ์•„๋ž˜์™€ ๊ฐ™์ด ๊ธฐ๋ณธ modal์„ ์ˆ˜์ •ํ–ˆ๋‹ค.

โœจ ๋‚ด๊ฐ€ ๊ตฌํ˜„ํ•œ ๊ธฐ๋Šฅ

  1. ์ขŒ์ชฝ ์ƒ๋‹จ ๋กœ๊ณ  (ํด๋ฆญ์‹œ ์ƒˆ๋กœ๊ณ ์นจ๊ธฐ๋Šฅ)
  2. ๊ฒ€์ƒ‰์–ด๋ฅผ ์ž…๋ ฅํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒ€์ƒ‰์ฐฝ
  3. ...๋ฒ„ํŠผ ํด๋ฆญ์‹œ ๋ชจ๋‹ฌ๋“ฑ์žฅ
  4. carousel์„ ์ด์šฉํ•ด ์‚ฌ์ง„ ์—ฌ๋Ÿฌ์žฅ ํ‘œ์‹œ
  5. ๋Œ“๊ธ€์ž…๋ ฅ์ฐฝ ์ถ”๊ฐ€
  6. ์ƒ๋‹จ navbar์™€ ์šฐ์ธก ๋„ค์ž„์นด๋“œ๋ฆฌ์ŠคํŠธ ๋ฐ footer ๊ณ ์ •ํ•˜์—ฌ ์Šคํฌ๋กค์‹œ ์›€์ง์ด์ง€ ์•Š๊ฒŒ ์„ค์ •
  7. navbar ํ”„๋กœํ•„์ด๋ฏธ์ง€ ํด๋ฆญ์‹œ ๊ฐœ์ธ์ƒ์„ธํŽ˜์ด์ง€๋กœ ์ด๋™
  8. favicon๊ธฐ๋Šฅ์ถ”๊ฐ€
  9. ๋ฏธ๋””์–ด์ฟผ๋ฆฌ ์ ์šฉํ•˜์—ฌ ๋ชจ๋ฐ”์ผํ™”๋ฉด์‹œ ํ™”๋ฉดํฌ๊ธฐ์กฐ์ •

๐Ÿ‘€ ๊ธฐ๋Šฅ๊ตฌํ˜„ ๋™์˜์ƒ

์•„๋ž˜ ์ด๋ฏธ์ง€ ํด๋ฆญ์‹œ ์œ ํŠœ๋ธŒ๋งํฌ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.
IMAGE ALT TEXT HERE

๐ŸŒฑ ๋Š๋‚€ ์ 

ํ™•์‹คํžˆ ๊ฐœ์ธํ”„๋กœ์ ํŠธ๋ฅผ ํ• ๋•Œ๋Š” ํŒ€์›๋“ค์—๊ฒŒ ๋ฏผํ๋ฅผ ๋ผ์น ์ˆ˜์—†๋‹ค!๋Š” ์••๋ฐ•๊ฐ์ด ์—†์–ด์„œ์ธ์ง€ ์‹ฌ์ ์œผ๋กœ ์—ฌ์œ ๋กœ์› ๋‹ค. ํ•˜์ง€๋งŒ ์—ญ์‹œ ํ”„๋กœ์ ํŠธ๋Š” ํŒ€์›์ด ๊ฐ™์ดํ• ๋•Œ๊ฐ€ ๋” ์žฌ๋ฐŒ๋Š”๊ฒƒ๊ฐ™๋‹ค.๐Ÿ˜†
ํ”„๋ก ํŠธ๊ฐœ๋ฐœ๊ฐ™์€ ๊ฒฝ์šฐ์—๋Š” ์—ฌ๋Ÿฌ๊ฐ€์ง€ ์‹œํ–‰์ฐฉ์˜ค๋ฅผ ๊ฑฐ์ณ์•ผํ•˜๊ธฐ๋•Œ๋ฌธ์— ์‹œ๊ฐ„์ด ์˜ค๋ž˜๊ฑธ๋ฆฌ๊ธฐ๋Š”ํ•˜์ง€๋งŒ ๋‚ด ํž˜์œผ๋กœ ๊ฐ€์น˜์žˆ๋Š” ๋ฌด์–ธ๊ฐ€๋ฅผ ๋งŒ๋“ค์–ด๋‚ธ๋‹ค๋Š” ๋Š๋‚Œ์€ ์ •๋ง ์ข‹์•„์„œ ํ•˜๋ฃจ์ข…์ผ ์˜์ž์— ์—‰๋ฉ์ด๋ฅผ ๋ถ™์ด๊ณ  ์•‰์•„์žˆ์–ด๋„ ํž˜์ด ๋‚˜๋Š” ๊ฒƒ ๊ฐ™๋‹ค.

๐ŸŽ ์ž์„ธํ•œ ์ฝ”๋“œ๋Š” Moonmoo ์— ๊ฒŒ์‹œํ–ˆ์Šต๋‹ˆ๋‹ค

profile
ํ•˜๋ฃจ ํ•œ๊ฑธ์Œ์”ฉ ๊พธ์ค€ํžˆ ๋‚˜์•„๊ฐ€๋Š” ๊ฐœ๋ฐœ์ž๐Ÿ™†โ€โ™€๏ธ https://github.com/Moonmooj

4๊ฐœ์˜ ๋Œ“๊ธ€

comment-user-thumbnail
2022๋…„ 4์›” 30์ผ

ํ•ญ์ƒ ๊ทน๋ฝํ•ด๋‚ด์‹œ๋Š” ๋ช…์ฃผ๋‹˜
๋‚จ๊ณผ ๋น„๊ตํ•˜์ง€๋ง์ž๊ฐ€ ์™€๋‹ฟ์Šต๋‹ˆ๋‹ค ใ…Žใ…Ž
2์ฃผ๋™์•ˆ ๊ณ ์ƒํ•˜์…ง์–ด์š” ใ…œใ…  ํ‘น์‰ฌ์‹œ๊ณ  ๋‹ด์ฃผ์— ๋ด์š”!

1๊ฐœ์˜ ๋‹ต๊ธ€
comment-user-thumbnail
2022๋…„ 5์›” 4์ผ

์•ˆ๋…•ํ•˜์„ธ์š” ์˜์ฃผ๋‹˜, ๊น€์ค€ํƒœ ํŠœํ„ฐ์ž…๋‹ˆ๋‹ค!
์ฝ”๋“œ๋ฅผ ์‚ดํŽด๋ณด์•˜๋Š”๋ฐ์š”, ๋ช‡ ๊ฐ€์ง€ ๋ถ€๋ถ„๋งŒ ๋ณด์™„ํ•˜์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  1. css, js ๋ถ€๋ถ„์€ ๋‹ค๋ฅธ ํŒŒ์ผ๋กœ ๋ถ„๋ฆฌํ•ด๋†“๊ณ  ๋ถˆ๋Ÿฌ์™€์„œ ์‚ฌ์šฉํ•˜๋Š” ํ˜•ํƒœ๋กœ ์ž‘์„ฑํ•˜์‹ ๋‹ค๋ฉด ๋” ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. (์ฝ”๋“œ ๊ฐ€๋…์„ฑ ๋ฐ ๊ด€๋ฆฌ๋ฅผ ์œ„ํ•ด์„œ์š”!)
  2. html ํƒœ๊ทธ ๋‚ด๋ถ€์—๋‹ค๊ฐ€ style="" ์ด๋ ‡๊ฒŒ ์ž‘์„ฑํ•˜์‹œ๋Š”๊ฑด ์ง€์–‘ํ•˜์‹œ๋Š”๊ฒŒ ์ข‹์Šต๋‹ˆ๋‹ค! ์ž‘์„ฑํ•  ๋•Œ๋Š” ๋‹น์žฅ ํŽธํ•œ๋ฐ์š”, ํ”„๋กœ์ ํŠธ๊ฐ€ ์ปค์ง€๊ฒŒ ๋˜๋ฉด ๊ด€๋ฆฌํ•˜๊ธฐ๊ฐ€ ์–ด๋ ค์›Œ ์ง‘๋‹ˆ๋‹ค.
  3. ํด๋ž˜์Šค ์ด๋ฆ„๋„ dotdotdot ๊ฐ™์€ ์ด๋ฆ„๋ณด๋‹ค๋Š” ๊ธฐ๋Šฅ์ ์ธ ์ธก๋ฉด์—์„œ ์ƒ๊ฐํ•ด์„œ ์ž‘์„ฑํ•˜์‹œ๋ฉด ๋”์šฑ ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!

์ด์™ธ์—๋Š” ์ž˜ ์ž‘์„ฑํ•˜์…จ์Šต๋‹ˆ๋‹ค. ์ˆ˜๊ณ ๋งŽ์œผ์…จ์–ด์š”!

1๊ฐœ์˜ ๋‹ต๊ธ€

๊ด€๋ จ ์ฑ„์šฉ ์ •๋ณด