커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
시간이 안떠요..
undefined주차
북마크
모*혜
댓글
4
추천
0
조회수
17
조회수
17
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


무엇이 문제일까요..






<!DOCTYPE html>

<html lang="en">


<head>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery.min.js"></script>



    <title>나만의 동기부여 홈화면 만들기</title>



    <script>

        $(document).ready(function () {



            renderCurrentTime();

            renderQuote();

        });


        function renderCurrentTime() {


            let url = `https://worldtimeapi.org/api/timezone/Asia/Seoul`;


            fetch(url)


                .then(res => res.json()).then((data) => {


                    let datetime = data['datetime'].substr(11, 5);


                    $('#time').text(datetime);


                });


        }


        function renderQuote() {


            let url = `https://api.quotable.io/random`;


            fetch(url)


                .then(res => res.json()).then((data) => {


                    let content = `" ${data['content']} "`;


                    let author = `- ${data['author']} -`;


                    $('#content').text(content);


                    $('#author').text(author);


                });


        }


    </script>


    <style>

        @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500&display=swap');


        * {

            font-family: 'Poppins', sans-serif;

        }


        body {

            background-image: url("https://www.urbanbrush.net/web/wp-content/uploads/edd/2021/02/urbanbrush-20210203212519588818.jpg");

            background-position: center;

            color: black;

        }


        .time {

            font-size: 100px;

            font-weight: 200;

        }


        .greeting {

            font-size: 60px;

        }


        .todo {

            font-size: 40px;

        }


        .author {

            font-size: 20px;

            font-style: italic;

        }


        .content {

            font-size: 30px;

        }


        .test {

            font-size: 30px;

        }


        .main {

            width: 100vw;

            height: 80vh;


            display: flex;

            flex-direction: column;

            align-items: center;

            justify-content: center;

        }


        .quote {

            width: 100vw;

            height: 20vh;


            display: flex;

            flex-direction: column;

            align-items: center;

            justify-content: center;

        }

    </style>


    <script>

    </script>

</head>


<body>

    <div class="main">

        <div id="time" class="time">00:00</div>

        <div class="greeting">hellow. seonghye</div>

        <div class="todo">코딩 배우기.</div>

    </div>

    <div class="quote">

        <div class="author">-명언의 저자-</div>

        <div class="content">" 명언의 내용 "</div>

    </div>

</body>


</html>



취소
 공유
취소
댓글 0
댓글 알림
나의얼굴