AfterLogin_Outputpage.html 3.94 KB
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Input Page</title>
    <script src="jquery.js"></script>
    <script>

       //openWeatherapi

       
    var apiURI = "http://api.openweathermap.org/data/2.5/weather?q=Seoul&appid=afea3779ccf698668f89764635ac580f";
        $.ajax({
            url: apiURI,
            dataType: "json",
            type: "GET",
            async: "false",
            success: function(resp) {
                console.log(resp);
                console.log("현재온도 : "+ (resp.main.temp- 273.15) );
                $("#w3").append( (resp.main.temp- 273.15) + " ℃" );
                console.log("현재습도 : "+ resp.main.humidity);
                console.log("날씨 : "+ resp.weather[0].main );
                $("#w2").append( resp.weather[0].main );
                console.log("상세날씨설명 : "+ resp.weather[0].description );
                $("#w4").append( resp.weather[0].description );
                //console.log("날씨 이미지 : "+ resp.weather[0].icon );
                console.log("바람   : "+ resp.wind.speed + "m/s");
                $("#w5").append( resp.wind.speed + "m/s" );
                console.log("나라   : "+ resp.sys.country );
                console.log("도시이름  : "+ resp.name );
                $("#w1").append( resp.name );
                console.log("구름  : "+ (resp.clouds.all) +"%" );
                $("#w6").append( (resp.clouds.all) +"%" );                 
            }
        })
    
    
    </script>
    <style>

    #banner {
            position: absolute;
            top: 0;
            width: 100%;
            margin-top: 5ch;
            color: white;
        }
    
    #footer {
            position: absolute;
            bottom: 0;
            width: 100%;
            height: 50px;
            text-align: center;
            color: white;
        }

    #logout{
        position:absolute;
        right: 20ch;
    }

    #section{
        position: absolute;
        margin-left:5%;
        float:left;
        width: 40%;
        height: 90%;
    }
   
   #container1{
       float: left;
       border: 1px solid white;
       width: 100%;
       height: 120%;
   }
   #container2{
       float: left;       
       border: 1px solid white;
       background-color: rgb(102, 219, 180);
       font-weight: bold;
       width: 100%;
       height: 120%;
   }
   #container3{
       float: right;
       border: 1px solid white;
       margin-right:5%;
       width: 40%;
       height: 200%;
      
   }

    
    </style>
</head>
<body>

    <img src = "images\main_background.jpg" alt="" style="z-index:-1; min-width: 100%; height: 700px;"></img>
    <div id="banner">      
        <h1 style="width: 100%; text-align: center; font-size: 40px;">오늘은 얼마나 먹었어요?</h1>
        <input id ="logout" type="submit" value="Logout" class="btn btn-default" style=" width:100px;font-weight: bold; font-size: 18px; background-color: white;">
    
    <br><br><br> 

    <div id="section">
        <div id="container1">container1</div>
        <br><br><br>

        <div id="container2" >
            <p style="margin-left: 10%">"Weather NOW"</p>
                <p id="w1" style="margin-left: 10%">도시 = </p>
                <p id="w3" style="margin-left: 10%">현재온도 = </p>
                <span id="w2" style="margin-left: 10%">현재날씨 = </span>
                <span id="w4" style="margin-left: 10%">날씨상세 = </span>    
                <br><br>                            
                <span id="w5" style="margin-left: 10%">바람 = </span>
                <span id="w6" style="margin-left: 10%">구름 = </span>
        </div>
    </div>

    <div id="container3">container3</div>
    
    
    </div>

    <div id="footer">오픈소스SW Project 2019-1 고다경 김용재 김태희</div>
</body>
</html>