-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
132 lines (112 loc) · 6.04 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html>
<html lang="en"> <!-- Lang will be replaced by js -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Custom Clock</title>
<link rel="stylesheet" href="css/style.min.css">
<link rel="shortcut icon" href="logo.png" type="image/png">
<script>
window.addEventListener("DOMContentLoaded", function() {
let triggerIsNotClock = false;
if(window.self == window.top) {
if(window.navigator.userAgent.indexOf("itch/") > 10 || window.location.protocol.indexOf("itch-cave") > -1) {
// If using itch.io client, we need to run inside an iframe, because itch is buggy
triggerIsNotClock = true;
document.body.innerHTML = "<iframe src='index.html?isIframe=true&isItch=true' id='itchframe'></iframe>";
document.body.classList.add("hasiframe");
}
}
if(window.location.protocol.indexOf("http") > -1 && window.location.host.indexOf("itch.zone") > -1) {
// If embedded on Itch project page, display only the logo
triggerIsNotClock = true;
document.body.classList.add("logoonly");
document.body.innerHTML = `
<img src="logo.png" alt="">
`;
}
if(triggerIsNotClock) {
config.edit = false;
document.body.classList.remove("clock");
document.title = "Maingrons Custom Clock";
}
});
</script>
<script src="js/config.js"></script>
<script src="js/lang.js"></script>
</head>
<body class="clock">
<main id="main">
<div class="edittools">
<button class="trashbin" ondblclick="window.alert(lang.alert__resetting_clock ?? 'Resetting Clock, click Ok to proceed, close tab/window to abort'); reset();" title="Doubleclick to reset to default settings">🗑</button>
<button class="addblock" onclick="addBlock('block-fullclock')" title="Add new block">+</button> <!-- Save opposite value of config.edit (true -> false)-->
<button class="editpen" onclick="config.edit = !config.edit; saveConfig();window.location.reload()" title="Switch Edit/View mode">✎</button> <!-- Save opposite value of config.edit (true -> false)-->
</div>
<p id="dev-configvalue"></p>
</main>
<fieldset class="designer" id="designer" disabled="disabled">
<div>
<label for="designer-fontcolor"><lang>Font color</lang></label>
<input type="color" id="designer-fontcolor" onchange="designer('color', this.value)">
</div>
<div style="display: none;">
<label hidden for="designer-scale"><lang>Scaling</lang></label>
<input hidden type="number" min="0" max="8" id="designer-scale" onchange="designer('scale', this.value)">
</div>
<div>
<label for="designer-fontsize"><lang>Font Size (rem)</lang></label>
<input type="number" min="0" max="8" id="designer-fontsize" onchange="designer('fontsize', this.value + 'rem')">
</div>
<div>
<label for="designer-block"><lang>Block Type</lang></label>
<select id="designer-block" onchange="designer('block', this.value)">
</select>
</div>
</fieldset>
<!-- Template section -->
<template id="block-hours" description="lang.Displays the current Hour">
|hours|
</template>
<template id="block-minutes" description="lang.Displays the current Minute">
|minutes|
</template>
<template id="block-seconds" description="lang.Displays the current Second">
|seconds|
</template>
<template id="block-milliseconds" description="lang.Displays the current Millisecond">
|milliseconds|
</template>
<template id="block-fullclock" description="lang.Displays an entire Clock">
|hours|:|minutes|:|seconds|
</template>
<template id="block-timezoneName" description="lang.Displays the Name of your Timezone">
|timezoneName|
</template>
<template id="block-day" description="lang.Displays the current Day">
|day|
</template>
<template id="block-month" description="lang.Displays the current Month">
|month|
</template>
<template id="block-year" description="lang.Displays the current Year">
|year|
</template>
<template id="block-weekdayName" description="lang.Displays the Name of Today">
|weekdayName|
</template>
<template id="block-fulldate" description="lang.Displays the entire Date">
|block-year|-|block-month|-|block-day|
</template>
<template id="block-edit" class="ignore">
<div class="editdiv">
<button class="editbutton dragger" onmousedown="handleAction('drag', this.parentElement.parentElement, event)">↝</button>
<button class="editbutton resizer bigger" onclick="handleAction('resize', this.parentElement.parentElement, event)">+</button>
<button class="editbutton resizer smaller" onclick="handleAction('resize', this.parentElement.parentElement, event)">-</button>
<button class="editbutton designer" onclick="setDesigner(this.parentElement.parentElement)">✎</button>
<button class="editbutton remover" onclick="removeBlock(this.parentElement.parentElement)">x</button>
</div>
</template>
<script src="js/scripts.js"></script>
<!--<?php if(isset($clock_maingron_com_js1)){echo $clock_maingron_com_js1;}?>-->
</body>
</html>