<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>Laravel</title>

        <!-- Fonts -->
        <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@200;600&display=swap" rel="stylesheet">

        <!-- Styles -->
        <style>
            html, body {
                background-color: #fff;
                color: #636b6f;
                font-family: 'Nunito', sans-serif;
                font-weight: 200;
                margin: 0;
            }

            .full-height {
            }

            .flex-center {
                align-items: center;
                display: flex;
                justify-content: center;
            }

            .position-ref {
                position: relative;
            }

            .top-right {
                position: absolute;
                right: 10px;
                top: 18px;
            }

            .content {
                text-align: center;
                width: 90%;
            }

            .title {
                font-size: 84px;
            }

            .links > a {
                color: #636b6f;
                padding: 0 25px;
                font-size: 13px;
                font-weight: 600;
                letter-spacing: .1rem;
                text-decoration: none;
                text-transform: uppercase;
            }

            .m-b-md {
                margin-bottom: 30px;
            }
        </style>

        
        <script src="{{ asset('js/app.js') }}" defer></script>
        <link href="{{ asset('css/app.css') }}" rel="stylesheet">

    </head>
    <body>
        <div class="flex-center position-ref full-height">
            @if (Route::has('login'))
                <div class="top-right links">
                    @auth
                        <a href="{{ url('/home') }}">Home</a>
                    @else
                        <a href="{{ route('login') }}">Login</a>

                        @if (Route::has('register'))
                            <a href="{{ route('register') }}">Register</a>
                        @endif
                    @endauth
                </div>
            @endif

            <div class="content">
                <div class="title m-b-md">
                    Teplomer balkón
                </div>
  
                <div id="app">
                    <div class="row">
                        <vue-thermometer class="justify-content-center col-sm-3" :value="temperature" :min="tmin" :max="tmax"></vue-thermometer>
                        <div class="col-sm-9" id="values">
                            <vue-table-dynamic :params="params"></vue-table-dynamic>
                            <ul>
                                <li>Čas: @{{time}}</li>
                            </ul>
                            <div class="row justify-content-center">
                                <div class="form-group col-sm-6">
                                    <div class='input-group time' id='datetimepicker1'>
                                        <datetime type="datetime" input-class="form-control" placeholder="Od" v-model="startdate"></datetime>    
                                        <span class="input-group-append">
                                            <span class="input-group-text"><i class="fa fa-calendar"></i></span>
                                        </span>       
                                    </div>
                                </div>
        
                                <div class="form-group col-sm-6">
                                    <div class='input-group time' id='datetimepicker2'>
                                        <datetime type="datetime" input-class="form-control" placeholder="Do" v-model="enddate"></datetime>
                                        <span class="input-group-append">
                                            <span class="input-group-text"><i class="fa fa-calendar"></i></span>
                                        </span>
                                        <span class="input-group-append">
                                            <button v-on:click="displayResults()" type="button" class="btn btn-secondary">Zobraz</button>
                                        </span>          
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <dygraphs ref="dgt" :graph-data="series['temperature']" :graph-options="options['temperature']"></dygraphs>
                    <stats-table :data="series['temperature']" :key="componentKey"></stats-table>
                    <dygraphs ref="dgh" :graph-data="series['humidity']" :graph-options="options['humidity']"></dygraphs>
                    <stats-table :data="series['humidity']" :key="componentKey"></stats-table>
                    <dygraphs ref="dgp" :graph-data="series['pressure']" :graph-options="options['pressure']"></dygraphs>
                    <stats-table :data="series['pressure']" :key="componentKey"></stats-table>
                
                </div> 
                
            </div>
        </div>
        
        <script>
 
        </script>
    </body>
</html>
