-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomize.html
226 lines (213 loc) · 8.15 KB
/
customize.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="OLBgp1GsljhM2TJ+sbHjaiH9txEUvgdDTAzHv2P24donTt6/529l+9Ua0vFImLlb" crossorigin="anonymous">
<link rel="icon" type="image/png" sizes="32x32" href="https://gorzog.com/assets/favcon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="https://gorzog.com/assets/favcon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="https://gorzog.com/assets/favcon/favicon-16x16.png">
<meta property="og:title" content="OBS Web Timer">
<title>OBS Timer Builder</title>
<style>
body {
font-family: 'Montserrat', sans-serif;
margin: 0;
padding: 0;
background-color: #e4ecf4;
color: #192105;
line-height: 1.6; /* Adjust the line-height as needed */
}
header {
height: 80px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px 70px;
background-color: var(--bg-color);
}
.logo {
cursor: pointer;
color: var(--heading-color);
}
.wrapper {
text-align: center;
margin: 0;
padding: 40px;
background-color: #e4ecf4;
color: #192105;
line-height: 1.6; /* Adjust the line-height as needed */
}
.article {
background-color: #fff;
text-align: left;
border-radius: 15px;
padding: 30px;
margin: 30px auto;
max-width: 800px;
line-height: 1.6;
}
pre {
background-color: #f4f4f4;
padding: 10px;
border-radius: 5px;
white-space: pre-wrap;
}
.note {
background-color: #f4f4f4;
padding: 10px;
border-radius: 5px;
font-size: 0.8em;
}
.strings {
color: #d14;
background-color: #f4f4f4;
padding: 2px;
border-radius: 3px;
}
/* footer */
footer {
background-color: var(--bg-color);
/* position: fixed; */
left: 0;
bottom: 0;
width: 100%;
color: white;
text-align: center;
}
.mobile-foot {
display: none;
}
footer a {
color: #718ca0;
text-decoration: none;
margin: 1rem 0;
font-weight: 600;
text-transform: uppercase;
font-size: 44px;
letter-spacing: 1px;
transition: 0.20s;
}
footer a:hover {
color: #57b0f5;
}
.repo {
color: #192105;
}
.center-image {
display: block;
margin-left: auto;
margin-right: auto;
}
.center {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
@media (max-width: 1200px) {
.main-image {
width: 200px;
}
.wrapper {
padding: 0px;
}
.title {
display: none;
}
}
</style>
</head>
<header>
<h1 class="title">OBS Web Timer <a href="https://github.com/Vincenzo160/SimpleWebTimer"><i class="fa-brands fa-github repo"></i></a></h1>
</header>
<body>
<!-- home -->
<div class="wrapper">
<iframe id="preview" src="https://timer.gorzog.com" frameborder="0" style="background-color: #192105; border-radius: 15px;"></iframe>
<h3>Timer Preview</h3>
<div class="article">
<div class="center" style="background-color: #d6e2ed; border-radius: 15px;">
<h2>Customize</h2>
<label for="sec">Seconds:</label>
<input type="number" name="Seconds" id="sec" placeholder="0">
<label for="min">Minutes:</label>
<input type="number" name="Minutes" id="min" placeholder="1">
<label for="color">Color:</label>
<input type="color" name="color" id="color" value="#ffffff">
<br>
<label for="blink">Blink when completed?</label>
<input type="checkbox" name="Blink" id="blink" checked>
<br>
<button id="generate">Preview and Generate URL</button>
<br>
<div id="results" style="display: none;">
<label for="result">URL:</label>
<button id="copy"><i class="fa fa-copy"></i></button>
<input type="text" name="result" id="result" disabled value="https://timer.gorzog.com" style="width: 400px;">
</div>
</div>
<h2 id="parameters">Parameters</h2>
<p>You can use URL parameters to customize the timer. The following parameters are available:</p>
<ul>
<li><code class="strings">sec</code>: Seconds (will override <code class="strings">min</code>).</li>
<li><code class="strings">min</code>: Minutes.</li>
<li><code class="strings">color</code>: Hex color code for the timer.</li>
<li><code class="strings">blink</code>: Make the timer blink when it has ended.</li>
</ul>
<p>For example the URL of a 3 minute and 51 second timer that doesn't blink will look like this: <code class="strings">https://timer.gorzog.com?sec=231&blink=false</code></p>
<h2>Installation</h2>
<p>Simply copy the generated URL and paste it into a browser source in OBS.</p>
<img src="https://gorzog.com/assets/timer/properties.png" alt="Properties for the browser source" style="max-width: 500px; height: auto; border-radius: 5px;" class="center-image">
<p>Make sure to enable "Shutdown source when not visible" and "Refresh browser when scene becomes active" so that when you make the timer visible it will automaticaly start.</p>
<h2>Usage</h2>
<p>When you make the source visible the timer will automaticaly start, to restart the timer select the source and hit "Refresh" (<img src="https://gorzog.com/assets/timer/refresh.png" alt="Refresh button" style="max-width: 100px; height: auto; border-radius: 5px;">).</p>
<p>To change the duration of the timer you can either change the parameters in the URL or use this webpage to generate a new URL</p>
</div>
</div>
<script>
document.getElementById('generate').addEventListener('click', function(e) {
const sec = parseInt(document.getElementById('sec').value) || 0;
const min = parseInt(document.getElementById('min').value) || 0;
const blink = document.getElementById('blink').checked;
let color = document.getElementById('color').value;
let url = 'https://timer.gorzog.com?';
if (sec > 0 || min > 0) {
if (sec > 0) {
let totalSeconds = (min * 60) + sec;
url += `sec=${totalSeconds}&`;
} else {
url += `min=${min}&`;
}
}
if (color !== '#ffffff') {
color = color.replace('#', ''); // Remove the '#' from the color code
url += `color=${encodeURIComponent(color)}&`;
}
if (!blink) {
url += `blink=false`;
} else {
// Remove the trailing '&' if blink is true and no other parameters follow
url = url.endsWith('&') ? url.slice(0, -1) : url;
}
document.getElementById('result').value = url;
document.getElementById('preview').src = url;
document.getElementById('copy').innerHTML = '<i class="fa fa-copy"></i>';
document.getElementById('results').style.display = 'block';
});
document.getElementById('copy').addEventListener('click', function(e) {
url = document.getElementById('result').value;
navigator.clipboard.writeText(url);
document.getElementById('copy').innerHTML = '<i class="fa fa-check"></i>';
});
</script>
</body>
<!-- footer -->
<footer>
<a href="https://github.com/Vincenzo160/E-Ink-Schedule"><i class="fa-brands fa-github"></i></a>
<a href="https://bsky.app/profile/gorzog.com"><i class="fa-brands fa-bluesky"></i></a>
<a href="https://gorzog.com"><i class="fa-solid fa-globe"></i></a>
</footer>
<!-- footer end -->
</html>