-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
95 lines (90 loc) · 3.02 KB
/
index.html
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
<html>
<title>해루시계 (크기조절:더블클릭/기준:PC시간)</title>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<style>
@font-face {
font-family: 'DS-Digital';
src: url(font/DS-DIGIB.woff) format("woff"),
url(font/DS-DIGIB.ttf) format("ttf")
}
html {
font-size: 62.5%;
-ms-transition: .15s;
-moz-transition: .15s;
-khtml-transition: .15s;
-webkit-transition: .15s;
transition: .15s;
}
div {
-ms-user-select: none;
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
user-select: none
}
#clock {
width: 100%;
background: rgba(0, 0, 0, 0);
color: #fff;
font-family: 'DS-Digital';
font-size: 2.4rem;
text-align:left;
vertical-align: middle;
text-shadow: 0 0 .3rem #000;
cursor: move
}
</style>
<script>
function printClock() {
$('body').css('background', 'transparent')
var clock = document.getElementById("clock");
var currentDate = new Date();
var currentHours = addZeros(currentDate.getHours(), 2);
var currentMinute = addZeros(currentDate.getMinutes(), 2);
var currentSeconds = addZeros(currentDate.getSeconds(), 2);
clock.innerHTML = currentHours + ":" + currentMinute + ":" + currentSeconds;
setTimeout("printClock()", 1000);
}
function addZeros(num, digit) {
var zero = '';
num = num.toString();
if (num.length < digit) {
for (i = 0; i < digit - num.length; i++) {
zero += '0';
}
}
return zero + num;
}
window.onload = function () {
printClock();
}
function sizeClock(flag) {
var size = {
1: 62.5,
2: 75,
3: 100,
4: 125,
5: 150,
6: 175,
7: 200,
8: 225,
9: 250,
10: 300
}
if (!localStorage.getItem('size'))
localStorage.setItem('size', 1);
if (flag == 1) {
if (localStorage.getItem('size') == 10)
localStorage.setItem('size', 1);
else
localStorage.setItem('size', parseInt(localStorage.getItem('size')) + 1);
}
$('html').css('font-size', size[localStorage.getItem('size')] + '%');
}
</script>
</head>
<body onload="printClock(); sizeClock(0)">
<div id="clock" ondblclick="sizeClock(1)"></div>
</body>
</html>