SW/JavaScript

ํŒฌ๋ช…๋ก ๋ฉ”์ธ ํŽ˜์ด์ง€

ahhyeon 2023. 3. 6. 23:54

๐Ÿ’ป ํŒฌ๋ช…๋ก ๋ฉ”์ธํŽ˜์ด์ง€ ๋งŒ๋“ค๊ธฐ

โœ”๏ธ๋ถ€ํŠธ์ŠคํŠธ๋žฉ ์‹œ์ž‘ ํ…œํ”Œ๋ฆฟ

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
          integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
            integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
            crossorigin="anonymous"></script>

    <title>ํŒฌํŽ˜์ด์ง€</title>

    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@200;300;400;500;600;700;900&display=swap"
          rel="stylesheet">
</head>

<body>
    <h1>๋‰ด์ง„์Šค(newjeans) ํŒฌ๋ช…๋ก</h1>
</body>

</html>

โœ”๏ธ๋ถ€ํŠธ์ŠคํŠธ๋žฉ ์ปดํฌ๋„ŒํŠธ 5.0

๐Ÿ’ก๋ถ€ํŠธ์ŠคํŠธ๋žฉ์˜ Card → Quote ์ด์šฉํ•˜๊ธฐ
 

Buttons

Use Bootstrap’s custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more.

getbootstrap.com

[1๋‹จ๊ณ„] ํƒ€์ดํ‹€ ๊ตฌํ˜„

<style>
        * {
            font-family: 'Noto Serif KR', serif;
        }

        body {
            background-color: rgb(155, 167, 175);
        }

        .mypic {
            width: 100%;
            height: 450px;

            background-image: linear-gradient(0deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.5)), url('https://dimg.donga.com/wps/NEWS/IMAGE/2023/01/05/117300894.2.jpg');
            background-position: center top;
            background-repeat: no-repeat;
            background-size: cover;

            color: white;

            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .mypost {
            width: 95%;
            max-width: 500px;
            margin: 20px auto 20px auto;
            background-color: #5a5a5a;
            box-shadow: 0px 0px 3px 0px rgb(115, 115, 115);
            padding: 20px;
        }

        .mypost > button {
            margin-top: 15px;
        }

        .mycards {
            width: 95%;
            max-width: 500px;
            margin: auto;
        }

        .mycards > .card {
            margin-top: 10px;
            margin-bottom: 10px;
        }
    </style>

[2๋‹จ๊ณ„] ์‘์›๋‚จ๊ธฐ๊ธฐ ํฌ์ŠคํŒ… ๊ตฌํ˜„

<div class="mypost">
    <div class="form-floating mb-3">
        <input type="text" class="form-control" id="name" placeholder="url">
        <label for="floatingInput">๋‹‰๋„ค์ž„</label>
    </div>
    <div class="form-floating">
<textarea class="form-control" placeholder="Leave a comment here" id="comment"
          style="height: 100px"></textarea>
        <label for="floatingTextarea2">์‘์›๋Œ“๊ธ€</label>
    </div>
    <button onclick="save_comment()" type="button" class="btn btn-dark">์‘์› ๋‚จ๊ธฐ๊ธฐ</button>
</div>

[3๋‹จ๊ณ„] ์‘์› ์นด๋“œ ๊ตฌํ˜„

<div class="mycards" id="comment-list">
    <div class="card">
        <div class="card-body">
            <blockquote class="blockquote mb-0">
                <p>์ƒˆ๋กœ์šด ์•จ๋ฒ” ๋„ˆ๋ฌด ๋ฉ‹์ ธ์š”!</p>
                <footer class="blockquote-footer">๋ฒ„๋‹ˆ์ฆˆ</footer>
            </blockquote>
        </div>
    </div>
    <div class="card">
        <div class="card-body">
            <blockquote class="blockquote mb-0">
                <p>์ƒˆ๋กœ์šด ์•จ๋ฒ” ๋„ˆ๋ฌด ๋ฉ‹์ ธ์š”!</p>
                <footer class="blockquote-footer">๋ฒ„๋‹ˆ์ฆˆ</footer>
            </blockquote>
        </div>
    </div>
    <div class="card">
        <div class="card-body">
            <blockquote class="blockquote mb-0">
                <p>์ƒˆ๋กœ์šด ์•จ๋ฒ” ๋„ˆ๋ฌด ๋ฉ‹์ ธ์š”!</p>
                <footer class="blockquote-footer">๋ฒ„๋‹ˆ์ฆˆ</footer>
            </blockquote>
        </div>
</div>

 

โญ ๊ธฐ๋Šฅ ์ถ”๊ฐ€

1. ์‹ค์‹œ๊ฐ„ ๋‚ ์”จ ์ •๋ณด 

๐Ÿ”๋‚ ์”จ API
http://spartacodingclub.shop/sparta_api/weather/seoul

 

  <script>
        $(document).ready(function() {
            $.ajax({
                type: "GET",
                url: "http://spartacodingclub.shop/sparta_api/weather/seoul",
                data: {},
                success: function (response) {
                    $('#temp').text(response['temp'])
                },
            });
        });

    </script>

 

[์™„์„ฑ]