2주차 숙제 - 실시간 날씨정보 넣기

2022. 11. 29. 01:45웹개발 메모장

728x90
SMALL

 

2주차 강의부터 어렵다 😭
한번 들을 때마다 강의를 3번은 돌려보는거 같은데

이해력이 부족한건가ㅠㅠ 

 

이전 숙제에서 mytitle 부분에

실시간 날씨 넣었다.

 

 

<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<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>스파르타코딩클럽 | 1주차 숙제</title>
    <link href="https://fonts.googleapis.com/css2?family=Dongle&display=swap" rel="stylesheet">


    <style>
        * {
            font-family: 'Dongle', sans-serif;
        }

        .mytitle {

            width: 100%;
            height: 250px;

            color: white;

            background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQzDdooKtxOuQ9JWaa-JMBJEPo4gni8lWhl0Q&usqp=CAU");
            background-size: cover 30%;
            background-position: center 20%;

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

        }
        .mypost {
            max-width: 400px;
            width: 95%;
            height: 260px;
            margin: 20px auto 0px auto;
            padding: 10px;
            border-radius: 10px;

            box-shadow: 0px 0px 3px 0.5px gray;


        }


        .card {
            max-width: 400px;
            width: 95%;
            margin: 20px auto 0px auto;
            padding: 10px;
            border-radius: 10px;

        }








    </style>
     <script>
        function hey() {
            alert('응원 감사합니다!')
        }

        $(document).ready(function () {

            $.ajax({
                type: "GET",
                url: "http://spartacodingclub.shop/sparta_api/weather/seoul",
                data: {},
                success: function (response) {
                    // let url = response['url']
                    // let msg = response['msg']
                    //
                    // $('#img-rtan').attr('src',url)
                    // $('#text-rtan').test(msg)
                    $('#temp').text(response['temp'])


                }
            })
        });

    </script>
</head>

<body>

    <div class="mytitle">
        <h1>박효신 팬명록😘</h1>
        <p>서울 현재기온 : <span id="temp">00.0도</span></p>
    </div>

    <div class="mypost">
        <div class="form-floating mb-3">
            <input type="email" class="form-control" id="floatingInput" placeholder="name@example.com">
            <label for="floatingInput">닉네임</label>
        </div>

        <div class="form-floating">
            <textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2"
                      style="height: 100px"></textarea>
            <label for="floatingTextarea2">응원댓글</label>
        </div>
        <p></p>


        <button onclick="hey()" type="button" class="btn btn-dark">응원 남기기</button>


    </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>

    <div class="card">
        <div class="card-body">
            <blockquote class="blockquote mb-0">
                <p>새로운 앨범 너무 멋져요!</p>
                <footer class="blockquote-footer">호빵맨
                </footer>
            </blockquote>
        </div>
    </div>


</body>

</html>

강의를 다시 들어도 혼자서 하라고 하면 못하겠다.ㅠㅠ

1주차때까지는 스스로 생각하고 해봤는데

2주차부터는 아무것도 못해서 결국 강사님 하는거 보고 따라했다.

갈수록 어려워진다는 본강의 늦춰야하나 고민중이다😭

 

 

728x90
LIST

'웹개발 메모장' 카테고리의 다른 글

4주차 숙제  (0) 2022.12.04
3주차 강의 - 파이썬 / 크롤링 / mongoDB  (0) 2022.12.03
프론트엔드와 백엔드 차이점  (0) 2022.11.30
2주차 9강 따릉이 실시간 체크 jQuery와 Ajax  (0) 2022.11.28
항해 준비중  (0) 2022.11.25