popular.html 4.13 KB

<html>
    <head>
        <link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
        <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
        <!------ Include the above in your HEAD tag ---------->


        <style>
            #search input[type="text"] {
                background: url(search-white.png) no-repeat 10px 6px #fcfcfc;
                border: 1px solid #d1d1d1;
                font: bold 12px Arial,Helvetica,Sans-serif;
                color: #bebebe;
                width: 150px;
                padding: 6px 15px 6px 35px;
                -webkit-border-radius: 20px;
                -moz-border-radius: 20px;
                border-radius: 20px;
                text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
                -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
                -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
                box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
                -webkit-transition: all 0.7s ease 0s;
                -moz-transition: all 0.7s ease 0s;
                -o-transition: all 0.7s ease 0s;
                transition: all 0.7s ease 0s;
                }

            #search input[type="text"]:focus {
                width: 200px;
            }

            #search input[type="text"]:focus {
                width: 200px;
            }
            ul.timeline {
                list-style-type: none;
                position: relative;
            }
            ul.timeline:before {
                content: ' ';
                background: #d4d9df;
                display: inline-block;
                position: absolute;
                left: 29px;
                width: 2px;
                height: 100%;
                z-index: 400;
            }
            ul.timeline > li {
                margin: 20px 0;
                padding-left: 20px;
            }
            ul.timeline > li:before {
                content: ' ';
                background: white;
                display: inline-block;
                position: absolute;
                border-radius: 50%;
                border: 3px solid #22c0e8;
                left: 20px;
                width: 20px;
                height: 20px;
                z-index: 400;
            }
        </style>
    </head> 


<body>
    <!--핫한 글들 출력-->
    <div class="container mt-5 mb-5">
        <div class="row">
            <div class="col-md-6 offset-md-3">
                <h4 style="color:rgb(46, 7, 7); font-weight: bold;">HOT</h4>
                <ul class="Timeline">
                    <% for (var i=0; i<20; i++){ %>
                    <li>
                        <h5 style="color: gold; font-weight: bold;"><%= i + 1 %>위!</h5>
                        <% if(timeline[i].hasOwnProperty('retweeted_status')) { %> <!--내가 다른사람 글을 리트윗한거면 원글을 쓴 사람 닉네임 출력-->
                            <a style ="font-weight: bold;" target="_blank" href=><%= timeline[i].retweeted_status.user.name %></a>
                            <% } else { %> <!--아니면 내 닉네임-->
                                <a style ="font-weight: bold;" target="_blank" href=><%= timeline[i].user.name %></a>
                            <% } %>

                        <a href="#" class="float-right"><%= timeline[i].created_at %></a>

                        <p><%=timeline[i].text%></p>

                        <% if(timeline[i].hasOwnProperty('extended_entities')) { %> <!--미디어가 존재하면 출력-->
                            <img alt="Web Studio" class="img-fluid" width="300" height="300" src= <%= timeline[i].extended_entities.media[0].media_url_https %> />
                            <% } %>

                        <p style="color: #22c0e8;">리트윗: <%= timeline[i].retweet_count %> 마음에 들어요: <%= timeline[i].favorite_count%></p>     
                    </li>
                    <% } %>
                   
                </ul>
            </div>
        </div>
    </div>


</body>
</html>