-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
117 lines (98 loc) · 3.79 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
require 'vendor/autoload.php';
date_default_timezone_set('UTC');
use Carbon\Carbon;
?>
<!DOCTYPE html>
<html>
<head>
<title>ColdHam Hall Tide Viewer</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap core CSS -->
<link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"
media="screen">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="http://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
<![endif]-->
<style>
.image-container {
position: relative;
width: 1240px;
height: 700px;
}
.image-container .after {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: block;
color: #FFF;
}
#currentTideImage {
opacity: 0.5;
filter: alpha(opacity=50);
<?php if(Carbon::now()->hour < 10){?> margin-left: 341px;
<?php }else{?> margin-left: 62px;
<?php }?> margin-top: -21px;
width: 617px;
height: 727px;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-4">
<a href="/clock.php" class="btn btn-success">Clock</a>
</div>
</div>
<div class="row">
<div class="image-container col-lg-10">
<img src="http://www.ntslf.org/files/surgeforecast/ntslf_lowestoft.1.1.png?time=<?php echo time(); ?>"
alt="" width="1240px">
<div class="after">
<img src="http://www.ntslf.org/files/ntslf_php/pltdata_tgi.php?port=Lowestoft&span=1" alt=""
id="currentTideImage"/></div>
</div>
<div class="col-lg-2">
<img src="" alt="" id="weatherImage" width="400px" style="margin-top: 100px">
</div>
</div>
<div class="" style=' margin-left: 67px; z-index: 100; width: 100% '>
<?php
$start = -1;
if (Carbon::now()->hour < 10) {
$start = -2;
}
for ($i = -2; $i < 3; $i++) {
$hour = 0;
for ($j = 1; $j < 4; $j++) {
?><img src="http://chart-1.msw.ms/gfs/<?php echo (new Carbon())->addDay(($i < 0 ? $i : 0))
->format('Ymd') ?>00/750/1-<?php echo (new Carbon())->addDay($i)
->hour($hour * 4)
->minute(0)
->second(0)->timestamp ?>-4.gif"
alt="" width='92px' class="weather"/>
<?php
$hour += 3;
}
}
?>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script>
$(function () {
$('.weather').hover(function () {
$('#weatherImage').attr('src', ($(this).attr('src')))
})
})
</script>
</body>
</html>