-
Notifications
You must be signed in to change notification settings - Fork 0
/
homescript.js
106 lines (83 loc) · 3.09 KB
/
homescript.js
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
function updateTime() {
const now = new Date();
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
const timeString = `${hours}:${minutes}:${seconds}`;
document.getElementById('clock').textContent = timeString;
}
setInterval(updateTime, 1000);
let isDragging = false;
let startY = 0;
document.addEventListener('mousedown', (e) => {
isDragging = true;
startY = e.clientY;
});
document.addEventListener('mouseup', () => {
isDragging = false;
});
document.addEventListener('mousemove', (e) => {
if (isDragging) {
const deltaY = e.clientY - startY;
if (deltaY < -50) {
window.location.href = 'login.html'; // Hier kun je de link naar de ontgrendelpagina aanpassen
}
}
});
const arrow = document.getElementById('arrow');
function jumpArrow() {
arrow.style.transform = 'translateY(-10px)';
setTimeout(() => {
arrow.style.transform = 'translateY(0)';
}, 200); // Verkort de tijd naar 0.2 seconden
}
setInterval(jumpArrow, 3100);
document.addEventListener('DOMContentLoaded', function() {
var clock = document.getElementById('clock');
var date = document.getElementById('date');
var monthNames = [
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
];
function updateClock() {
var now = new Date();
var hours = now.getHours().toString().padStart(2, '0');
var minutes = now.getMinutes().toString().padStart(2, '0');
var seconds = now.getSeconds().toString().padStart(2, '0');
var day = now.getDate().toString().padStart(2, '0');
var month = monthNames[now.getMonth()]; // Gebruik de afkorting van de maand
var year = now.getFullYear();
clock.textContent = hours + ':' + minutes + ':' + seconds;
date.textContent = day + ' ' + month + ' ' + year;
}
updateClock();
setInterval(updateClock, 1000);
});
document.addEventListener('DOMContentLoaded', function() {
var clock = document.getElementById('clock');
var date = document.getElementById('date');
function updateClock() {
var now = new Date();
var hours = now.getHours().toString().padStart(2, '0');
var minutes = now.getMinutes().toString().padStart(2, '0');
var seconds = now.getSeconds().toString().padStart(2, '0');
var day = now.getDate().toString().padStart(2, '0');
var month = monthNames[now.getMonth()];
var year = now.getFullYear();
clock.textContent = hours + ':' + minutes + ':' + seconds;
date.textContent = day + ' ' + month + ' ' + year;
}
function loadSettings() {
var clockColor = localStorage.getItem('clockColor');
var dateColor = localStorage.getItem('dateColor');
if (clockColor) {
clock.style.color = clockColor;
}
if (dateColor) {
date.style.color = dateColor;
}
}
loadSettings();
updateClock();
setInterval(updateClock, 1000);
});