mirror of
https://github.com/KevinMidboe/homehub.git
synced 2025-10-29 17:40:26 +00:00
First com, added hmtl folder
This commit is contained in:
3
scripts/3minReload.js
Normal file
3
scripts/3minReload.js
Normal file
@@ -0,0 +1,3 @@
|
||||
setInterval(function() {
|
||||
window.location.reload();
|
||||
}, 300000);
|
||||
15
scripts/addWeatherInfo.js
Normal file
15
scripts/addWeatherInfo.js
Normal file
@@ -0,0 +1,15 @@
|
||||
var weatherData = [];
|
||||
$.get('weatherData.txt', function(data) {
|
||||
weatherData = data.split("\n");
|
||||
var elem = document.createElement("img");
|
||||
elem.setAttribute("src", 'images/' + weatherData[0] + '/' + weatherData[1]);
|
||||
elem.setAttribute("height", "180");
|
||||
elem.setAttribute("width", "180");
|
||||
elem.setAttribute("alt", weatherData[1]);
|
||||
document.getElementById("weatherImg").appendChild(elem);
|
||||
|
||||
document.getElementById("weatherTempValue").innerHTML = "<p class='weatherTitle' style='font-size: 30px;'>Temperatur</p><p class='weatherData' style='font-size: 35px;'>" + weatherData[2] + '°</p>';
|
||||
document.getElementById("weatherRainfall").innerHTML = "<p class='weatherTitle'>Nedbør</p><p class='weatherData'>" + weatherData[3] + '</p>';
|
||||
document.getElementById("weatherWind").innerHTML = "<p class='weatherTitle'>Vind</p><p class='weatherData'>" + weatherData[5] + '</p>';
|
||||
document.getElementById("weatherWindDirection").innerHTML = "<p class='weatherTitle'>Vind rettning</p><p class='weatherData'>" + weatherData[6] + '</p>';
|
||||
});
|
||||
28
scripts/cycleTimeplaner.js
Normal file
28
scripts/cycleTimeplaner.js
Normal file
@@ -0,0 +1,28 @@
|
||||
var imageIndex = 0;
|
||||
changeBanner();
|
||||
function changeBanner(){
|
||||
var img = [];
|
||||
|
||||
var timetableImages = document.getElementById('timetables');
|
||||
img[0] = timetableImages.getElementsByTagName('img')[0];
|
||||
img[1] = timetableImages.getElementsByTagName('img')[1];
|
||||
img[2] = timetableImages.getElementsByTagName('img')[2];
|
||||
|
||||
for (var i = 0; i < img.length; i++) {
|
||||
img[i].style.display = 'none';
|
||||
}
|
||||
img[imageIndex].style.display = 'block';
|
||||
var src = img[imageIndex].src;
|
||||
|
||||
if(src.indexOf('/') >= 0) {
|
||||
src = src.substring(src.lastIndexOf('/')+1);
|
||||
src = src.replace('.png', ' sin timeplan');
|
||||
document.getElementById('calTitle').innerHTML = src;
|
||||
}
|
||||
|
||||
if (imageIndex == img.length - 1) {
|
||||
imageIndex = 0;
|
||||
} else { imageIndex++; }
|
||||
}
|
||||
|
||||
setInterval('changeBanner()', 5000);
|
||||
31
scripts/timeDateDisplay.js
Normal file
31
scripts/timeDateDisplay.js
Normal file
@@ -0,0 +1,31 @@
|
||||
var weekday = new Array(7);
|
||||
weekday[0]= "Søndag";
|
||||
weekday[1] = "Mandag";
|
||||
weekday[2] = "Tirsdag";
|
||||
weekday[3] = "Onsdag";
|
||||
weekday[4] = "Torsdag";
|
||||
weekday[5] = "Fredag";
|
||||
weekday[6] = "Lørdag";
|
||||
|
||||
(function () {
|
||||
function checkTime(i) {
|
||||
return (i < 10) ? "0" + i : i;
|
||||
}
|
||||
|
||||
function startTime() {
|
||||
var today = new Date(),
|
||||
h = checkTime(today.getHours()),
|
||||
m = checkTime(today.getMinutes()),
|
||||
s = checkTime(today.getSeconds());
|
||||
dn = weekday[today.getDay()];
|
||||
d = checkTime(today.getDate());
|
||||
mon = checkTime(today.getMonth() + 1);
|
||||
y = checkTime(today.getFullYear());
|
||||
document.getElementById('currTime').innerHTML =
|
||||
"<p id='time'>" + h + ":" + m + ":" + s + "</p><p>" + dn + " " + d + "." + mon + "." + y + "</p>";
|
||||
t = setTimeout(function () {
|
||||
startTime()
|
||||
}, 500);
|
||||
}
|
||||
startTime();
|
||||
})();
|
||||
Reference in New Issue
Block a user