52 Commits

Author SHA1 Message Date
704ecb4249 finally introduced CNTDWN-1 (allow/disallow overrun) 2023-08-07 16:59:38 +02:00
5398817a1e - fixed issue #8 2022-11-19 15:49:46 +01:00
1fc16fdc14 „README.MD“ ändern 2022-11-15 20:50:12 +01:00
b04a376b1d Merge pull request 'Rewrite of timerpage' (#7) from better-timer-page into master
Reviewed-on: #7
2022-11-15 18:48:57 +01:00
0bf867daf6 fix onresize issue 2022-11-15 18:46:06 +01:00
2e1fc97f6f Merge pull request 'Add proper Electron launcher and building process' (#6) from electron into master
Reviewed-on: #6
2022-11-15 18:28:59 +01:00
cee06bbe11 add windows build script 2022-11-15 18:26:50 +01:00
1423f51104 improved screen saver 2022-11-14 19:37:20 +01:00
389d9a9b13 bump version in package.json 2022-11-13 21:58:25 +01:00
7dd2438881 - rewrote timerview
- added new timerview mode
2022-11-13 21:57:01 +01:00
94c81ee76d some cleanup and fixes 2022-11-13 20:01:41 +01:00
59aa625a6d version increment 2022-11-13 19:15:19 +01:00
de22ec5c3a added proper status message 2022-11-13 19:12:33 +01:00
811d96f5fa small cleanup 2022-11-13 00:46:18 +01:00
3eab7cc6eb add electron packaging 2022-11-13 00:30:42 +01:00
4e28df6eea „README.MD“ ändern 2022-10-28 18:43:08 +02:00
013ad881d3 - add gui electron application
! sometimes the tray icon does not open it's context menu
2022-08-18 22:00:24 +02:00
16a2549942 Merge branch 'master' of https://git.project-name-here.de/Project-Name-Here/openCountdown 2022-08-18 18:16:58 +02:00
92a3d94429 - removed symblic links 2022-08-18 18:15:36 +02:00
f3114e7cd6 - removal of most symblic links (works better on windows) 2022-08-18 18:15:24 +02:00
6479979293 „README.MD“ ändern 2022-07-23 18:15:14 +02:00
4ed8ad2dd3 „README.MD“ ändern 2022-07-23 18:15:01 +02:00
f65bf30809 - introduction of logo 2022-07-23 18:12:32 +02:00
91d8e0135d „README.MD“ ändern 2022-07-15 23:59:48 +02:00
20bf5b133b „README.MD“ ändern 2022-07-15 18:40:30 +02:00
32e0c707be „README.MD“ ändern 2022-07-15 17:32:12 +02:00
f73155ab01 „README.MD“ ändern 2022-07-15 17:30:03 +02:00
a0602a3b9b „README.MD“ ändern 2022-07-15 17:29:43 +02:00
3ba06013b0 - added new relativ add millis 2022-07-14 23:12:18 +02:00
a2106f01b1 Merge pull request 'Porintg more fixes' (#4) from language into master
Reviewed-on: #4
2022-07-13 18:27:54 +02:00
22de906767 - add a build command
- fix an error in swagger doc
2022-07-13 18:26:50 +02:00
fcc2172f1f fixing config.json not existing causing a crash 2022-07-13 18:24:17 +02:00
ffcd716038 Merge pull request 'Porting a fix from a wrong branch to main' (#3) from language into master 2022-07-13 18:19:52 +02:00
0ae35590f4 fix progressbar not disappearing 2022-07-12 22:15:27 +02:00
7106bef0bf Add multilanguage support
Reviewed-on: #2
2022-05-12 21:03:13 +02:00
f3bcf63860 Add language settings in UI 2022-05-12 21:01:49 +02:00
c201d6b2e1 fixed german 2022-05-12 17:40:44 +02:00
b790c6ff80 More language support 2022-05-10 21:49:08 +02:00
0b3df97975 work on translation system 2022-04-06 22:17:55 +02:00
3b99939ef3 add logging system 2022-03-30 16:16:59 +02:00
d04998d613 Merge branch 'ui-rework' 2022-03-28 22:15:40 +02:00
292cdebecb clean readme 2022-03-28 22:14:33 +02:00
7e8f3f902a remove unused debug output 2022-03-28 22:12:04 +02:00
104c52b575 - add countdown to function
- small cleanup
2022-03-28 22:11:12 +02:00
7dbe7ed6b1 - make the open buttons float right 2022-03-27 16:41:40 +02:00
da0d79e8ed - reworked admin interface layout
- fixed custom time value entry
- sidebar toggablity
- added links for countdown view
- added helper tooltips
2022-03-27 15:19:23 +02:00
f70bd4e540 Add vscode debug config. 2022-03-27 13:52:24 +02:00
a7b5980a89 - remove old admin interface
- introduce 404 page
- fix chrome display bug
- fixed about not showing version
- removed unused dependecies
- removed dead code from interface.js
- moved layout to dedicated page
2022-03-27 13:50:24 +02:00
469fa5048c Fix countdown inital value, fix colortable time pickers 2022-03-27 12:41:41 +02:00
1aea4d54df Colors work! 2022-03-26 19:40:37 +01:00
df3f5fdb58 Cleaning up, some other preperation 2022-03-20 18:41:05 +01:00
ee52bc0482 License in package.json 2022-03-11 08:09:53 +01:00
51 changed files with 22880 additions and 1781 deletions

9
.gitignore vendored
View File

@ -1,3 +1,12 @@
node_modules
rename.sh
data-persistence.json
log-journal.json
config.json
log-journal.json
bom.json
log-journal.json
openCountdown
openCountdown.exe
buildout
package-lock.json

17
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/index.js"
}
]
}

View File

@ -1,11 +1,31 @@
<img alt="openCountdown Logo" height="90px" src="https://git.project-name-here.de/Project-Name-Here/openCountdown/raw/branch/master/static/logo/logoProposal.svg">
# openCountdown
openCountdown is a professional software for event countdowns. It can be used in a live settings such as a music event.
Support for companion is currently being worked on [here](https://github.com/bitfocus/companion-module-pnh-opencountdown).
<a href="https://bitfocus.io/companion/?ref=pnh-Opencountdown" target="_new"><img alt="Controllable by Companion" src="https://bitfocus.io/companion-badge.png?ref=pnh-Opencountdown"></a>
# Installation
You can download complete binaries from the release tab.
## Development build
1. Download the repository
2. `npm install` to install dependencies
3. `npm start` to launch
### Startup Arguments
One can pass a `--headless` argument to start the server in headless mode. This will disable the GUI.
## Packaging
We've introduced a new packaging system. It is based on [electron-builder](https://www.electron.build/). This allows for easy packaging of the application for different platforms.
```bash
chmod +x ./build.sh
./build.sh
```
*Small disclaimer: Please do not use openCountdown for military or life-depending applications. Please also refrain from using openCountdown for launching rockets.*
# ToDo
- [X] Pausing functions
- [X] Presets
- [X] time on countdown page
- [X] one-way messaging
- [P] Better UI
- [ ] Error popups
- [X] Progress bar
- [P] Endpoint docs
Endpoint documentation is currently pretty thin. This will be changed in the future.
- [ ] Endpoint docs (in Progress)
- [ ] Better WS frames

19
build.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
#npx electron-packager . --platform=win32 --overwrite --out=./buildout
npx electron-packager . --platform=win32,linux --overwrite --out=./buildout
cd "./buildout/" || exit 1
resources=(
"electronAssets"
"lang"
"static"
"templates"
"package.json"
)
for dir in */; do
for i in "${resources[@]}"; do
echo "$dir -> $i"
cp -r "$dir/resources/app/$i" "$dir"
done
done

19
build_win.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/bash
#npx electron-packager . --platform=win32 --overwrite --out=./buildout
npx electron-packager . --platform=win32,linux --overwrite --out=./buildout
cd "./buildout/" || exit 1
resources=(
"electronAssets"
"lang"
"static"
"templates"
"package.json"
)
for dir in */; do
for i in "${resources[@]}"; do
echo "$dir -> $i"
cp -r "$dir\resources/app/$i" "$dir"
done
done

View File

@ -170,7 +170,7 @@ paths:
operationId: "textEnableColoring"
parameters:
- in: path
name: "show"
name: "enable"
required: true
type: boolean
description: "If true the timer will change color by value, else the timer stays white."

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 97 KiB

222
electronAssets/index.html Normal file
View File

@ -0,0 +1,222 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>openCountdown</title>
</head>
<body>
<style>
body,
html {
margin: 0;
padding: 0;
-webkit-app-region: drag;
}
body {
background-color: rgba(35, 35, 35, 1);
color: white;
font-family: 'Helvetica';
overflow: hidden;
}
#wrap {
width: 100%;
margin-top: 20px;
display: block;
text-align: center;
}
#logo {
width: 200px;
padding-top: 20px;
padding-bottom: 10px;
text-align: center;
user-select: none;
}
#actions {
padding: 10px;
display: block;
box-shadow: inset 0px 5px 10px rgba(0, 0, 0, 0.3);
padding-top: 20px;
padding-bottom: 20px;
background-color: #d40215;
background-image: url("background.svg");
background-position: 60% 60%;
user-select: none;
}
.dobutton {
font-size: 1em;
padding: 10px 20px;
border: 0px;
user-select: none;
cursor: pointer;
border-radius: 4px;
}
#launch {
background-color: rgba(255, 255, 255, 1);
margin-right: 5px;
border: 1px solid white;
}
#hide {
background-color: rgba(255, 255, 255, 0.1);
color: white;
margin-right: 5px;
border: 1px solid white;
}
#close {
background-color: rgba(255, 255, 255, 0.1);
color: white;
border: 1px solid white;
}
input {
-webkit-appearance: textfield;
background-color: white;
-webkit-rtl-ordering: logical;
cursor: text;
padding: 1px;
border-width: 2px;
border-style: inset;
border-color: initial;
border-image: initial;
}
#status,
#model {
user-select: none !important;
}
#status {
font-size: 40px;
font-weight: 100;
margin: 0;
color: rgba(255, 255, 255, 0.4);
}
#model {
font-size: 14px;
}
h1 {
font-size: 40px;
padding-top: 20px;
font-weight: 100;
}
#url {
padding-top: 5px;
padding-bottom: 10px;
-webkit-app-region: no-drag !important;
}
#meh {
background-color: #b00013;
background-image: url("background.svg");
background-position: 90% 90%;
margin-top: 30px;
padding-bottom: 10px;
}
textarea:focus,
input:focus {
outline: 0;
}
#ifs,
input[type='button'] {
-webkit-app-region: no-drag !important;
}
input {
-webkit-app-region: no-drag !important;
}
#ifp {
width: 50px;
text-align: center;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
background-color: #d40215;
font-size: 13px;
color: #fff;
padding-top: 3px;
padding-bottom: 3px;
border: 1px solid white;
border-right-width: 1px;
}
#ifpb {
cursor: pointer;
border: 1px solid #ccc;
background-color: #b00013;
color: white;
border: 1px solid white;
padding: 3px 8px;
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
border-left-width: 0px;
margin-top: -1px;
font-size: 13px;
}
#ifpb:hover {
background-color: #666;
}
#ift {
color: white;
-webkit-appearance: checkbox;
cursor: pointer;
}
#ifs {
background-color: #d40215;
color: #fff;
border: 1px solid white;
font-size: 12px !important;
margin-bottom: -4px;
}
#guitext {
font-size: 12px;
color: white;
padding-top: 0px;
padding-bottom: 2px;
}
#bottombuttons {
padding-bottom: 100px;
}
</style>
<div id="wrap">
<div id="topwrap">
<img id="logo" src="../static/logo/logoProposal.svg" alt="openCountdown" />
<div id="model">model_text (version_etc)</div>
</div>
<div id="meh">
<h1 id="status">Status</h1>
<div id="url">URL</div>
</div>
<div id="actions">
<p><input type="text" maxlength="5" id="ifp" value="8000" /><input type="button" id="ifpb" value="Change" /></p>
<p>
<input type="checkbox" id="ift" />
<label for="ift" style="font-size: 12px">Start minimized</label>
</p>
<div id="bottombuttons">
<input type="button" class="dobutton" value="Launch GUI" id="launch" />
<input type="button" class="dobutton" value="Hide" id="hide" />
<input type="button" class="dobutton" value="Quit" id="close" />
</div>
</div>
</div>
<script type="text/javascript" src="window.js"></script>
</body>
</html>

33
electronAssets/window.js Normal file
View File

@ -0,0 +1,33 @@
document.getElementById('launch').addEventListener('click', function () {
api.send('skeleton-launch-gui')
})
document.getElementById('hide').addEventListener('click', function () {
api.send('skeleton-minimize')
})
document.getElementById('close').addEventListener('click', function () {
api.send('skeleton-close')
})
api.receive('info', function (info) {
document.getElementById('status').innerHTML = info.appStatus
document.getElementById('url').innerHTML = info.appURL
document.getElementById('model').innerHTML = `${info.appName}`
document.getElementById('ift').checked = info.startMinimised
document.getElementById('ifp').value = configObject.port
document.title = info.appName
})
api.send('info')
document.getElementById('ifpb').addEventListener('click', function () {
var e = document.getElementById('ifp')
api.send('skeleton-bind-port', e.value)
})
document.getElementById('ift').addEventListener('click', function () {
var e = document.getElementById('ift')
api.send('skeleton-start-minimised', e.checked)
})
api.send('skeleton-ready')

View File

@ -0,0 +1,12 @@
const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('api', {
send: (channel, data) => {
// whitelist channels
ipcRenderer.send(channel, data)
},
receive: (channel, func) => {
// Deliberately strip event as it includes `sender`
ipcRenderer.on(channel, (event, ...args) => func(...args))
},
})

View File

@ -22,12 +22,34 @@ function convertStringBooleanToBoolean(stringBoolean) {
function wrapBooleanConverter(stringBoolean, res) {
const temp = convertStringBooleanToBoolean(stringBoolean);
if(temp === -1) {
if(temp == -1) {
res.json({ status: "error", message: "Invalid boolean value" });
} else {
return(temp);
}
}
// export { convertStringBooleanToBoolean, wrapBooleanConverter };
module.exports = { convertStringBooleanToBoolean, wrapBooleanConverter };
/**
* Tries to parse a string to a JSON object. Returns false if invalid. Taken from https://stackoverflow.com/a/20392392/11317151
* @param {String} jsonString A JSON String to parse
* @returns {Object/Boolean} JSON Object if valid or false otherwise
*/
function tryToParseJson(jsonString) {
try {
var o = JSON.parse(jsonString);
// Handle non-exception-throwing cases:
// Neither JSON.parse(false) or JSON.parse(1234) throw errors, hence the type-checking,
// but... JSON.parse(null) returns null, and typeof null === "object",
// so we must check for that, too. Thankfully, null is falsey, so this suffices:
if (o && typeof o === "object") {
return o;
}
}
catch (e) { }
return false;
}
module.exports = { convertStringBooleanToBoolean, wrapBooleanConverter, tryToParseJson };

264
index.js
View File

@ -3,13 +3,20 @@ const fs = require("fs");
const bodyParser = require("body-parser");
const ws = require('ws');
const helper = require("./helpers.js");
const loggy = require("./logging")
const Eta = require("eta");
const _ = require("underscore")
const path = require("path")
console.log("Preparing server...");
loggy.init(true)
loggy.log("Preparing server", "info", "Server");
const app = express();
loggy.log("Preparing static routes", "info", "Server");
app.use(express.static("static"));
app.use(express.static("node_modules"));
loggy.log("Preparing middlewares", "info", "Server");
app.use(bodyParser.json());
app.use(
bodyParser.urlencoded({
@ -18,8 +25,29 @@ app.use(
})
);
// Allowed urls for requests to /assets/
const allowsURLs = [
'bootstrap-icons/font/bootstrap-icons.css',
'js-cookie/dist/js.cookie.min.js',
'bootstrap/dist/css/bootstrap.min.css',
'mdbootstrap/css/style.css',
'bootstrap/dist/js/bootstrap.bundle.min.js',
'jquery/dist/jquery.min.js',
'darkreader/darkreader.js',
'bootstrap-duration-picker/dist/bootstrap-duration-picker.css',
'flatpickr/dist/flatpickr.min.css',
'bootstrap-duration-picker/dist/bootstrap-duration-picker-debug.js',
'flatpickr/dist/flatpickr.js',
'bootstrap-icons/font/fonts/bootstrap-icons.woff2',
'bootstrap/dist/css/bootstrap.min.css.map',
'less/dist/less.min.js',
'less/dist/less.min.js.map',
'mdbootstrap/js/mdb.min.js'
];
let loadedData = {}
loggy.log("Loading config", "info", "Config");
if (fs.existsSync("data-persistence.json")) {
const loadedDataRaw = fs.readFileSync("data-persistence.json", "utf8");
loadedData = JSON.parse(loadedDataRaw);
@ -40,25 +68,49 @@ currentState = {
showMessage: false,
messageAppearTime: 0,
showProgressbar: true,
colorSegments: { 40000: "yellow", 20000: "#FFAE00", 5000: "#ff0000", "START": "green" },
colorSegments: { 40000: "yellow", 20000: "#FFAE00", 5000: "#ff0000", "START": "green" },
textColors: {},
srvTime: 0,
enableColoredText: true,
debug: false,
sessionToken: Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15),
enableOverrun: true,
sessionToken: Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15),
};
const dataToBeWritten = {};
let configObject = {
language: "en_uk",
port: 3000
}
if(!fs.existsSync("config.json")) {
fs.writeFileSync("config.json", "{}");
}
const tempJsonText = JSON.parse(fs.readFileSync("config.json", "utf8"));
configObject = _.extend(configObject, tempJsonText);
fs.writeFileSync("config.json", JSON.stringify(configObject));
currentState = Object.assign({}, currentState, loadedData);
currentState.textColors = currentState.colorSegments
loggy.log("Searching for languages", "info", "Language")
const languagesRaw = fs.readdirSync("./lang");
const languages = [];
for (let i = 0; i < languagesRaw.length; i++) {
if (languagesRaw[i].endsWith(".json")) {
languages.push(languagesRaw[i].replace(".json", ""));
}
}
loggy.log("Found " + languages.length + " languages", "info", "Language")
loggy.log("Reading language file", "info", "Language")
let languageProfile = JSON.parse(fs.readFileSync("lang/" + configObject.language + ".json", "utf8"));
loggy.log("Preparing websocket", "info", "Websocket");
const wsServer = new ws.Server({ noServer: true });
wsServer.on('connection', socket => {
socket.on('message', function incoming(data) {
if(data.toString() == "new client"){
if (data.toString() == "new client") {
updatedData()
}
});
@ -78,32 +130,50 @@ function updatedData() {
currentState.srvTime = new Date().getTime()
wsServer.broadcast(JSON.stringify(currentState));
clearTimeout(updatey);
setTimeout(updatedData, 5000 );
setTimeout(updatedData, 5000);
}
console.log("Preparing routes...");
loggy.log("Preparing routes", "info", "Server");
app.get("/", function (req, res) {
const data = fs.readFileSync("templates/newAdminPanel.html", "utf8");
res.send(data);
try {
res.send(
Eta.render(data, {
lang: languageProfile,
additional: {
languages: languages
}
}));
} catch (e) {
loggy.log("Error rendering template", "error", "Server");
const dataN = fs.readFileSync("templates/brokenTranslation.html", "utf8");
res.send(
Eta.render(dataN, {
additional: {
languages: languages
}
}));
}
});
app.get("/old", function (req, res) {
const data = fs.readFileSync("templates/adminPanel.html", "utf8");
res.send(data);
});
app.get("/timer", function (req, res) {
const data = fs.readFileSync("templates/timerPage.html", "utf8");
const data = fs.readFileSync("templates/ng-timerview.html", "utf8");
res.send(data);
});
app.get("/timer-old", function (req, res) {
const data = fs.readFileSync("templates/timerPage.html", "utf8");
res.send(data);
});
app.get("/api/v1/data", function (req, res) {
currentState.srvTime = new Date().getTime()
res.json(currentState);
});
app.get("/api/v1/system", function (req, res) {
const tempPkgFile = fs.readFileSync("package.json", "utf8");
const tempPkgObj = JSON.parse(tempPkgFile);
const systemData = {
uptime: process.uptime(),
memoryUsage: process.memoryUsage(),
@ -118,6 +188,7 @@ app.get("/api/v1/system", function (req, res) {
nodeEnv: process.env,
nodeConfig: process.config,
nodeTitle: process.title,
systemVersion: tempPkgObj.version
}
res.json(systemData);
});
@ -131,7 +202,7 @@ app.get("/api/v1/set/mode", function (req, res) {
app.get("/api/v1/set/layout/showMillis", function (req, res) {
const resy = helper.wrapBooleanConverter(req.query.show, res)
if (resy) {
if (resy != undefined) {
currentState.showMilliSeconds = resy;
if (req.query.persist === 'true') {
dataToBeWritten.showMilliSeconds = currentState.showMilliSeconds
@ -151,6 +222,15 @@ app.get("/api/v1/set/timerGoal", function (req, res) {
app.get("/api/v1/set/addMillisToTimer", function (req, res) {
currentState.timeAmountInital = req.query.time;
currentState.countdownGoal = new Date().getTime() + parseInt(req.query.time)
currentState.pauseMoment = new Date().getTime();
res.json({ status: "ok" });
updatedData()
});
app.get("/api/v1/set/relativAddMillisToTimer", function (req, res) {
currentState.timeAmountInital = req.query.time;
currentState.countdownGoal = currentState.countdownGoal + parseInt(req.query.time)
currentState.pauseMoment = new Date().getTime();
res.json({ status: "ok" });
updatedData()
});
@ -180,7 +260,7 @@ app.get("/api/v1/ctrl/timer/restart", function (req, res) {
app.get("/api/v1/set/layout/showTime", function (req, res) {
const resy = helper.wrapBooleanConverter(req.query.show, res)
if (resy) {
if (resy != undefined) {
currentState.showTimeOnCountdown = resy;
if (req.query.persist === 'true') {
dataToBeWritten.showTimeOnCountdown = currentState.showTimeOnCountdown
@ -190,6 +270,18 @@ app.get("/api/v1/set/layout/showTime", function (req, res) {
updatedData()
});
app.get("/api/v1/set/enableOverrun", function (req, res) {
const resy = helper.wrapBooleanConverter(req.query.enable, res)
if (resy != undefined) {
currentState.enableOverrun = resy;
if (req.query.persist === 'true') {
dataToBeWritten.enableOverrun = currentState.enableOverrun
}
res.json({ status: "ok" });
}
updatedData()
});
app.get("/api/v1/set/progressbar/show", function (req, res) {
currentState.showProgressbar = (req.query.show === 'true');
if (req.query.persist === 'true') {
@ -202,7 +294,7 @@ app.get("/api/v1/set/progressbar/show", function (req, res) {
app.get("/api/v1/set/progressbar/colors", function (req, res) {
try {
let data = req.query.colors
if(req.query.isBase64 === "true"){
if (req.query.isBase64 === "true") {
data = atob(data)
}
currentState.colorSegments = JSON.parse(data);
@ -219,14 +311,19 @@ app.get("/api/v1/set/progressbar/colors", function (req, res) {
app.get("/api/v1/set/text/colors", function (req, res) {
try {
let data = req.query.colors
if(req.query.isBase64 === "true"){
data = atob(data)
}
console.debug(data)
currentState.textColors = JSON.parse(data);
if (req.query.persist === 'true') {
dataToBeWritten.textColors = currentState.textColors
if (req.query.copy === "true") {
currentState.textColors = currentState.colorSegments
res.json({ status: "ok" });
} else {
let data = req.query.colors
if (req.query.isBase64 === "true") {
data = atob(data)
}
console.debug(data)
currentState.textColors = JSON.parse(data);
if (req.query.persist === 'true') {
dataToBeWritten.textColors = currentState.textColors
}
}
res.json({ status: "ok" });
} catch (error) {
@ -292,9 +389,109 @@ app.get("/api/v1/storage/delete", function (req, res) {
updatedData()
});
// UI Routes
// Returns an object containg all available languages
app.get("/api/ui/v1/lang/list", function handleLangList(req, res){
const tempRespObject = {
status: "ok",
languages: languages
}
res.json(tempRespObject);
})
app.get("/api/ui/v1/lang/set", function (req, res) {
if(req.query.lang == undefined || req.query.lang == ""){
res.json({ status: "error", reason: "Missing language" });
return;
}
const testLang = req.query.lang;
loggy.log("Reloading language file", "info", "Language")
if(!fs.existsSync("lang/" + testLang + ".json")){
loggy.log("Language reload failed, file does not exist", "error", "Language")
res.status(500).json({ status: "error", reason: "Language file not found" });
return
}
const tempLang = fs.readFileSync("lang/" + testLang + ".json", "utf8");
const tempLangObj = helper.tryToParseJson(tempLang);
if(!tempLangObj){
loggy.log("Language reload failed, file is not valid", "error", "Language")
res.status(500).json({ status: "error", reason: "Language file is not valid" });
return
}
if(tempLangObj._metadata == undefined){
loggy.log("Language reload failed, file is not valid, metadata missing", "error", "Language")
res.status(500).json({ status: "error", reason: "Language file is not valid" });
return
}
loggy.log("Language reloaded, loaded " + tempLangObj._metadata.lang + "@" + tempLangObj._metadata.version, "info", "Language")
configObject.language = req.query.lang;
languageProfile = tempLangObj;
res.status(200).json({ status: "ok" });
fs.writeFileSync("config.json", JSON.stringify(configObject));
});
app.use("/assets/*", function handleModuleFiles(req, res) {
if(allowsURLs.indexOf(req.params[0]) > -1){
res.sendFile(path.join(__dirname, "node_modules", req.params[0]));
} else {
loggy.log("Attempt to access restricted asset file " + req.params[0], "error", "Security")
res.status(403).json({ status: "error", reason: "Access to restricted asset file denied" });
}
// console.log(recordedURLs)
})
app.use(function (req, res, next) {
res.status(404);
loggy.log("Server responded with 404 error", "warn", "Server", true);
// respond with html page
if (req.accepts('html')) {
const data = fs.readFileSync("templates/errorPages/404.html", "utf8");
res.status(404)
res.send(data);
return;
}
// respond with json
if (req.accepts('json')) {
res.json({ error: 'Not found' });
return;
}
// default to plain-text. send()
res.type('txt').send('Not found');
});
/*app.use(function(err, req, res, next) {
console.error(err.stack);
if(String(err.stack).includes("TypeError: Cannot read properties of undefined")) {
const data = fs.readFileSync("templates/brokenTranslation.html", "utf8");
res.send(data);
}else{
res.status(500).send('Something broke!');
}
});*/
loggy.log("Starting server", "info", "Server");
const port = configObject.port;
process.on('SIGINT', function () {
loggy.log("Caught interrupt signal and shutting down gracefully", "info", "Shutdown");
server.close(); // Make the express server stop
loggy.log("Goodbye! 👋", "magic", "Shutdown", true)
loggy.close(); // Close and write log
process.exit(); // Quit the application
});
console.log("Starting server...");
const port = 3006
const server = app.listen(port);
server.on('upgrade', (request, socket, head) => {
wsServer.handleUpgrade(request, socket, head, socket => {
@ -303,7 +500,8 @@ server.on('upgrade', (request, socket, head) => {
});
console.info("Server running on port " + port);
console.info("Visit localhost:" + port + "/timer for the timer page");
console.info("Visit localhost:" + port + " for the admin page");
loggy.log("=======================", "info", "", true);
loggy.log("Server running on port " + port, "magic", "", true);
loggy.log("Visit http://localhost:" + port + "/timer for the timer view", "magic", "", true);
loggy.log("Visit http://localhost:" + port + " for the admin view", "magic", "", true);
loggy.log("=======================", "info", "", true);

71
lang/de_de.json Normal file
View File

@ -0,0 +1,71 @@
{
"titles": {
"home": "Startseite",
"preview": "Vorschau",
"mode": "Modus",
"messaging": "Nachrichten",
"countdownToTime": "Auf Uhrzeit runterzählen",
"attention": "Achtung",
"hostinfo": "Host Informationen"
},
"sidebar": {
"home": "Startseite",
"settings": "Einstellungen",
"debug": "Debug",
"about": "Über"
},
"hints":
{
"previewHint": "Eine Vorschau der Timeransicht.",
"modeHint": "",
"messagingHint": "Zeigt eine Nachricht auf der Timeransicht an.",
"copyHint": "Kopiert den Link zu der Countdown-Seite.",
"openInNewTab": "Öffnet den Link in einem neuen Tab.",
"selectMode": "Wählt einen Modus für die Timeransicht."
},
"placeholders": {
"msgHere": "Message here"
},
"others":
{
"timer": "Timer",
"clock": "Uhr",
"black": "Leer",
"test": "Testbild",
"screensaver": "Bildschirmschoner"
},
"labels":
{
"clockOnTimer": "Zeigt die Uhrzeit auf dem Timer:",
"showMillis": "Zeigt Millisekunden auf dem Timer:",
"showProgress": "Zeige Fortschrittsbalken:",
"progbarColors": "Fortschrittsbalken Farben",
"time": "Zeit",
"color": "Farbe",
"remove": "Entfernen",
"enableTextClrs": "Text Farben aktivieren:",
"textClrs": "Text Farben",
"addRow": "Neue Zeile",
"timeVar": "Aktiviere zeitabweichungs display:",
"allowOverrun": "Überlauf erlauben: "
},
"untis":
{
"seconds": "Sekunden",
"minutes": "Minutes",
"hours": "Stunden",
"days": "Tage",
"weeks": "Wochen",
"months": "Monate",
"years": "Jahre"
},
"informationTexts": {
"debugInfo": "Das hier ist eine debug seite welche nur von professionellen Personen verwendet werden sollte. ",
"proceedCaution": "Gehen Sie vorsichtig vor."
},
"_metadata": {
"lang": "de",
"version": "1.0.0",
"authors": ["TheGreydiamond"]
}
}

74
lang/en_uk.json Normal file
View File

@ -0,0 +1,74 @@
{
"titles": {
"home": "Homepage",
"preview": "Preview",
"mode": "Mode",
"messaging": "Messaging",
"countdownToTime": "Countdown to time",
"attention": "Attention",
"hostinfo": "Host information",
"uiSettings": "UI settings"
},
"sidebar": {
"home": "Home",
"settings": "Settings",
"debug": "Debug",
"about": "About"
},
"hints":
{
"previewHint": "A preview of what is currently visible on the countdown view",
"modeHint": "",
"messagingHint": "Shows a given message on the timer view",
"copyHint": "Copies the link to the timer view",
"openInNewTab": "Open the countdown view in a new tab",
"selectMode": "Select what to show on the countdown view"
},
"placeholders": {
"msgHere": "Message here"
},
"others":
{
"timer": "Timer",
"clock": "Clock",
"black": "Black",
"test": "Testimage",
"screensaver": "Screensaver"
},
"labels":
{
"clockOnTimer": "Show clock on Timer:",
"showMillis": "Show Milliseconds on Timer:",
"showProgress": "Show progressbar:",
"progbarColors": "Progressbar Colors",
"time": "Time",
"color": "Color",
"remove": "Remove",
"enableTextClrs": "Enable Text Colours:",
"textClrs": "Text Colours",
"addRow": "Add Row",
"timeVar": "Enable time variance display:",
"language": "Select a language",
"apply": "Apply",
"allowOverrun": "Allow overrun:"
},
"untis":
{
"seconds": "Seconds",
"minutes": "Minutes",
"hours": "Hours",
"days": "Days",
"weeks": "Weeks",
"months": "Months",
"years": "Years"
},
"informationTexts": {
"debugInfo": "This is a debug page which should only be used by professionals. Changing any options below might impact operation.",
"proceedCaution": "Proceed with caution."
},
"_metadata": {
"lang": "en",
"version": "1.0.0",
"authors": ["TheGreydiamond"]
}
}

72
lang/proto_black.json Normal file
View File

@ -0,0 +1,72 @@
{
"titles": {
"home": "████████",
"preview": "██████",
"mode": "████",
"messaging": "█████████",
"countdownToTime": "█████████ ██ ████",
"attention": "███████████",
"hostinfo": "████ █████████"
},
"sidebar": {
"home": "████",
"settings": "████████",
"debug": "█████",
"about": "█████"
},
"hints":
{
"previewHint": "█ ████ ███████ ████",
"modeHint": "",
"messagingHint": "████ █ ██████ ██ █████",
"copyHint": "██████ ███ ████ ██ ███ █████ ████",
"openInNewTab": "████ ███ ████████ ████ █ █ ███ ███",
"selectMode": "█████ ████ ██ ████ ██ ███ ████████ ████"
},
"placeholders": {
"msgHere": "██████ ████"
},
"others":
{
"timer": "████",
"clock": "█████",
"black": "████",
"test": "███████",
"screensaver": "████████"
},
"labels":
{
"clockOnTimer": "████ █████ ██ █████:",
"showMillis": "████ ███████████ ██ █████:",
"showProgress": "████ █████████:",
"progbarColors": "████████ ████",
"time": "████",
"color": "█████",
"remove": "██████",
"enableTextClrs": "██████ ████ ███████:",
"textClrs": "████ ██████",
"addRow": "███ ███",
"timeVar": "██████ ████ ███████ ███████:",
"allowOverrun": "██████ ████████:"
},
"untis":
{
"seconds": "Seconds",
"minutes": "Minutes",
"hours": "Hours",
"days": "Days",
"weeks": "Weeks",
"months": "Months",
"years": "Years"
},
"informationTexts": {
"debugInfo": "████ ██ █ █████ ████ █████ █████ ████ ██ ████ ██ ██████████. ████████ ███ ██████ █████ █████ █████ ██████.",
"proceedCaution": "█████ ████ ███████."
},
"_metadata": {
"lang": "none",
"version": "1.0.0",
"authors": ["TheGreydiamond"],
"comment": "A test language without proper text and only black blocks. █"
}
}

61
logging.js Normal file
View File

@ -0,0 +1,61 @@
const colors = require('colors');
const util = require('util')
const fs = require('fs');
let logToFileJson = false;
let logJournal = [];
function init(logToFile = false) {
logToFileJson = logToFile;
log("Logging initialized", "info", "Logging");
}
function close(){
if(logToFileJson){
const tempString = JSON.stringify(logJournal);
try {
fs.writeFileSync("log-journal.json", tempString);
} catch (error) {
log("Error while closing log file: " + error, "error", "Logging");
}
}
log("Saved log", "info", "Logging");
}
/**
* A simple logging function
* @param {String} message A messaged to be logged
* @param {String} level Loglevel, may either be warn, error, magic or info
* @param {String} module Kinda the source
*/
function log(message, level, module, ignore = false) {
if (level == undefined) {
level = "info";
}
if (module == undefined) {
module = "Unknown";
}
if(String(message) == "[object Object]"){
message = util.inspect(message, false, null, false);
}
const timestamp = new Date().toISOString().replace("T", " ").replace("Z", "");
var message = timestamp + " [" + String(level) + "] " + " [" + String(module) + "] " + String(message);
if (level == "warn") {
console.warn(message.yellow);
} else if (level == "error") {
console.error(message.red);
} else if (level == "magic") {
console.error(message.magenta);
} else if (level == "info") {
console.info(message.white);
} else {
console.log(message.gray);
}
if(logToFileJson && ignore == false){
jsonObject = {timestamp: timestamp, level: level, module: module, message: message};
logJournal.push(jsonObject);
}
}
module.exports = { log, init, close };

7547
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +1,39 @@
{
"name": "opencountdown",
"version": "1.0.0",
"description": "An opensource countdown",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "TheGreydiamond",
"license": "LGPL-3.0",
"dependencies": {
"body-parser": "^1.19.2",
"bootstrap": "^5.1.3",
"bootstrap-colorpicker": "^3.4.0",
"bootstrap-icons": "^1.8.1",
"countdown": "^2.6.0",
"darkreader": "^4.9.44",
"express": "^4.17.3",
"jquery": "^3.6.0",
"js-cookie": "^3.0.1",
"mdbootstrap": "^4.20.0",
"moment": "^2.29.1",
"ws": "^8.5.0"
}
"name": "opencountdown",
"version": "1.0.7",
"description": "An opensource countdown",
"main": "startHandler.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "electron startHandler.js"
},
"author": "TheGreydiamond",
"license": "LGPL-3.0",
"dependencies": {
"body-parser": "^1.20.1",
"bootstrap": "^5.2.2",
"bootstrap-duration-picker": "^2.1.3",
"bootstrap-icons": "^1.10.1",
"colors": "^1.4.0",
"darkreader": "^4.9.58",
"eta": "^1.12.3",
"express": "^4.18.2",
"flatpickr": "^4.6.13",
"jquery": "^3.6.1",
"js-cookie": "^3.0.1",
"less": "^4.1.3",
"mdbootstrap": "^4.20.0",
"open": "^8.4.0",
"underscore": "^1.13.6",
"ws": "^8.11.0"
},
"devDependencies": {
"electron": "^21.2.3",
"electron-builder": "^23.6.0"
},
"build": {
"extraMetadata": {
"main": "startHandler.js"
}
}
}

226
startHandler.js Normal file
View File

@ -0,0 +1,226 @@
const { app, BrowserWindow, ipcMain, Tray, Menu, MenuItem, dialog } = require('electron')
const path = require('path')
const fs = require('fs')
const _ = require("underscore")
const open = require('open');
const childProcess = require('child_process');
const http = require('http');
const packageJson = JSON.parse(fs.readFileSync("package.json"))
// a minimal config
let configObject = {
language: "en_uk",
startMinimised: false,
port: 3000
}
if (!fs.existsSync("config.json")) {
fs.writeFileSync("config.json", "{}");
}
const tempJsonText = JSON.parse(fs.readFileSync("config.json", "utf8"));
configObject = _.extend(configObject, tempJsonText);
fs.writeFileSync("config.json", JSON.stringify(configObject));
// Set a serverStatus
let serverStatus = "Starting"
// Check if --headless is passed as an argument
const processArgs = process.argv;
if (processArgs.includes("--headless")) {
startServer()
} else {
// Start electron
app.whenReady().then(() => {
startServer()
createTray()
createWindow()
setInterval(() => {
// Check if the server is running
http.get('http://127.0.0.1:' + configObject.port + "/api/v1/system", (resp) => {
let data = '';
// A chunk of data has been received.
resp.on('data', (chunk) => {
data += chunk;
});
// The whole response has been received. Print out the result.
resp.on('end', () => {
// If we have a valid response, set the serverStatus to "Running"
let parsed = JSON.parse(data)
console.log(parsed)
serverStatus = "Running"
// Send the serverStatus to the window
if (win) {
win.webContents.send('info', { "appStatus": serverStatus, "appURL": "http://127.0.0.1:" + configObject.port, "appName": "openCountdown " + packageJson.version, "startMinimised": configObject.startMinimised, "port": configObject.port })
}
});
}).on("error", (err) => {
console.log("Error: " + err.message);
});
}, 2000);
})
ipcMain.on('info', function () {
// Send inital data to the window
if (win) {
win.webContents.send('info', { "appStatus": serverStatus, "appURL": "http://127.0.0.1:" + configObject.port, "appName": "openCountdown " + packageJson.version, "startMinimised": configObject.startMinimised, "port": configObject.port })
}
})
ipcMain.on('skeleton-close', function (req, cb) {
trayQuit()
})
ipcMain.on('skeleton-minimize', function (req, cb) {
win.hide()
})
ipcMain.on('skeleton-launch-gui', function () {
launchUI()
})
ipcMain.on('skeleton-start-minimised', function (e, msg) {
configObject.startMinimised = msg
fs.writeFileSync("config.json", JSON.stringify(configObject));
})
ipcMain.on('skeleton-bind-port', function (e, msg) {
configObject.port = msg
console.log("Update port")
fs.writeFileSync("config.json", JSON.stringify(configObject));
dialog.showMessageBoxSync({
message: "Port changed. Restart openCountdown to apply change.",
buttons: ["OK"]
})
})
}
var win, tray = null;
const createWindow = () => {
win = new BrowserWindow({
width: 370,
height: 500,
transparent: true,
frame: false,
resizable: false,
icon: path.join(__dirname, 'static/logo/faviconLogo.svg'),
webPreferences: {
pageVisibility: true,
nodeIntegration: true,
contextIsolation: true,
preload: path.join(__dirname, 'electronAssets/windowPreload.js'),
}
})
win.loadFile('electronAssets/index.html')
if (configObject.startMinimised) {
win.hide()
}
}
function createTray() {
tray = new Tray('static/logo/faviconLogo.png')
tray.setIgnoreDoubleClickEvents(true)
const menu = new Menu()
menu.append(
new MenuItem({
label: 'Show window',
click: showScreen,
})
)
menu.append(
new MenuItem({
label: 'Launch GUI',
click: launchUI,
})
)
menu.append(
new MenuItem({
label: 'Quit',
accelerator: 'Command+Q',
click: trayQuit,
})
)
tray.setToolTip('openCountdown ' + packageJson.version)
tray.setContextMenu(menu)
tray.on('click', function (e) {
if (win.isVisible()) {
win.hide()
} else {
win.show()
}
});
}
function showScreen() {
win.show()
}
function launchUI() {
open("http://127.0.0.1:" + configObject.port)
}
function trayQuit() {
let options = {
buttons: ["Yes", "No"],
message: "Do you really want to quit openCountdown?"
}
let response = dialog.showMessageBoxSync(options)
if (response == 0) {
serverStatus = "Stopping"
if (win) {
win.webContents.send('info', { "appStatus": serverStatus, "appURL": "http://127.0.0.1:" + configObject.port, "appName": "openCountdown " + packageJson.version, "startMinimised": configObject.startMinimised, "port": configObject.port })
}
srvProc.kill("SIGINT")
setTimeout(app.quit, 1000)
}
}
// taken from https://stackoverflow.com/a/22649812/11317151
function runScript(scriptPath, callback, valueCb) {
// keep track of whether callback has been invoked to prevent multiple invocations
var invoked = false;
var process = childProcess.fork(scriptPath);
valueCb(process)
// listen for errors as they may prevent the exit event from firing
process.on('error', function (err) {
if (invoked) return;
invoked = true;
callback(err);
});
// execute the callback once the process has finished running
process.on('exit', function (code) {
if (invoked) return;
invoked = true;
// var err = code === 0 ? null : new Error('exit code ' + code);
callback(code);
});
}
srvProc = null;
function setServer(process) {
srvProc = process
}
function startServer() {
runScript(path.join(__dirname, 'index.js'), function (err) {
if (err) throw err;
}, setServer)
}

View File

@ -1 +0,0 @@
../../node_modules/bootstrap/dist

1
static/coloris/coloris.min.css vendored Normal file

File diff suppressed because one or more lines are too long

6
static/coloris/coloris.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
../../node_modules/bootstrap-colorpicker/dist/css

View File

@ -1 +0,0 @@
../../node_modules/bootstrap-colorpicker/dist/js

View File

@ -1 +0,0 @@
../../node_modules/bootstrap-icons/font/bootstrap-icons.css

View File

@ -0,0 +1,86 @@
html, body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
.container {
height: 100%;
width: 100%;
background-color: #0B161E;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-family: 'Segoe UI';
text-align: center;
}
.color-foreground {
color: #474849 !important;
}
.text-shadow {
text-shadow: 1px 1px 2px;
}
.rainbow {
-webkit-animation:rainbow 16s infinite;
-ms-animation:rainbow 16s infinite;
-o-animation:rainbow 16s infinite;
animation:rainbow 16s infinite;
}
@-webkit-keyframes rainbow {
0% {color: #ff0000;}
10% {color: #ff8000;}
20% {color: #ffff00;}
30% {color: #80ff00;}
40% {color: #00ff00;}
50% {color: #00ff80;}
60% {color: #00ffff;}
70% {color: #0080ff;}
80% {color: #0000ff;}
90% {color: #8000ff;}
100% {color: #ff0080;}
}
@-ms-keyframes rainbow {
0% {color: #ff0000;}
10% {color: #ff8000;}
20% {color: #ffff00;}
30% {color: #80ff00;}
40% {color: #00ff00;}
50% {color: #00ff80;}
60% {color: #00ffff;}
70% {color: #0080ff;}
80% {color: #0000ff;}
90% {color: #8000ff;}
100% {color: #ff0080;}
}
@-o-keyframes rainbow {
0% {color: #ff0000;}
10% {color: #ff8000;}
20% {color: #ffff00;}
30% {color: #80ff00;}
40% {color: #00ff00;}
50% {color: #00ff80;}
60% {color: #00ffff;}
70% {color: #0080ff;}
80% {color: #0000ff;}
90% {color: #8000ff;}
100% {color: #ff0080;}
}
@keyframes rainbow {
0% {color: #ff0000;}
10% {color: #ff8000;}
20% {color: #ffff00;}
30% {color: #80ff00;}
40% {color: #00ff00;}
50% {color: #00ff80;}
60% {color: #00ffff;}
70% {color: #0080ff;}
80% {color: #0000ff;}
90% {color: #8000ff;}
100% {color: #ff0080;}
}

View File

@ -0,0 +1,62 @@
.glitch-wrapper {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.glitch {
@offset1: 2px;
@offset2: -2px;
@highlight1: #49FC00;
@highlight2: spin(@highlight1, 180);
color: white;
font-size: 150px;
text-transform: upercase;
position: relative;
display: inline-block;
&::before,
&::after {
content: attr(data-text);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #0B161E;
}
&::before {
left: @offset1;
text-shadow: -2px 0 @highlight1;
clip: rect(24px, 550px, 90px, 0);
animation: glitch-anim-2 3s infinite linear alternate-reverse;
}
&::after {
left: @offset2;
text-shadow: -2px 0 @highlight2;
clip: rect(85px, 550px, 140px, 0);
animation: glitch-anim 2.5s infinite linear alternate-reverse;
}
}
.glitch-frames (@n: 20, @index: 0) when (@index <= @n) {
@keyframeSel: percentage(@index/@n);
@rand1: unit(round(`Math.random()*150`),px);
@rand2: unit(round(`Math.random()*150`), px);
@{keyframeSel} {
clip: rect(@rand1, 9999px, @rand2, 0);
}
.glitch-frames(@n, (@index + 1));
}
@keyframes glitch-anim {
.glitch-frames(24);
}
@keyframes glitch-anim-2 {
.glitch-frames(30,2);
}

View File

@ -10,7 +10,7 @@ body {
main {
display: flex;
flex-wrap: nowrap;
height: 100vh;
height: 100vh !important;
height: -webkit-fill-available;
max-height: 100vh;
overflow-x: auto;
@ -113,4 +113,17 @@ pre {
overflow: auto;
word-wrap: normal;
white-space: pre;
}
.hidden {
display: none !important;
}
.trans {
transition: .5s
}
.helperTip {
opacity: 0.8;
font-size: small;
}

View File

@ -1,3 +1,7 @@
body {
font-size:0.3em;
}
.moverLogo {
height: 80px !important;
}

View File

@ -55,7 +55,7 @@ html, body {
.progBar {
appearance: none;
height: 100%;
width: 80%;
width: 0%;
border-radius: 0px;
background-color: darkcyan;
}
@ -110,4 +110,48 @@ animation:fade 1000ms infinite;
width: 100vw;
font-size: x-large;
font-family: sans-serif;
}
}
:root {
--my-end-left: 99%;
--my-end-top: 99%;
}
#moveClock {
font-size: 6em;
font-family: sans-serif;
position: absolute;
-webkit-animation: moveX 40s linear 0s infinite alternate, moveY 45s linear 0s infinite alternate;
-moz-animation: moveX 40s linear 0s infinite alternate, moveY 45s linear 0s infinite alternate;
-o-animation: moveX 40s linear 0s infinite alternate, moveY 45s linear 0s infinite alternate;
animation: moveX 40s linear 0s infinite alternate, moveY 45s linear 0s infinite alternate;
transition: all 0.8s ease;
}
@-webkit-keyframes moveX {
from { left: 0; } to { left: var(--my-end-left) }
}
@-moz-keyframes moveX {
from { left: 0; } to { left: var(--my-end-left); }
}
@-o-keyframes moveX {
from { left: 0; } to { left: var(--my-end-left); }
}
@keyframes moveX {
from { left: 0; } to { left: var(--my-end-left); }
}
@-webkit-keyframes moveY {
from { top: 0; } to { top: var(--my-end-top); }
}
@-moz-keyframes moveY {
from { top: 0; } to { top: var(--my-end-top); }
}
@-o-keyframes moveY {
from { top: 0; } to { top: var(--my-end-top); }
}
@keyframes moveY {
from { top: 0; } to { top: var(--my-end-top); }
}

1
static/favicon.svg Symbolic link
View File

@ -0,0 +1 @@
logo/faviconLogo.svg

View File

@ -1 +0,0 @@
../../node_modules/js-cookie/dist/js.cookie.min.js

View File

@ -1 +0,0 @@
../../node_modules/countdown/countdown.js

View File

@ -1 +0,0 @@
../../node_modules/darkreader/darkreader.js

View File

@ -4,25 +4,28 @@ function convertTimeOffset() {
}
function convertColorSegments(elementId) {
const raw = document.getElementById(elementId);
console.log(raw)
const segmentData = {}
for (elm in raw.children) {
if (raw.children[elm].nodeName == "TBODY") {
const child = raw.children[elm].firstChild.childNodes
segmentData[child[0].innerText] = child[2].firstChild.value
if (raw.children[elm].nodeName == "TR") {
const child = raw.children[elm].children[1].children[0]
let timeVal = parseInt(raw.children[elm].children[0].children[0].value * 1000);
if (Number.isInteger(timeVal)) {
segmentData[timeVal] = child.style.color
} else {
segmentData["START"] = child.style.color
}
}
}
console.info(segmentData)
return (segmentData)
}
$(document).ready(function () {
$(".numVal").bind("DOMSubtreeModified", alert);
$(function () {
// $(".numVal").bind("DOMSubtreeModified", alert);
const modes = ["timer", "clock", "black", "test"]
const modes = ["timer", "clock", "black", "test", "screensaver"]
let selectPresetTime = 0;
if (Cookies.get("interfaceColor") != undefined) {
@ -37,95 +40,180 @@ $(document).ready(function () {
}
}
saveOption("/api/v1/system", function systemInfo(event) {
const dataSystem = JSON.parse(event.originalTarget.response)
saveOption("/api/v1/system", function systemInfoLoader(event) {
const dataSystem = JSON.parse(event.target.response)
document.getElementById("nodejsVers").innerHTML = dataSystem.nodeVersion
document.getElementById("nodeSwVers").innerHTML = dataSystem.systemVersion
const tree2 = jsonview.create(dataSystem);
jsonview.render(tree2, document.getElementById("systemInfo"));
jsonview.expand(tree2);
// console.log(dataSystem)
})
$("#addRow").click(function (event) {
$("#colors1").append(
'<tr>' +
'<td contenteditable="true" class="time"></td>' +
'<td contenteditable="true" class="color full"><input id="demo-input1" "type="text" value="#COLOR#" data-coloris /></td></td>' +
'<td><button type="button" class="btn btn-danger btn-rounded btn-sm my-0 deleteRow1">Remove</button></td>' +
'</tr>'
);
$("#applyLang").on("click", function (event) {
const lang = $("#lang").val()
saveOption("/api/ui/v1/lang/set?lang=" + lang, function handleLangSelect(event, xmlHttp) {
const temp = JSON.parse(xmlHttp.responseText)
if(temp.status == "error") {
alert("Request failed reason: " + temp.reason)
} else {
location.reload()
}
console.log(JSON.parse(xmlHttp.responseText))
})
})
$("#addRow").on("click", function (event) {
const tableEntryDom = document.getElementById("tableCopySource").cloneNode(true)
let temp = tableEntryDom.innerHTML
temp = temp.replace("#COLOR#", "gray");
temp = temp.replace("#bg-COLOR#", "gray");
temp = temp.replace("#VALUE#", 60); // BUG: Doesn't work but not too important
temp = temp.replace("timeValue-ID", Math.floor(Math.random() * 9999999))
tableEntryDom.innerHTML = temp;
tableEntryDom.firstChild.nextSibling.children[0].classList.add("timeDurPicker")
tableEntryDom.id = Math.floor(Math.random() * 9999999)
document.getElementById("colors1").appendChild(tableEntryDom)
$(".deleteRow1").on("click", function removeRowEntry(event) {
$(event.target).closest("tr").remove();
});
$('.timeDurPicker').durationPicker({
showSeconds: true,
showDays: false,
onChanged: function (newVal, test, val2) {
// $('#duration-label2').text(newVal);
val2.days[0].parentElement.parentElement.parentElement.parentElement.children[1].value = newVal
//console.log(val2.days[0].parentElement.parentElement.parentElement.parentElement.children[1].value)
//console.log(val2.days[0].parentElement.parentElement.parentElement.parentElement.children[1])
}
});
});
$("#addRow2").click(function (event) {
$("#colors2").append(
'<tr>' +
'<td contenteditable="true" class="time"></td>' +
'<td contenteditable="true" class="color full"><input id="demo-input2" type="text" value="#COLOR#" data-coloris /></td></td>' +
'<td><button type="button" class="btn btn-danger btn-rounded btn-sm my-0 deleteRow1">Remove</button></td>' +
'</tr>'
);
$("#addRow2").on("click", function (event) {
const tableEntryDom = document.getElementById("tableCopySource").cloneNode(true)
let temp = tableEntryDom.innerHTML
temp = temp.replace("#COLOR#", "gray");
temp = temp.replace("#bg-COLOR#", "gray");
temp = temp.replace("#VALUE#", 60); // BUG: Doesn't work but not too important
temp = temp.replace("timeValue-ID", Math.floor(Math.random() * 9999999))
tableEntryDom.innerHTML = temp;
tableEntryDom.firstChild.nextSibling.children[0].classList.add("timeDurPicker")
tableEntryDom.id = Math.floor(Math.random() * 9999999)
document.getElementById("colors2").appendChild(tableEntryDom)
$(".deleteRow1").on("click", function removeRowEntry(event) {
$(event.target).closest("tr").remove();
});
$('.timeDurPicker').durationPicker({
showSeconds: true,
showDays: false,
onChanged: function (newVal, test, val2) {
// $('#duration-label2').text(newVal);
val2.days[0].parentElement.parentElement.parentElement.parentElement.children[1].value = newVal
}
});
});
// Restore settings
saveOption("/api/v1/data", function (event, xmlHttp) {
const tableEntry = ' <tr><td class="pt-3-half numVal" contenteditable="true">#VALUE#</td>\
<td class="pt-3-half full" contenteditable="false"> \
<div class="clr-field" style="color: #bg-COLOR#;"> \
<button aria-labelledby="clr-open-label"></button> \
<input id="demo-input1" type="text" class="coloris" value="#COLOR#"></div> \
</div> \
<td>\
<span class="table-remove"><button type="button"\
class="btn btn-danger btn-rounded btn-sm my-0 deleteRow1">\
Remove\
</button></span>\
</td></tr>'
const jsonResult = JSON.parse(xmlHttp.response)
//.innerHTML = JSON.stringify(jsonResult, null, 4)
const tree = jsonview.create(jsonResult);
jsonview.render(tree, document.getElementById("responeSnippet"));
jsonview.expand(tree);
// Restore mode radio
const currentModeInt = modes.indexOf(jsonResult.mode);
$("#btnradio" + (currentModeInt + 1))[0].checked = true
// Restore layout settings
$("#showTime")[0].checked = jsonResult.showTimeOnCountdown;
$("#showMillis")[0].checked = jsonResult.showMilliSeconds;
$("#progBarShow")[0].checked = jsonResult.showProgressbar;
$("#textColors")[0].checked = jsonResult.enableColoredText;
$("#allowOverrun")[0].checked = jsonResult.enableOverrun;
console.log(document.getElementById("tableCopySource"))
let tableEntryDom = document.getElementById("tableCopySource").cloneNode(true)
let currIndex = 0
for (item in jsonResult.colorSegments) {
let temp = tableEntry.replace("#VALUE#", item);
tableEntryDom = document.getElementById("tableCopySource").cloneNode(true)
let temp = tableEntryDom.innerHTML
temp = temp.replace("#COLOR#", jsonResult.colorSegments[item]);
temp = temp.replace("#bg-COLOR#", jsonResult.colorSegments[item]);
document.getElementById("colors1").innerHTML += temp
//console.log(jsonResult.colorSegments[item])
temp = temp.replace("timeValue-ID", "timeValue-1C" + currIndex)
if (item != "START") {
temp = temp.replace("#VALUE#", item / 1000);
tableEntryDom.innerHTML = temp;
tableEntryDom.firstChild.nextSibling.children[0].classList.add("timeDurPicker")
} else {
tableEntryDom.innerHTML = temp;
tableEntryDom.children[2].children[0].children[0].disabled = true;
tableEntryDom.children[2].children[0].setAttribute("data-toggle", "tooltip")
tableEntryDom.children[2].children[0].setAttribute("data-placement", "right")// 'data-placement="right" title="Tooltip on right"'
tableEntryDom.children[2].children[0].setAttribute("title", "You cannot delete the start time")
tableEntryDom.children[0].innerHTML = '<i class="bi bi-flag-fill"></i> Start'
}
tableEntryDom.id = "1C" + currIndex
tableEntryDom.style.display = "table-row"
document.getElementById("colors1").appendChild(tableEntryDom)
currIndex++;
}
// Text colors
currIndex = 0
for (item in jsonResult.textColors) {
let temp = tableEntry.replace("#VALUE#", item);
tableEntryDom = document.getElementById("tableCopySource").cloneNode(true)
let temp = tableEntryDom.innerHTML
temp = temp.replace("#COLOR#", jsonResult.textColors[item]);
temp = temp.replace("#bg-COLOR#", jsonResult.textColors[item]);
document.getElementById("colors2").innerHTML += temp
//console.log(jsonResult.textColors[item])
temp = temp.replace("timeValue-ID", "timeValue-1C" + currIndex)
if (item != "START") {
temp = temp.replace("#VALUE#", item / 1000);
tableEntryDom.innerHTML = temp;
tableEntryDom.firstChild.nextSibling.children[0].classList.add("timeDurPicker")
} else {
tableEntryDom.innerHTML = temp;
tableEntryDom.children[2].children[0].children[0].disabled = true;
tableEntryDom.children[2].children[0].setAttribute("data-toggle", "tooltip")
tableEntryDom.children[2].children[0].setAttribute("data-placement", "right")// 'data-placement="right" title="Tooltip on right"'
tableEntryDom.children[2].children[0].setAttribute("title", "You cannot delete the start time")
tableEntryDom.children[0].innerHTML = '<i class="bi bi-flag-fill"></i> Start'
}
// timeDurPicker
tableEntryDom.id = "1C" + currIndex
tableEntryDom.style.display = "table-row"
document.getElementById("colors2").appendChild(tableEntryDom)
currIndex++;
}
$('.timeDurPicker').durationPicker({
showSeconds: true,
showDays: false,
onChanged: function (newVal, test, val2) {
val2.days[0].parentElement.parentElement.parentElement.parentElement.children[1].value = newVal
}
});
//console.debug(jsonResult, currentModeInt)
$('.colorPicky').on('colorpickerChange', function (event) {
event.target.parentElement.style.backgroundColor = event.target.value
});
$(".deleteRow1").on("click", function removeRowEntry(event) {
//console.warn(event.target.parentElement)
$(event.target).closest("tbody").remove();
$(event.target).closest("tr").remove();
});
$('[data-toggle="tooltip"]').tooltip({ container: "body" })
})
$("#copyColors").click(function CopyTextColors(event) {
@ -150,18 +238,15 @@ $(document).ready(function () {
}
Cookies.set("interfaceColor", darkid)
});
// Presets
$(".pres").click(function (event) {
currentTime = parseInt(event.currentTarget.value)
const times = msToTime(currentTime)
$("#timerHoursV")[0].innerHTML = times[3];
$("#timerMinuteV")[0].innerHTML = times[2];
$("#timerSecondsV")[0].innerHTML = times[1];
$("#customValue").data("durationPicker").setValue(currentTime / 1000)
})
$(".goTimer").click(function (event) {
$(".goTimer").on("click", function (event) {
event.currentTarget.innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
setTimeout(function () {
event.currentTarget.innerHTML = 'Go'
@ -175,13 +260,14 @@ $(document).ready(function () {
$("#applyLayout").click(function (event) {
$("#applyLayout")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
// Collect all data, build all paths3
// Collect all data, build all paths
const allPathes = [];
const showTimeB = $("#showTime")[0].checked
const showMillisB = $("#showMillis")[0].checked
const progBarShowB = $("#progBarShow")[0].checked
const textColorsB = $("#textColors")[0].checked
const allowOverrun = $("#allowOverrun")[0].checked
const colors = convertColorSegments("colors1")
const colors2 = convertColorSegments("colors2")
@ -192,6 +278,8 @@ $(document).ready(function () {
allPathes.push("/api/v1/set/text/enableColoring?enable=" + textColorsB)
allPathes.push("/api/v1/set/progressbar/colors?isBase64=true&colors=" + btoa(JSON.stringify(colors)))
allPathes.push("/api/v1/set/text/colors?isBase64=true&colors=" + btoa(JSON.stringify(colors2)))
allPathes.push("/api/v1/set/enableOverrun?enable=" + allowOverrun)
for (pI in allPathes) {
@ -217,11 +305,13 @@ $(document).ready(function () {
const showMillisB = $("#showMillis")[0].checked
const progBarShowB = $("#progBarShow")[0].checked
const textColorsB = $("#textColors")[0].checked
const allowOverrun = $("#allowOverrun")[0].checked
allPathes.push("/api/v1/set/layout/showTime?persist=true&show=" + showTimeB)
allPathes.push("/api/v1/set/layout/showMillis?persist=true&show=" + showMillisB)
allPathes.push("/api/v1/set/progressbar/show?persist=true&show=" + progBarShowB)
allPathes.push("/api/v1/set/text/enableColoring?persist=true&enable=" + textColorsB)
allPathes.push("/api/v1/set/enableOverrun?persist=true&enable=" + allowOverrun)
for (pI in allPathes) {
const path = allPathes[pI];
@ -265,7 +355,7 @@ $(document).ready(function () {
})
$("#timerHourDec").click(function (event) {
if (currentTime > 3600000) {
if (currentTime >= 3600000) {
currentTime -= 3600000
const times = msToTime(currentTime)
$("#timerHoursV")[0].innerHTML = times[3];
@ -282,7 +372,7 @@ $(document).ready(function () {
$("#timerSecondsV")[0].innerHTML = times[1];
})
$("#timerMinuteDec").click(function (event) {
if (currentTime > 60000) {
if (currentTime >= 60000) {
currentTime -= 60000
const times = msToTime(currentTime)
$("#timerHoursV")[0].innerHTML = times[3];
@ -298,7 +388,7 @@ $(document).ready(function () {
$("#timerSecondsV")[0].innerHTML = times[1];
})
$("#timerSecondsDec").click(function (event) {
if (currentTime > 1000) {
if (currentTime >= 1000) {
currentTime -= 1000
const times = msToTime(currentTime)
$("#timerHoursV")[0].innerHTML = times[3];
@ -313,9 +403,7 @@ $(document).ready(function () {
console.log(value, parseInt(event.currentTarget.id.replace("btnradio", "")))
saveOption("/api/v1/set/mode?mode=" + value, function (event) {
setTimeout(function () {
$("#sendMessage")[0].innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-send" viewBox="0 0 16 16"> \
<path d="M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"/> \
</svg>'
$("#sendMessage")[0].innerHTML = '<i class="bi bi-send"></i>'
}, 200)
})
@ -327,9 +415,7 @@ $(document).ready(function () {
let value = $("#messageContent").val()
saveOption("/api/v1/ctrl/message/show?msg=" + value, function (event) {
setTimeout(function () {
$("#sendMessage")[0].innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-send" viewBox="0 0 16 16"> \
<path d="M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"/> \
</svg>'
$("#sendMessage")[0].innerHTML = '<i class="bi bi-send"></i>'
}, 200)
})
@ -339,10 +425,7 @@ $(document).ready(function () {
$("#ctrlRemoveMessage")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
saveOption("/api/v1/ctrl/message/hide", function (event) {
setTimeout(function () {
$("#ctrlRemoveMessage")[0].innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash-fill" viewBox="0 0 16 16">\
<path d="m10.79 12.912-1.614-1.615a3.5 3.5 0 0 1-4.474-4.474l-2.06-2.06C.938 6.278 0 8 0 8s3 5.5 8 5.5a7.029 7.029 0 0 0 2.79-.588zM5.21 3.088A7.028 7.028 0 0 1 8 2.5c5 0 8 5.5 8 5.5s-.939 1.721-2.641 3.238l-2.062-2.062a3.5 3.5 0 0 0-4.474-4.474L5.21 3.089z"/>\
<path d="M5.525 7.646a2.5 2.5 0 0 0 2.829 2.829l-2.83-2.829zm4.95.708-2.829-2.83a2.5 2.5 0 0 1 2.829 2.829zm3.171 6-12-12 .708-.708 12 12-.708.708z"/>\
</svg>'
$("#ctrlRemoveMessage")[0].innerHTML = '<i class="bi bi-eye-slash-fill"></i>'
}, 200)
})
@ -352,7 +435,7 @@ $(document).ready(function () {
$("#funcPlay")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
saveOption("/api/v1/ctrl/timer/play", function (event) {
setTimeout(function () {
$("#funcPlay")[0].innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 16 16"><path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"></path></svg>'
$("#funcPlay")[0].innerHTML = '<i class="bi bi-play-fill"></i>'
}, 200);
})
})
@ -363,7 +446,7 @@ $(document).ready(function () {
saveOption("/api/v1/ctrl/timer/pause", function (event) {
setTimeout(function () {
$("#funcPause")[0].innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pause" viewBox="0 0 16 16" style="--darkreader-inline-fill: currentColor;" data-darkreader-inline-fill=""><path d="M6 3.5a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-1 0V4a.5.5 0 0 1 .5-.5zm4 0a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-1 0V4a.5.5 0 0 1 .5-.5z"></path></svg>'
$("#funcPause")[0].innerHTML = '<i class="bi bi-pause"></i>'
}, 200);
})
})
@ -372,7 +455,7 @@ $(document).ready(function () {
$("#funcRestart")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
saveOption("/api/v1/ctrl/timer/restart", function (event) {
setTimeout(function () {
$("#funcRestart")[0].innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-clockwise" viewBox="0 0 16 16" style="--darkreader-inline-fill: currentColor;" data-darkreader-inline-fill=""><path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z"></path><path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z"></path></svg>'
$("#funcRestart")[0].innerHTML = '<i class="bi bi-arrow-clockwise"></i>'
}, 200)
})
})
@ -398,6 +481,30 @@ $(document).ready(function () {
$("#" + event.target.href.split("#")[1]).removeClass("hidden")
// console.log(event.target.href.split("#")[1])
});
$("#customValue").durationPicker({
showSeconds: true,
showDays: false,
onChanged: function (newVal, test, val2) {
currentTime = newVal * 1000
}
})
flatty = flatpickr("#datetimetester", {
enableTime: true,
time_24hr: true,
dateFormat: "H:i d.m.Y",
});
$(".goTimeGoalCountdown").on("click", function handleCountdownToTime() {
const selectTime = flatty.selectedDates[0].getTime()
const timeDiff = selectTime - new Date().getTime()
$(".goTimeGoalCountdown")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
saveOption("/api/v1/set/addMillisToTimer?time=" + timeDiff, function (ev) {
setTimeout(function () {
$(".goTimeGoalCountdown")[0].innerHTML = '<i class="bi bi-check2-circle"></i>'
}, 200);
})
})
});
function saveOption(path, callback) {
@ -410,4 +517,32 @@ function saveOption(path, callback) {
xmlHttp.onloadend = function (event) {
callback(event, xmlHttp)
}
}
navStatus = true
function openNav() {
document.getElementById("navbarToggleExternalContent").style.width = "250px";
document.getElementById("navbarToggleExternalContent").style.opacity = "1";
document.getElementById("navbarToggleExternalContent").style.display = "block";
document.getElementById("navbarToggleExternalContent").style.zIndex = 999999;
document.getElementById("pageCont").style.marginLeft = "0px";
navStatus = true
}
function closeNav() {
document.getElementById("navbarToggleExternalContent").style.width = "0px";
document.getElementById("navbarToggleExternalContent").style.opacity = "0";
document.getElementById("navbarToggleExternalContent").style.display = "none";
document.getElementById("navbarToggleExternalContent").style.zIndex = -999999;
document.getElementById("pageCont").style.marginLeft = "0";
navStatus = false
}
function toogleNav() {
if (navStatus) {
closeNav()
} else {
openNav()
}
}

View File

@ -1 +0,0 @@
../../node_modules/jquery/dist/jquery.min.js

View File

@ -1 +0,0 @@
../../node_modules/moment/dist/moment.js

View File

@ -13,44 +13,44 @@ let lastTime = "00:00:00";
let timerCountdownFirst = true;
socket.onopen = function (e) {
// alert("[open] Connection established");
//alert("Sending to server");
socket.send("new client");
// alert("[open] Connection established");
//alert("Sending to server");
socket.send("new client");
};
socket.onmessage = function (event) {
// alert(`[message] Data received from server: ${event.data}`);
let inData = JSON.parse(event.data)
if (isFirstPacket) {
isFirstPacket = false
dataFame = JSON.parse(event.data);
timeDiff = new Date().getTime() - dataFame.srvTime
} else {
if (inData.sessionToken == dataFame.sessionToken) {
dataFame = JSON.parse(event.data);
timeDiff = new Date().getTime() - dataFame.srvTime
} else {
if (ackdSessionToken == false) {
// alert(`[message] Data received from server: ${event.data}`);
let inData = JSON.parse(event.data)
if (isFirstPacket) {
isFirstPacket = false
dataFame = JSON.parse(event.data);
timeDiff = new Date().getTime() - dataFame.srvTime
} else {
if (inData.sessionToken == dataFame.sessionToken) {
dataFame = JSON.parse(event.data);
timeDiff = new Date().getTime() - dataFame.srvTime
} else {
if (ackdSessionToken == false) {
ackdSessionToken = true
ackdSessionToken = true
if (confirm("Session token mismatch, reload the page?")) {
location.reload();
}
}
}
}
if (confirm("Session token mismatch, reload the page?")) {
location.reload();
}
}
}
}
};
socket.onclose = function (event) {
if (event.wasClean) {
console.log(`[close] Connection closed cleanly, code=${event.code} reason=${event.reason}`);
} else {
// e.g. server process killed or network down
// event.code is usually 1006 in this case
console.error('[close] Connection died');
}
if (event.wasClean) {
console.log(`[close] Connection closed cleanly, code=${event.code} reason=${event.reason}`);
} else {
// e.g. server process killed or network down
// event.code is usually 1006 in this case
console.error('[close] Connection died');
}
};
allowFullscreen = true
@ -58,224 +58,229 @@ let dataFame = {}
let timeDiff = 0
function enterFullscreen(element) {
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
}
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
}
}
function returnData() {
return (JSON.parse(document.getElementById("incomeData").innerHTML))
return (JSON.parse(document.getElementById("incomeData").innerHTML))
}
function percentage(partialValue, totalValue) {
return (100 * partialValue) / totalValue;
return (100 * partialValue) / totalValue;
}
function updateFullscreen() {
if (JSON.parse(document.getElementById("incomeData").innerHTML).defaultFullScreen && allowFullscreen) {
enterFullscreen(document.documentElement)
}
if (JSON.parse(document.getElementById("incomeData").innerHTML).defaultFullScreen && allowFullscreen) {
enterFullscreen(document.documentElement)
}
}
function msToTime(s, data) {
isSmallerThenZero = false
if (s < 0) {
isSmallerThenZero = true
}
isSmallerThenZero = false
if (s < 0) {
isSmallerThenZero = true
}
var ms = s % 1000;
s = (s - ms) / 1000;
var secs = s % 60;
s = (s - secs) / 60;
var mins = s % 60;
var hrs = (s - mins) / 60;
let out = ""
var ms = s % 1000;
s = (s - ms) / 1000;
var secs = s % 60;
s = (s - secs) / 60;
var mins = s % 60;
var hrs = (s - mins) / 60;
let out = ""
if (!data.showMilliSeconds) {
out = ('00' + Math.abs(hrs)).slice(-2) + ':' + ('00' + Math.abs(mins)).slice(-2) + ':' + ('00' + Math.abs(secs)).slice(-2)
} else {
out = ('00' + Math.abs(hrs)).slice(-2) + ':' + ('00' + Math.abs(mins)).slice(-2) + ':' + ('00' + Math.abs(secs)).slice(-2) + '.' + ('000' + Math.abs(ms)).slice(-3)
}
if (!data.showMilliSeconds) {
out = ('00' + Math.abs(hrs)).slice(-2) + ':' + ('00' + Math.abs(mins)).slice(-2) + ':' + ('00' + Math.abs(secs)).slice(-2)
} else {
out = ('00' + Math.abs(hrs)).slice(-2) + ':' + ('00' + Math.abs(mins)).slice(-2) + ':' + ('00' + Math.abs(secs)).slice(-2) + '.' + ('000' + Math.abs(ms)).slice(-3)
}
if (isSmallerThenZero) {
out = "-" + out
}
return out;
if (isSmallerThenZero) {
out = "-" + out
}
return out;
}
function findProgessColor(colors, value) {
const allColors = Object.keys(colors);
let resColor = colors["START"]
for (let color in allColors) {
const currColor = allColors[color]
// console.log(color, currColor, parseInt(currColor), value, colors[String(currColor)], resColor)
if (value <= parseInt(currColor)) {
resColor = colors[String(currColor)]
break
}
}
return (resColor)
const allColors = Object.keys(colors);
let resColor = colors["START"]
for (let color in allColors) {
const currColor = allColors[color]
// console.log(color, currColor, parseInt(currColor), value, colors[String(currColor)], resColor)
if (value <= parseInt(currColor)) {
resColor = colors[String(currColor)]
break
}
}
return (resColor)
}
function requestBackend() {
resp = httpGet("/api/v1/data");
resp.onloadend = function (e) {
if (resp.status == 200) {
resp = resp.responseText;
var data = JSON.parse(resp);
timeDiff = new Date().getTime() - data.srvTime
dataFame = data;
}
}
resp = httpGet("/api/v1/data");
resp.onloadend = function (e) {
if (resp.status == 200) {
resp = resp.responseText;
var data = JSON.parse(resp);
timeDiff = new Date().getTime() - data.srvTime
dataFame = data;
}
}
}
let isSlowed = false
function handleRecovery() {
var img = document.body.appendChild(document.createElement("img"));
img.onload = function () {
location.reload();
};
img.src = "SMPTE_Color_Bars.svg";
var img = document.body.appendChild(document.createElement("img"));
img.onload = function () {
location.reload();
};
img.src = "SMPTE_Color_Bars.svg";
}
let recoInter = -1
function handleUpdate() {
var data = dataFame;
document.getElementById("incomeData").innerHTML = JSON.stringify(data)
document.getElementById("timediff").innerHTML = timeDiff + "<br>" + String(new Date().getTime() - data.srvTime);
if (data.debug) {
document.getElementById("timediff").style.display = "block";
} else {
document.getElementById("timediff").style.display = "none";
}
var data = dataFame;
document.getElementById("incomeData").innerHTML = JSON.stringify(data)
document.getElementById("timediff").innerHTML = timeDiff + "<br>" + String(new Date().getTime() - data.srvTime);
if (data.defaultFullScreen && document.getElementById("initalDate").innerHTML.includes("true") && allowFullscreen) {
enterFullscreen(document.documentElement);
document.getElementById("initalDate").innerHTML = "false"
}
if (data.debug) {
document.getElementById("timediff").style.display = "block";
} else {
document.getElementById("timediff").style.display = "none";
}
if (data.showMessage) {
document.getElementById("overlay").style.display = "block";
document.getElementById("text").innerHTML = data.message
} else {
document.getElementById("overlay").style.display = "none";
}
if (data.defaultFullScreen && document.getElementById("initalDate").innerHTML.includes("true") && allowFullscreen) {
enterFullscreen(document.documentElement);
document.getElementById("initalDate").innerHTML = "false"
}
if (data.showTimeOnCountdown && data.mode == "timer") {
document.getElementById("clockSec").innerHTML = getTime();
} else {
document.getElementById("clockSec").innerHTML = "";
}
if (data.showMessage) {
document.getElementById("overlay").style.display = "block";
document.getElementById("text").innerHTML = data.message
} else {
document.getElementById("overlay").style.display = "none";
}
if (new Date().getTime() - data.messageAppearTime < 5000) {
if (!document.getElementById("text").classList.contains('blink')) {
document.getElementById("text").classList.add("blink")
}
} else {
if (document.getElementById("text").classList.contains('blink')) {
document.getElementById("text").classList.remove("blink")
}
}
if (data.showTimeOnCountdown && data.mode == "timer") {
document.getElementById("clockSec").innerHTML = getTime();
} else {
document.getElementById("clockSec").innerHTML = "";
}
if (new Date().getTime() - data.messageAppearTime < 5000) {
if (!document.getElementById("text").classList.contains('blink')) {
document.getElementById("text").classList.add("blink")
}
} else {
if (document.getElementById("text").classList.contains('blink')) {
document.getElementById("text").classList.remove("blink")
}
}
if (data.mode == "clock") {
document.getElementById("timer").innerHTML = getTime();
document.getElementById("testImg").style.display = "none";
document.getElementById("wholeProgBar").style.display = "none";
document.getElementById("clockSec").innerHTML = "";
document.getElementById("timer").style.color = "white"
timerCountdownFirst = true;
if (data.mode == "clock") {
document.getElementById("timer").innerHTML = getTime();
document.getElementById("testImg").style.display = "none";
document.getElementById("wholeProgBar").style.display = "none";
document.getElementById("clockSec").innerHTML = "";
document.getElementById("timer").style.color = "white"
timerCountdownFirst = true;
} else if (data.mode == "timer") {
document.getElementById("wholeProgBar").style.display = "block";
const now = new Date()
} else if (data.mode == "timer") {
if (data.showProgressbar) {
document.getElementById("wholeProgBar").style.display = "block";
} else {
document.getElementById("wholeProgBar").style.display = "none";
}
if(timerCountdownFirst){
const diff = data.countdownGoal - now.getTime()
timerCountdownFirst = false
document.getElementById("timer").innerHTML = msToTime(diff, data);
if (diff > 0) {
document.getElementById("progBar").style.width = percentage(diff, data.timeAmountInital) + "%";
} else {
document.getElementById("progBar").style.width = "0%";
}
const now = new Date()
document.getElementById("progBar").style.backgroundColor = findProgessColor(data.colorSegments, diff)
document.getElementById("testImg").style.display = "none";
if (data.enableColoredText) {
document.getElementById("timer").style.color = findProgessColor(data.textColors, diff)
} else {
document.getElementById("timer").style.color = "white"
}
}
if (timerCountdownFirst) {
const diff = data.countdownGoal - now.getTime()
timerCountdownFirst = false
document.getElementById("timer").innerHTML = msToTime(diff, data);
if (diff > 0) {
document.getElementById("progBar").style.width = percentage(diff, data.timeAmountInital) + "%";
} else {
document.getElementById("progBar").style.width = "0%";
}
if (data.timerRunState) {
const diff = data.countdownGoal - now.getTime()
document.getElementById("timer").innerHTML = msToTime(diff, data);
lastTime = msToTime(diff, data);
if (diff > 0) {
document.getElementById("progBar").style.width = percentage(diff, data.timeAmountInital) + "%";
} else {
document.getElementById("progBar").style.width = "0%";
}
document.getElementById("progBar").style.backgroundColor = findProgessColor(data.colorSegments, diff)
document.getElementById("testImg").style.display = "none";
if (data.enableColoredText) {
document.getElementById("timer").style.color = findProgessColor(data.textColors, diff)
} else {
document.getElementById("timer").style.color = "white"
}
}
document.getElementById("progBar").style.backgroundColor = findProgessColor(data.colorSegments, diff)
document.getElementById("testImg").style.display = "none";
if (data.enableColoredText) {
document.getElementById("timer").style.color = findProgessColor(data.textColors, diff)
} else {
document.getElementById("timer").style.color = "white"
}
if (data.timerRunState) {
const diff = data.countdownGoal - now.getTime()
document.getElementById("timer").innerHTML = msToTime(diff, data);
lastTime = msToTime(diff, data);
if (diff > 0) {
document.getElementById("progBar").style.width = percentage(diff, data.timeAmountInital) + "%";
} else {
document.getElementById("progBar").style.width = "0%";
}
} else {
document.getElementById("timer").innerHTML = lastTime
}
} else if (data.mode == "black") {
timerCountdownFirst = true;
document.getElementById("timer").innerHTML = "";
document.getElementById("testImg").style.display = "none";
document.getElementById("wholeProgBar").style.display = "none";
document.getElementById("clockSec").innerHTML = "";
document.getElementById("progBar").style.backgroundColor = findProgessColor(data.colorSegments, diff)
document.getElementById("testImg").style.display = "none";
if (data.enableColoredText) {
document.getElementById("timer").style.color = findProgessColor(data.textColors, diff)
} else {
document.getElementById("timer").style.color = "white"
}
} else if (data.mode == "test") {
timerCountdownFirst = true;
document.getElementById("timer").innerHTML = "";
document.getElementById("testImg").style.display = "block";
document.getElementById("progBar").style.display = "none";
document.getElementById("clockSec").innerHTML = "";
}
} else {
document.getElementById("timer").innerHTML = lastTime
}
} else if (data.mode == "black") {
timerCountdownFirst = true;
document.getElementById("timer").innerHTML = "";
document.getElementById("testImg").style.display = "none";
document.getElementById("wholeProgBar").style.display = "none";
document.getElementById("clockSec").innerHTML = "";
} else if (data.mode == "test") {
timerCountdownFirst = true;
document.getElementById("timer").innerHTML = "";
document.getElementById("testImg").style.display = "block";
document.getElementById("progBar").style.display = "none";
document.getElementById("clockSec").innerHTML = "";
}
}
function httpGet(theUrl) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", theUrl, true); // false for synchronous request
xmlHttp.send(null);
xmlHttp.onerror = function (e) {
console.log(e);
};
return xmlHttp;
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", theUrl, true); // false for synchronous request
xmlHttp.send(null);
xmlHttp.onerror = function (e) {
console.log(e);
};
return xmlHttp;
}
function getTime() {
var date = new Date();
var h = date.getHours(); // 0 - 23
var m = date.getMinutes(); // 0 - 59
var s = date.getSeconds(); // 0 - 59
var date = new Date();
var h = date.getHours(); // 0 - 23
var m = date.getMinutes(); // 0 - 59
var s = date.getSeconds(); // 0 - 59
h = h < 10 ? "0" + h : h;
m = m < 10 ? "0" + m : m;
s = s < 10 ? "0" + s : s;
h = h < 10 ? "0" + h : h;
m = m < 10 ? "0" + m : m;
s = s < 10 ? "0" + s : s;
var time = h + ":" + m + ":" + s;
return time;
var time = h + ":" + m + ":" + s;
return time;
}
@ -286,7 +291,7 @@ let temp = new URLSearchParams(window.location.search).get("smaller");
if (temp == "true") {
var cssURL = '/css/smallerTextMod.css';
document.head.innerHTML += '<link rel="stylesheet" href="' + cssURL + '"/>'
allowFullscreen = false
var cssURL = '/css/smallerTextMod.css';
document.head.innerHTML += '<link rel="stylesheet" href="' + cssURL + '"/>'
allowFullscreen = false
}

View File

@ -0,0 +1,284 @@
// References to the HTML elements
let warningBox = document.getElementById("warningBanner");
let timer = document.getElementById("timer");
let testImage = document.getElementById("testImg");
let clockSec = document.getElementById("clockSec");
let timeDiffContainer = document.getElementById("timediff");
let wholeProgressBar = document.getElementById("wholeProgBar");
let progressBar = document.getElementById("progBar");
let overlay = document.getElementById("overlay");
let overlayText = document.getElementById("text");
let screensaverText = document.getElementById("moveClock");
let screensaverClock = document.getElementById("screensaverClock");
// Prepare connection to backend
let socket = new ReconnectingWebSocket("ws://" + location.hostname + ":" + location.port);
// State variables
let ackSessionTokenChange = false; // Wether the user has acknowledged the session token mismatch
let dataFrame = {};
let timeDiffToServer = 0;
let sessionToken = ""; // Our current session token
let defaultToFullscreen = false;
let allowFullscreen = true; // If the system is allowed to go fullscreen
// Scale down the interface if the smaller parameter is set
let smallerFlag = new URLSearchParams(window.location.search).get("smaller");
if (smallerFlag == "true") {
var cssURL = '/css/smallerTextMod.css';
document.head.innerHTML += '<link rel="stylesheet" href="' + cssURL + '"/>';
allowFullscreen = false;
}
// Handle the screensaver to fit the screen
setTimeout(handleDVD, 200);
setTimeout(handleDVD, 400);
document.body.onresize = handleDVD;
// Handle connection event
socket.onopen = function (e) {
socket.send("new client");
};
// Handle connection close event
socket.onclose = function (event) {
warningBox.style.display = "block"; // Show warning banner
if (event.wasClean) {
console.log(`[close] Connection closed cleanly, code=${event.code} reason=${event.reason}`);
} else {
// e.g. server process killed or network down
// event.code is usually 1006 in this case
console.error('[close] Connection died');
}
};
// Handle incoming data
socket.onmessage = function (event) {
// Parse the incoming data as JSON
const inData = JSON.parse(event.data);
// Check if the backend has restarted in the background
if (inData.sessionToken == sessionToken || sessionToken == "") {
dataFrame = JSON.parse(event.data);
// Time difference between the client and the server
timeDiffToServer = new Date().getTime() - dataFrame.srvTime;
if(dataFrame.debug) {
console.log(dataFrame)
timeDiffContainer.innerHTML = timeDiffToServer
timeDiffContainer.style.display = "block"
} else {
timeDiffContainer.style.display = "none"
}
// Process the data
handleUpdate();
} else {
// If the user has not acknowledged the session token mismatch, show a warning
if (!ackSessionTokenChange) {
ackSessionTokenChange = true;
if (confirm("Session token mismatch, reload the page?")) {
location.reload();
}
}
}
};
// Update timer data regularly (every 20ms)
let updateIntervalReference = setInterval(handleUpdate, 20);
// Helper functions
// Get the current time in a HH:MM:SS format
function getTime() {
var date = new Date();
var h = date.getHours(); // 0 - 23
var m = date.getMinutes(); // 0 - 59
var s = date.getSeconds(); // 0 - 59
h = h < 10 ? "0" + h : h;
m = m < 10 ? "0" + m : m;
s = s < 10 ? "0" + s : s;
var time = h + ":" + m + ":" + s;
return time;
}
function percentage(partialValue, totalValue) {
return (100 * partialValue) / totalValue;
}
function msToTime(s, data) {
isSmallerThenZero = false
if (s < 0) {
isSmallerThenZero = true
}
var ms = s % 1000;
s = (s - ms) / 1000;
var secs = s % 60;
s = (s - secs) / 60;
var mins = s % 60;
var hrs = (s - mins) / 60;
let out = ""
if (!data.showMilliSeconds) {
out = ('00' + Math.abs(hrs)).slice(-2) + ':' + ('00' + Math.abs(mins)).slice(-2) + ':' + ('00' + Math.abs(secs)).slice(-2)
} else {
out = ('00' + Math.abs(hrs)).slice(-2) + ':' + ('00' + Math.abs(mins)).slice(-2) + ':' + ('00' + Math.abs(secs)).slice(-2) + '.' + ('000' + Math.abs(ms)).slice(-3)
}
if (isSmallerThenZero) {
out = "-" + out
}
return out;
}
function findProgessColor(colors, value) {
const allColors = Object.keys(colors);
let resColor = colors["START"]
for (let color in allColors) {
const currColor = allColors[color]
if (value <= parseInt(currColor)) {
resColor = colors[String(currColor)]
break
}
}
return (resColor)
}
function handleUpdate() {
defaultToFullscreen = dataFrame.defaultFullScreen;
switch (dataFrame.mode) {
case "timer":
// Timer mode
timer.style.display = "block";
testImage.style.display = "none";
screensaverText.style.display = "none";
if(dataFrame.showTimeOnCountdown) {
// Show time on countdown
clockSec.innerHTML = getTime();
clockSec.style.display = "block";
} else {
clockSec.style.display = "none";
}
if(dataFrame.showProgressbar) {
// Show progressbar
wholeProgressBar.style.display = "block";
} else {
wholeProgressBar.style.display = "none";
}
// Calculate the time difference between the goal and the current time
const now = new Date();
let diff = 0;
if(dataFrame.timerRunState) {
diff = dataFrame.countdownGoal - now.getTime()
} else {
diff = (now.getTime() - dataFrame.pauseMoment) + dataFrame.countdownGoal - now.getTime()
}
timer.innerHTML = msToTime(diff, dataFrame);
// Handle the progressbar
if (diff >= 0) {
progressBar.style.width = percentage(diff, dataFrame.timeAmountInital) + "%";
} else {
progressBar.style.width = "0%";
if(!dataFrame.enableOverrun) {
timer.innerHTML = "00:00:00";
}
}
progressBar.style.backgroundColor = findProgessColor(dataFrame.colorSegments, diff)
// Handle the text color
if (dataFrame.enableColoredText) {
timer.style.color = findProgessColor(dataFrame.textColors, diff)
} else {
timer.style.color = "white"
}
break;
case "clock":
// Clock mode
timer.innerHTML = getTime();
testImage.style.display = "none";
clockSec.style.display = "none";
wholeProgressBar.style.display = "none";
timer.style.display = "block";
screensaverText.style.display = "none";
timer.style.color = "white";
break;
case "black":
// Black screen mode
testImage.style.display = "none";
clockSec.style.display = "none";
wholeProgressBar.style.display = "none";
timer.style.display = "none";
screensaverText.style.display = "none";
timer.style.color = "white";
break;
case "test":
// Test image mode
testImage.style.display = "block";
clockSec.style.display = "none";
wholeProgressBar.style.display = "none";
timer.style.display = "none";
screensaverText.style.display = "none";
timer.style.color = "white";
break;
case "screensaver":
// Screensaver mode
testImage.style.display = "none";
clockSec.style.display = "none";
wholeProgressBar.style.display = "none";
timer.style.display = "none";
timer.style.color = "white";
screensaverText.style.display = "block";
screensaverClock.innerHTML = getTime();
break;
}
// Handle the message overlay
if (dataFrame.showMessage) {
overlay.style.display = "block";
overlayText.innerHTML = dataFrame.message
} else {
overlay.style.display = "none";
}
// This will result in the text fading in and out when the message changes
if (new Date().getTime() - dataFrame.messageAppearTime < 5000) {
if (!overlayText.classList.contains('blink')) {
overlayText.classList.add("blink")
}
} else {
if (overlayText.classList.contains('blink')) {
overlayText.classList.remove("blink")
}
}
}
function handleDVD() {
console.info("Recalculating screensaver size")
const objHeight = document.body.offsetHeight - screensaverText.offsetHeight;
const objWidth = document.body.offsetWidth - screensaverText.offsetWidth;
document.documentElement.style.setProperty('--my-end-left', objWidth + "px");
document.documentElement.style.setProperty('--my-end-top', objHeight + "px");
}
function enterFullscreen(element) {
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
}
}
function updateFullscreen() {
if (defaultToFullscreen && allowFullscreen) {
enterFullscreen(document.documentElement)
}
}

BIN
static/logo/faviconLogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

4578
static/logo/faviconLogo.svg Normal file

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 151 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 145 KiB

4631
static/logo/logoProposal.svg Normal file

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 145 KiB

View File

@ -1 +0,0 @@
../../node_modules/mdbootstrap/css/

View File

@ -1 +0,0 @@
../../node_modules/mdbootstrap/js

View File

@ -1,94 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>openCountdown - Admin</title>
<meta name="description" content="openCountdown">
<meta name="author" content="TheGreydiamond">
<link rel="stylesheet" href="css/styles.css?v=1.1">
</head>
<body>
<form action="/api/v1/set/mode" target="hiddenFrame">
<select id="mode" name="mode">
<option value="timer">Timer</option>
<option value="clock">Clock</option>
<option value="black">Black</option>
<option value="test">Test</option>
</select>
<button type="submit">Submit</button>
</form>
<br>
<form action="/api/v1/set/layout/showMillis" target="hiddenFrame">
<select id="show" name="show">
<option value="true">Enable Milliseconds</option>
<option value="false">Disable Milliseconds</option>
</select>
<button type="submit">Submit</button>
</form>
<form action="/api/v1/set/layout/showTime" target="hiddenFrame">
<select id="show" name="show">
<option value="true">Show Clock on Countdown page</option>
<option value="false">Do not show Clock on Countdown page</option>
</select>
<button type="submit">Submit</button>
</form>
<form action="/api/v1/set/addMillisToTimer" target="hiddenFrame">
<input type="time" step="0.001" name="time2" id="time2" onchange="updateHiddenForm()"></input>
<input type="hidden" step="0.001" name="time" id="time"></input>
<button type="submit">Submit</button>
</form>
<form action="/api/v1/set/addMillisToTimer" target="hiddenFrame">
<select id="time" name="time" onchange="">
<option value="20000">debug 1 (20 secs)</option>
<option value="300000">00:05:00</option>
<option value="600000">00:10:00</option>
<option value="900000">00:15:00</option>
<option value="1200000">00:20:00</option>
<option value="1500000">00:25:00</option>
<option value="1800000">00:30:00</option>
<option value="2100000">00:35:00</option>
<option value="2400000">00:40:00</option>
<option value="2700000">00:45:00</option>
</select>
<button type="submit">Submit</button>
</form>
Play controls:
<form action="/api/v1/ctrl/timer/play" target="hiddenFrame">
<button type="submit">Play</button>
</form>
<form action="/api/v1/ctrl/timer/pause" target="hiddenFrame">
<button type="submit">Pause</button>
</form>
<form action="/api/v1/ctrl/timer/restart" target="hiddenFrame">
<button type="submit">Restart</button>
</form>
Message:
<form action="/api/v1/ctrl/message/show" target="hiddenFrame">
<input type="text" name="msg">
<button type="submit">Submit</button>
</form>
<form action="/api/v1/ctrl/message/hide" target="hiddenFrame">
<button type="submit">Hide</button>
</form>
<iframe name="hiddenFrame" style="display: none"></iframe>
<iframe src="/timer?smaller=true" height="80%" width="80%"> </iframe>
</body>
<script src="js/interface.js"></script>
</html>

View File

@ -0,0 +1,139 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>openCountdown - Admin</title>
<meta name="description" content="openCountdown">
<meta name="author" content="TheGreydiamond">
<link rel="stylesheet" href="/assets/bootstrap-icons/font/bootstrap-icons.css">
<link rel="stylesheet" href="/assets/mdbootstrap/css/style.css">
<script src="/assets/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="/assets/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="/mdbootstrap/js/mdb.min.js"></script>
<script type="text/javascript" src="/js/darkreader.js"></script>
<script type="text/javascript" src="/assets/js-cookie/dist/js.cookie.min.js"></script>
<link href="/assets/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/mainStyle.css" rel="stylesheet">
<link rel="stylesheet" href="/coloris/coloris.min.css" />
<link rel="stylesheet" href="/assets/bootstrap-duration-picker/dist/bootstrap-duration-picker.css" />
<link rel="stylesheet" href="/assets/flatpickr/dist/flatpickr.min.css" />
<script src="/assets/bootstrap-duration-picker/dist/bootstrap-duration-picker-debug.js"></script>
<script src="/coloris/coloris.min.js"></script>
<script type="text/javascript" src="/assets/flatpickr/dist/flatpickr.js"> </script>
<link rel="icon" href="/logo/favicon.svg" type="image/svg+xml">
</head>
<body>
<main>
<div class="d-flex flex-column flex-shrink-0 p-3 text-white bg-dark trans" style="width: 250px;"
id="navbarToggleExternalContent">
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-white text-decoration-none">
<svg class="bi me-2" width="40" height="32">
<use xlink:href="#bootstrap" />
</svg>
<span class="fs-4">Sidebar</span>
</a>
<hr>
<ul class="nav nav-pills flex-column mb-auto">
<li class="nav-item">
<a href="#homeP" class="nav-link active" aria-current="page" id="PageIndex">
<i class="bi bi-house-door"></i>
Home
</a>
</li>
</ul>
<hr>
openCountdown <div class="btn-group" role="group" aria-label="Basic radio toggle button group">
<input type="radio" class="btn-check" name="btnradio2" id="Mbtnradio1" autocomplete="off" checked>
<label class="btn btn-outline-primary" for="Mbtnradio1"><svg xmlns="http://www.w3.org/2000/svg"
width="16" height="16" fill="currentColor" class="bi bi-brightness-high-fill"
viewBox="0 0 16 16">
<path
d="M12 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z" />
</svg>
</label>
<input type="radio" class="btn-check" name="btnradio2" id="Mbtnradio2" autocomplete="off">
<label class="btn btn-outline-primary" for="Mbtnradio2">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-moon-fill" viewBox="0 0 16 16">
<path
d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z" />
</svg>
</label>
<input type="radio" class="btn-check" name="btnradio2" id="Mbtnradio3" autocomplete="off">
<label class="btn btn-outline-primary" for="Mbtnradio3">
Auto
</label>
</div>
</div>
<pages class="d-flex flex-fill" id="pageCont" class="z-index: 50;">
<page id="homeP" class="pageC flex-fill overflow-auto">
<div class="container">
<div class=""
style=" display: flex;align-items: center;justify-content: center; flex-wrap: wrap; flex-direction: column;">
<h1>Oh no!</h1>
<h1>
<i class="bi bi-translate"></i>
</h1>
<h5>
There is a critical error with the current language template. Please select a diffrent
language.
</h5>
<label for="lang">Please choose a language: </label>
<select name="lang" id="lang">
<% it.additional.languages.forEach(function(lang){ %>
<option value="<%= lang %>">
<%= lang %>
</option>
<% }) %>
</select>
<button id="applyLang" class="btn btn-outline-success">
Apply & Reload
</button>
</div>
</div>
</page>
</pages>
</main>
<script type="text/javascript" src="/js/jsonview.js"></script>
<script type="text/javascript" src="/js/interface.js"> </script>
<script type="text/javascript">
$("#applyLang").on("click", function (event) {
const lang = $("#lang").val()
saveOption("/api/ui/v1/lang/set?lang=" + lang, function handleLangSelect(event, xmlHttp) {
const temp = JSON.parse(xmlHttp.responseText)
if (temp.status == "error") {
alert("Request failed reason: " + temp.reason)
} else {
location.reload()
}
console.log(JSON.parse(xmlHttp.responseText))
})
})
</script>
</body>
</html>

View File

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>openCountdown - Not found</title>
<meta name="description" content="openCountdown">
<meta name="author" content="TheGreydiamond">
<script type="text/javascript" src="/assets/js-cookie/dist/js.cookie.min.js"></script>
<link rel="stylesheet" href="/assets/bootstrap-icons/font/bootstrap-icons.css">
<link rel="stylesheet/less" type="text/css" href="/css/errorPage/styles.less" />
<script>
less = {
javascriptEnabled: true
};
</script>
<script src="/assets/less/dist/less.min.js"></script>
<link rel="stylesheet" href="/css/errorPage/style.css">
</head>
<body>
<div class="container">
<h1 class="rainbow">
<div class="glitch" data-text="404">
404
</div>
</h1>
<h2 class="color-foreground">
We're sorry, the page you were looking for isn't found here.<br>
The link you followed may either be broken or no longer exists. Please
check your spelling.<br>
<a href="/"><i class="bi bi-house-door"></i> Back home</a>
</h2>
</div>
</body>
</html>

View File

@ -10,132 +10,66 @@
<meta name="author" content="TheGreydiamond">
<link rel="stylesheet" href="/css/bootstrap-icons.css">
<link rel="stylesheet" href="/mdbootstrap/css/style.css">
<link rel="stylesheet" href="/assets/bootstrap-icons/font/bootstrap-icons.css">
<link rel="stylesheet" href="/assets/mdbootstrap/css/style.css">
<script src="/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/mdbootstrap/js/mdb.min.js"></script>
<script src="/assets/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="/assets/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="/assets/mdbootstrap/js/mdb.min.js"></script>
<script type="text/javascript" src="/js/darkreader.js"></script>
<script type="text/javascript" src="/js/cookie.js"></script>
<link href="/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="/assets/darkreader/darkreader.js"></script>
<script type="text/javascript" src="/assets/js-cookie/dist/js.cookie.min.js"></script>
<link href="/assets/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/mainStyle.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/mdbassit/Coloris@latest/dist/coloris.min.css"/>
<script src="https://cdn.jsdelivr.net/gh/mdbassit/Coloris@latest/dist/coloris.min.js"></script>
<link rel="stylesheet" href="/coloris/coloris.min.css" />
<link rel="stylesheet" href="/assets/bootstrap-duration-picker/dist/bootstrap-duration-picker.css" />
<link rel="stylesheet" href="/assets/flatpickr/dist/flatpickr.min.css" />
<script src="/assets/bootstrap-duration-picker/dist/bootstrap-duration-picker-debug.js"></script>
<script src="/coloris/coloris.min.js"></script>
<script type="text/javascript" src="/assets/flatpickr/dist/flatpickr.js"> </script>
<link rel="icon" href="/logo/faviconLogo.svg" type="image/svg+xml">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="bootstrap" viewBox="0 0 118 94">
<title>Bootstrap</title>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M24.509 0c-6.733 0-11.715 5.893-11.492 12.284.214 6.14-.064 14.092-2.066 20.577C8.943 39.365 5.547 43.485 0 44.014v5.972c5.547.529 8.943 4.649 10.951 11.153 2.002 6.485 2.28 14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893 11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624 10.943-11.153v-5.972c-5.547-.529-8.934-4.649-10.943-11.153-2.002-6.484-2.28-14.437-2.066-20.577C105.214 5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2 2 0 01-2-2V24a2 2 0 012-2h18.437c9.083 0 15.044 4.92 15.044 12.474 0 5.302-4.01 10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884 0 10.68-2.772 10.68-7.727 0-4.643-3.264-7.207-9.012-7.207zM49.948 49.2v16.458H60.91c7.167 0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z">
</path>
</symbol>
<symbol id="home" viewBox="0 0 16 16">
<path
d="M8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4.5a.5.5 0 0 0 .5-.5v-4h2v4a.5.5 0 0 0 .5.5H14a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146zM2.5 14V7.707l5.5-5.5 5.5 5.5V14H10v-4a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v4H2.5z" />
</symbol>
<symbol id="speedometer2" viewBox="0 0 16 16">
<path
d="M8 4a.5.5 0 0 1 .5.5V6a.5.5 0 0 1-1 0V4.5A.5.5 0 0 1 8 4zM3.732 5.732a.5.5 0 0 1 .707 0l.915.914a.5.5 0 1 1-.708.708l-.914-.915a.5.5 0 0 1 0-.707zM2 10a.5.5 0 0 1 .5-.5h1.586a.5.5 0 0 1 0 1H2.5A.5.5 0 0 1 2 10zm9.5 0a.5.5 0 0 1 .5-.5h1.5a.5.5 0 0 1 0 1H12a.5.5 0 0 1-.5-.5zm.754-4.246a.389.389 0 0 0-.527-.02L7.547 9.31a.91.91 0 1 0 1.302 1.258l3.434-4.297a.389.389 0 0 0-.029-.518z" />
<path fill-rule="evenodd"
d="M0 10a8 8 0 1 1 15.547 2.661c-.442 1.253-1.845 1.602-2.932 1.25C11.309 13.488 9.475 13 8 13c-1.474 0-3.31.488-4.615.911-1.087.352-2.49.003-2.932-1.25A7.988 7.988 0 0 1 0 10zm8-7a7 7 0 0 0-6.603 9.329c.203.575.923.876 1.68.63C4.397 12.533 6.358 12 8 12s3.604.532 4.923.96c.757.245 1.477-.056 1.68-.631A7 7 0 0 0 8 3z" />
</symbol>
<symbol id="table" viewBox="0 0 16 16">
<path
d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm15 2h-4v3h4V4zm0 4h-4v3h4V8zm0 4h-4v3h3a1 1 0 0 0 1-1v-2zm-5 3v-3H6v3h4zm-5 0v-3H1v2a1 1 0 0 0 1 1h3zm-4-4h4V8H1v3zm0-4h4V4H1v3zm5-3v3h4V4H6zm4 4H6v3h4V8z" />
</symbol>
<symbol id="people-circle" viewBox="0 0 16 16">
<path d="M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0z" />
<path fill-rule="evenodd"
d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm8-7a7 7 0 0 0-5.468 11.37C3.242 11.226 4.805 10 8 10s4.757 1.225 5.468 2.37A7 7 0 0 0 8 1z" />
</symbol>
<symbol id="grid" viewBox="0 0 16 16">
<path
d="M1 2.5A1.5 1.5 0 0 1 2.5 1h3A1.5 1.5 0 0 1 7 2.5v3A1.5 1.5 0 0 1 5.5 7h-3A1.5 1.5 0 0 1 1 5.5v-3zM2.5 2a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 1h3A1.5 1.5 0 0 1 15 2.5v3A1.5 1.5 0 0 1 13.5 7h-3A1.5 1.5 0 0 1 9 5.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zM1 10.5A1.5 1.5 0 0 1 2.5 9h3A1.5 1.5 0 0 1 7 10.5v3A1.5 1.5 0 0 1 5.5 15h-3A1.5 1.5 0 0 1 1 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 9h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3z" />
</symbol>
<symbol id="collection" viewBox="0 0 16 16">
<path
d="M2.5 3.5a.5.5 0 0 1 0-1h11a.5.5 0 0 1 0 1h-11zm2-2a.5.5 0 0 1 0-1h7a.5.5 0 0 1 0 1h-7zM0 13a1.5 1.5 0 0 0 1.5 1.5h13A1.5 1.5 0 0 0 16 13V6a1.5 1.5 0 0 0-1.5-1.5h-13A1.5 1.5 0 0 0 0 6v7zm1.5.5A.5.5 0 0 1 1 13V6a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-.5.5h-13z" />
</symbol>
<symbol id="calendar3" viewBox="0 0 16 16">
<path
d="M14 0H2a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM1 3.857C1 3.384 1.448 3 2 3h12c.552 0 1 .384 1 .857v10.286c0 .473-.448.857-1 .857H2c-.552 0-1-.384-1-.857V3.857z" />
<path
d="M6.5 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-9 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-9 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2z" />
</symbol>
<symbol id="chat-quote-fill" viewBox="0 0 16 16">
<path
d="M16 8c0 3.866-3.582 7-8 7a9.06 9.06 0 0 1-2.347-.306c-.584.296-1.925.864-4.181 1.234-.2.032-.352-.176-.273-.362.354-.836.674-1.95.77-2.966C.744 11.37 0 9.76 0 8c0-3.866 3.582-7 8-7s8 3.134 8 7zM7.194 6.766a1.688 1.688 0 0 0-.227-.272 1.467 1.467 0 0 0-.469-.324l-.008-.004A1.785 1.785 0 0 0 5.734 6C4.776 6 4 6.746 4 7.667c0 .92.776 1.666 1.734 1.666.343 0 .662-.095.931-.26-.137.389-.39.804-.81 1.22a.405.405 0 0 0 .011.59c.173.16.447.155.614-.01 1.334-1.329 1.37-2.758.941-3.706a2.461 2.461 0 0 0-.227-.4zM11 9.073c-.136.389-.39.804-.81 1.22a.405.405 0 0 0 .012.59c.172.16.446.155.613-.01 1.334-1.329 1.37-2.758.942-3.706a2.466 2.466 0 0 0-.228-.4 1.686 1.686 0 0 0-.227-.273 1.466 1.466 0 0 0-.469-.324l-.008-.004A1.785 1.785 0 0 0 10.07 6c-.957 0-1.734.746-1.734 1.667 0 .92.777 1.666 1.734 1.666.343 0 .662-.095.931-.26z" />
</symbol>
<symbol id="cpu-fill" viewBox="0 0 16 16">
<path d="M6.5 6a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3z" />
<path
d="M5.5.5a.5.5 0 0 0-1 0V2A2.5 2.5 0 0 0 2 4.5H.5a.5.5 0 0 0 0 1H2v1H.5a.5.5 0 0 0 0 1H2v1H.5a.5.5 0 0 0 0 1H2v1H.5a.5.5 0 0 0 0 1H2A2.5 2.5 0 0 0 4.5 14v1.5a.5.5 0 0 0 1 0V14h1v1.5a.5.5 0 0 0 1 0V14h1v1.5a.5.5 0 0 0 1 0V14h1v1.5a.5.5 0 0 0 1 0V14a2.5 2.5 0 0 0 2.5-2.5h1.5a.5.5 0 0 0 0-1H14v-1h1.5a.5.5 0 0 0 0-1H14v-1h1.5a.5.5 0 0 0 0-1H14v-1h1.5a.5.5 0 0 0 0-1H14A2.5 2.5 0 0 0 11.5 2V.5a.5.5 0 0 0-1 0V2h-1V.5a.5.5 0 0 0-1 0V2h-1V.5a.5.5 0 0 0-1 0V2h-1V.5zm1 4.5h3A1.5 1.5 0 0 1 11 6.5v3A1.5 1.5 0 0 1 9.5 11h-3A1.5 1.5 0 0 1 5 9.5v-3A1.5 1.5 0 0 1 6.5 5z" />
</symbol>
<symbol id="gear-fill" viewBox="0 0 16 16">
<path
d="M9.405 1.05c-.413-1.4-2.397-1.4-2.81 0l-.1.34a1.464 1.464 0 0 1-2.105.872l-.31-.17c-1.283-.698-2.686.705-1.987 1.987l.169.311c.446.82.023 1.841-.872 2.105l-.34.1c-1.4.413-1.4 2.397 0 2.81l.34.1a1.464 1.464 0 0 1 .872 2.105l-.17.31c-.698 1.283.705 2.686 1.987 1.987l.311-.169a1.464 1.464 0 0 1 2.105.872l.1.34c.413 1.4 2.397 1.4 2.81 0l.1-.34a1.464 1.464 0 0 1 2.105-.872l.31.17c1.283.698 2.686-.705 1.987-1.987l-.169-.311a1.464 1.464 0 0 1 .872-2.105l.34-.1c1.4-.413 1.4-2.397 0-2.81l-.34-.1a1.464 1.464 0 0 1-.872-2.105l.17-.31c.698-1.283-.705-2.686-1.987-1.987l-.311.169a1.464 1.464 0 0 1-2.105-.872l-.1-.34zM8 10.93a2.929 2.929 0 1 1 0-5.86 2.929 2.929 0 0 1 0 5.858z" />
</symbol>
<symbol id="speedometer" viewBox="0 0 16 16">
<path
d="M8 2a.5.5 0 0 1 .5.5V4a.5.5 0 0 1-1 0V2.5A.5.5 0 0 1 8 2zM3.732 3.732a.5.5 0 0 1 .707 0l.915.914a.5.5 0 1 1-.708.708l-.914-.915a.5.5 0 0 1 0-.707zM2 8a.5.5 0 0 1 .5-.5h1.586a.5.5 0 0 1 0 1H2.5A.5.5 0 0 1 2 8zm9.5 0a.5.5 0 0 1 .5-.5h1.5a.5.5 0 0 1 0 1H12a.5.5 0 0 1-.5-.5zm.754-4.246a.389.389 0 0 0-.527-.02L7.547 7.31A.91.91 0 1 0 8.85 8.569l3.434-4.297a.389.389 0 0 0-.029-.518z" />
<path fill-rule="evenodd"
d="M6.664 15.889A8 8 0 1 1 9.336.11a8 8 0 0 1-2.672 15.78zm-4.665-4.283A11.945 11.945 0 0 1 8 10c2.186 0 4.236.585 6.001 1.606a7 7 0 1 0-12.002 0z" />
</symbol>
<symbol id="toggles2" viewBox="0 0 16 16">
<path d="M9.465 10H12a2 2 0 1 1 0 4H9.465c.34-.588.535-1.271.535-2 0-.729-.195-1.412-.535-2z" />
<path
d="M6 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 1a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm.535-10a3.975 3.975 0 0 1-.409-1H4a1 1 0 0 1 0-2h2.126c.091-.355.23-.69.41-1H4a2 2 0 1 0 0 4h2.535z" />
<path d="M14 4a4 4 0 1 1-8 0 4 4 0 0 1 8 0z" />
</symbol>
<symbol id="tools" viewBox="0 0 16 16">
<path
d="M1 0L0 1l2.2 3.081a1 1 0 0 0 .815.419h.07a1 1 0 0 1 .708.293l2.675 2.675-2.617 2.654A3.003 3.003 0 0 0 0 13a3 3 0 1 0 5.878-.851l2.654-2.617.968.968-.305.914a1 1 0 0 0 .242 1.023l3.356 3.356a1 1 0 0 0 1.414 0l1.586-1.586a1 1 0 0 0 0-1.414l-3.356-3.356a1 1 0 0 0-1.023-.242L10.5 9.5l-.96-.96 2.68-2.643A3.005 3.005 0 0 0 16 3c0-.269-.035-.53-.102-.777l-2.14 2.141L12 4l-.364-1.757L13.777.102a3 3 0 0 0-3.675 3.68L7.462 6.46 4.793 3.793a1 1 0 0 1-.293-.707v-.071a1 1 0 0 0-.419-.814L1 0zm9.646 10.646a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708zM3 11l.471.242.529.026.287.445.445.287.026.529L5 13l-.242.471-.026.529-.445.287-.287.445-.529.026L3 15l-.471-.242L2 14.732l-.287-.445L1.268 14l-.026-.529L1 13l.242-.471.026-.529.445-.287.287-.445.529-.026L3 11z" />
</symbol>
<symbol id="chevron-right" viewBox="0 0 16 16">
<path fill-rule="evenodd"
d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z" />
</symbol>
<symbol id="geo-fill" viewBox="0 0 16 16">
<path fill-rule="evenodd"
d="M4 4a4 4 0 1 1 4.5 3.969V13.5a.5.5 0 0 1-1 0V7.97A4 4 0 0 1 4 3.999zm2.493 8.574a.5.5 0 0 1-.411.575c-.712.118-1.28.295-1.655.493a1.319 1.319 0 0 0-.37.265.301.301 0 0 0-.057.09V14l.002.008a.147.147 0 0 0 .016.033.617.617 0 0 0 .145.15c.165.13.435.27.813.395.751.25 1.82.414 3.024.414s2.273-.163 3.024-.414c.378-.126.648-.265.813-.395a.619.619 0 0 0 .146-.15.148.148 0 0 0 .015-.033L12 14v-.004a.301.301 0 0 0-.057-.09 1.318 1.318 0 0 0-.37-.264c-.376-.198-.943-.375-1.655-.493a.5.5 0 1 1 .164-.986c.77.127 1.452.328 1.957.594C12.5 13 13 13.4 13 14c0 .426-.26.752-.544.977-.29.228-.68.413-1.116.558-.878.293-2.059.465-3.34.465-1.281 0-2.462-.172-3.34-.465-.436-.145-.826-.33-1.116-.558C3.26 14.752 3 14.426 3 14c0-.599.5-1 .961-1.243.505-.266 1.187-.467 1.957-.594a.5.5 0 0 1 .575.411z" />
</symbol>
</svg>
<main>
<div class="d-flex flex-column flex-shrink-0 p-3 text-white bg-dark" style="width: 280px;">
<div class="d-flex flex-column flex-shrink-0 p-3 text-white bg-dark trans" style="width: 250px;"
id="navbarToggleExternalContent">
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-white text-decoration-none">
<svg class="bi me-2" width="40" height="32">
<use xlink:href="#bootstrap" />
</svg>
<span class="fs-4">Sidebar</span>
<center>
<img class="bi me-2" width="200" height="128" src="/logo/logoProposal.svg">
</img >
</center>
</a>
<hr>
<ul class="nav nav-pills flex-column mb-auto">
<li class="nav-item">
<a href="#homeP" class="nav-link active" aria-current="page" id="PageIndex">
<svg class="bi me-2" width="16" height="16">
<use xlink:href="#home" />
</svg>
Home
<i class="bi bi-house-door"></i>
<%= it.lang.sidebar.home %>
</a>
</li>
<li>
<a href="#settings" class="nav-link text-white" id="PageSettings">
<i class="bi bi-gear"></i>
<%= it.lang.sidebar.settings %>
</a>
</li>
<li>
<a href="#debug" class="nav-link text-white" id="PageDebug">
<svg class="bi me-2" width="16" height="16">
<use xlink:href="#grid" />
</svg>
Debug
<i class="bi bi-bug"></i>
<%= it.lang.sidebar.debug %>
</a>
</li>
<li>
<a href="#about" class="nav-link text-white" id="PageAbout">
<svg class="bi me-2" width="16" height="16">
<use xlink:href="#people-circle" />
</svg>
About
<i class="bi bi-info-circle"></i>
<%= it.lang.sidebar.about %>
</a>
</li>
</ul>
@ -167,33 +101,64 @@
</div>
</div>
<pages class="d-flex flex-fill">
<pages class="d-flex flex-fill" id="pageCont" class="z-index: 50;">
<div class="">
<button type="button"
class="opacity mx-2 svg-center btn btn-outline-transparent rounded-circle border-0"
onclick="toogleNav()">
<i class="bi bi-list"></i>
</button>
</div>
<page id="homeP" class="pageC flex-fill overflow-auto">
<h1>Home page</h1>
<h1><%= it.lang.titles.home %></h1>
<div class="container">
<div class="row">
<div class="col">
<h3>Preview: </h3>
<iframe src="/timer?smaller=true" height="100%" width="100%"> </iframe>
<h3 class="d-flex"><%= it.lang.titles.preview %> <span class="helperTip" data-placement="right" title="<%= it.lang.hints.previewHint %>" data-toggle="tooltip">
<i class="bi bi-question-circle-fill"></i>
</span>
<div class="ms-auto">
<span class="helperTip" data-placement="right"
title="<%= it.lang.hints.copyHint %>" data-toggle="tooltip">
<button class="btn" onclick="navigator.clipboard.writeText(window.location.toString() + 'timer')">
<i class="bi bi-clipboard"></i>
</button>
</span>
<span class="helperTip" data-placement="right"
title="<%= it.lang.hints.openInNewTab %>" data-toggle="tooltip">
<a href="/timer" class="btn " target="_blank"><i
class="bi bi-box-arrow-up-right"></i></a>
</span>
</div>
</h3>
<iframe src="/timer?smaller=true" height="100%" width="100%" style="min-height: 400px;">
</iframe>
</div>
<div class="col">
<h3>Mode</h3>
<h3><%= it.lang.titles.mode %> <span class="helperTip" data-placement="right"
title="<%= it.lang.hints.selectMode %>" data-toggle="tooltip">
<i class="bi bi-question-circle-fill"></i>
</span></h3>
<div class="btn-group" role="group" aria-label="Basic radio toggle button group">
<input type="radio" class="btn-check" name="btnradio" id="btnradio1" autocomplete="off"
checked>
<label class="btn btn-outline-primary" for="btnradio1">Timer</label>
<label class="btn btn-outline-primary" for="btnradio1"><%= it.lang.others.timer %></label>
<input type="radio" class="btn-check" name="btnradio" id="btnradio2" autocomplete="off">
<label class="btn btn-outline-primary" for="btnradio2">Clock</label>
<label class="btn btn-outline-primary" for="btnradio2"><%= it.lang.others.clock %></label>
<input type="radio" class="btn-check" name="btnradio" id="btnradio3" autocomplete="off">
<label class="btn btn-outline-primary" for="btnradio3">Black</label>
<label class="btn btn-outline-primary" for="btnradio3"><%= it.lang.others.black %></label>
<input type="radio" class="btn-check" name="btnradio" id="btnradio4" autocomplete="off">
<label class="btn btn-outline-primary" for="btnradio4">Testimage</label>
<label class="btn btn-outline-primary" for="btnradio4"><%= it.lang.others.test %></label>
<input type="radio" class="btn-check" name="btnradio" id="btnradio5" autocomplete="off">
<label class="btn btn-outline-primary" for="btnradio5"><%= it.lang.others.screensaver %></label>
</div>
<br>
<br>
@ -224,127 +189,84 @@
<br>
<br>
<br>
<h3><%= it.lang.titles.messaging %> <span class="helperTip" data-placement="right"
title="<%= it.lang.hints.messagingHint %>" data-toggle="tooltip">
<i class="bi bi-question-circle-fill"></i>
</span></h3>
<presets>
<button class="btn btn-outline-secondary m-1 pres" value="300000">00:05:00</button>
<button class="btn btn-outline-secondary m-1 pres" value="600000">00:10:00</button>
<button class="btn btn-outline-secondary m-1 pres" value="900000">00:15:00</button><br>
<button class="btn btn-outline-secondary m-1 pres" value="1200000">00:20:00</button>
<button class="btn btn-outline-secondary m-1 pres" value="1500000">00:25:00</button>
<button class="btn btn-outline-secondary m-1 pres"
value="1800000">00:30:00</button><button
class="btn btn-outline-primary m-1 mt-0 goTimer">Go</button><br>
<button class="btn btn-outline-secondary m-1 pres" value="2100000">00:35:00</button>
<button class="btn btn-outline-secondary m-1 pres" value="2400000">00:40:00</button>
<button class="btn btn-outline-secondary m-1 pres" value="2700000">00:45:00</button>
</presets>
<input type="text" id="messageContent" class="form-control" placeholder="<%= it.lang.placeholders.msgHere %>"
style="width: 50%;">
<br>
<button class="btn btn-outline-primary m-1" id="sendMessage"><i
class="bi bi-send"></i></button>
<button class="btn btn-outline-primary m-1" id="ctrlRemoveMessage">
<i class="bi bi-eye-slash-fill"></i>
</button>
</div>
</div>
</div>
<br><br><br>
<h3>Timer / Messaging</h3>
<h3><%= it.lang.others.timer %></h3>
<div class="container">
<div class="row" style="width: 60%;">
<div class="col">
<h4>H</h4>
<button class="btn btn-outline-secondary" id="timerHourInc">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-plus" viewBox="0 0 16 16">
<path
d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z" />
</svg>
</button><br>
<b id="timerHoursV">0</b><br>
<button class="btn btn-outline-secondary" id="timerHourDec">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-dash" viewBox="0 0 16 16">
<path d="M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8z" />
</svg>
</button>
</div>
<div class="col">
<h4>M</h4>
<button class="btn btn-outline-secondary" id="timerMinuteInc">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-plus" viewBox="0 0 16 16">
<path
d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z" />
</svg>
</button><br>
<b id="timerMinuteV">0</b><br>
<button class="btn btn-outline-secondary" id="timerMinuteDev">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-dash" viewBox="0 0 16 16">
<path d="M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8z" />
</svg>
</button>
</div>
<div class="col">
<h4>S</h4>
<button class="btn btn-outline-secondary" id="timerSecondsInc">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-plus" viewBox="0 0 16 16">
<path
d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z" />
</svg>
</button><br>
<b id="timerSecondsV">0</b><br>
<button class="btn btn-outline-secondary" id="timerSecondsDec">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-dash" viewBox="0 0 16 16">
<path d="M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8z" />
</svg>
</button>
<div class="row">
<presets class="d-inline-flex justify-content-center">
<button class="btn btn-outline-secondary m-1 pres" value="300000">00:05:00</button>
<button class="btn btn-outline-secondary m-1 pres" value="600000">00:10:00</button>
<button class="btn btn-outline-secondary m-1 pres" value="900000">00:15:00</button>
<button class="btn btn-outline-secondary m-1 pres" value="1200000">00:20:00</button>
<button class="btn btn-outline-secondary m-1 pres" value="1500000">00:25:00</button>
<button class="btn btn-outline-secondary m-1 pres" value="1800000">00:30:00</button>
<button class="btn btn-outline-secondary m-1 pres" value="2100000">00:35:00</button>
<button class="btn btn-outline-secondary m-1 pres" value="2400000">00:40:00</button>
<button class="btn btn-outline-secondary m-1 pres" value="2700000">00:45:00</button>
</presets>
<div class="row" style="width: 100%;">
<div class="d-inline-flex justify-content-center p-2 col">
<input type="text" class="form-control m-1" id="customValue">
<button class="btn btn-outline-primary m-1 mt-0 goTimer"><i
class="bi bi-check2-circle"></i></button>
</div>
</div>
<div class="col">
<button class="btn btn-outline-primary m-1 mt-0 goTimer" id="goJogger">Go</button>
</div>
<div class="col">
<div style="border-left:1px solid #000;height:100%"></div>
</div>
<div class="col">
<br>
<input type="text" id="messageContent" class="form-control" style="width: 200%"
placeholder="Message here">
<button class="btn btn-outline-primary m-1" id="sendMessage"><svg
xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-send" viewBox="0 0 16 16">
<path
d="M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z" />
</svg></button>
<button class="btn btn-outline-primary m-1" id="ctrlRemoveMessage">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-eye-slash-fill" viewBox="0 0 16 16">
<path
d="m10.79 12.912-1.614-1.615a3.5 3.5 0 0 1-4.474-4.474l-2.06-2.06C.938 6.278 0 8 0 8s3 5.5 8 5.5a7.029 7.029 0 0 0 2.79-.588zM5.21 3.088A7.028 7.028 0 0 1 8 2.5c5 0 8 5.5 8 5.5s-.939 1.721-2.641 3.238l-2.062-2.062a3.5 3.5 0 0 0-4.474-4.474L5.21 3.089z" />
<path
d="M5.525 7.646a2.5 2.5 0 0 0 2.829 2.829l-2.83-2.829zm4.95.708-2.829-2.83a2.5 2.5 0 0 1 2.829 2.829zm3.171 6-12-12 .708-.708 12 12-.708.708z" />
</svg>
</button>
<h5>
<%= it.lang.titles.countdownToTime %>
</h5>
<div class="row justify-content-center flex-nowrap d-flex" >
<input id="datetimetester" class="form-control input-sm" style="width: 20%;">
<button class="btn btn-outline-primary goTimeGoalCountdown ms-2" style="width: 5%;"><i
class="bi bi-check2-circle"></i></button>
</input>
</div>
</div>
</div>
<hr>
<h3>Layout</h3>
</page>
<label for="showTime">Show clock on Timer:</label>
<page id="settings" class="pageC hidden flex-fill overflow-auto">
<h1><%= it.lang.sidebar.settings %></h1>
<label for="showTime"><%= it.lang.labels.clockOnTimer %></label>
<input type="checkbox" name="showTime" id="showTime"><br>
<label for="showMillis">Show Milliseconds on Timer:</label>
<label for="showMillis"><%= it.lang.labels.showMillis %></label>
<input type="checkbox" name="showMillis" id="showMillis"><br>
<label for="progBarShow">Show progressbar:</label>
<label for="progBarShow"><%= it.lang.labels.showProgress %></label>
<input type="checkbox" name="progBarShow" id="progBarShow"><br>
<label for="allowOverrun"><%= it.lang.labels.allowOverrun %></label>
<input type="checkbox" name="allowOverrun" id="allowOverrun"><br>
<details>
<summary>Progressbar Colors</summary>
<summary><%= it.lang.labels.progbarColors %></summary>
<p>
<div id="table" class="table-editable">
<span class="table-add float-right mb-3 mr-2"><a href="#!" class="text-success"><i
@ -352,9 +274,9 @@
<table class="table table-bordered table-responsive-md table-striped text-center" id="colors1">
<thead>
<tr>
<th class="text-center">Time</th>
<th class="text-center">Color</th>
<th class="text-center">Remove</th>
<th class="text-center"><%= it.lang.labels.time %></th>
<th class="text-center"><%= it.lang.labels.color %></th>
<th class="text-center"><%= it.lang.labels.remove %></th>
</tr>
</thead>
</tbody>
@ -365,19 +287,19 @@
</p>
</details>
<hr>
<label for="textColors">Enable Text Colors:</label>
<label for="textColors"><%= it.lang.labels.enableTextClrs %></label>
<input type="checkbox" name="textColors" id="textColors"><br>
<details>
<summary>Text Colors</summary>
<summary><%= it.lang.labels.textClrs %></summary>
<p>
<div id="table" class="table-editable">
<div id="table2" class="table-editable">
<table class="table table-bordered table-responsive-md table-striped text-center" id="colors2">
<thead>
<tr>
<th class="text-center">Time</th>
<th class="text-center">Color</th>
<th class="text-center">Remove</th>
<th class="text-center"><%= it.lang.labels.time %></th>
<th class="text-center"><%= it.lang.labels.color %></th>
<th class="text-center"><%= it.lang.labels.remove %></th>
</tr>
</thead>
</tbody>
@ -386,69 +308,143 @@
<button type="button" class="btn btn-outline-success" id="copyColors">Copy from progressbar
colors</button>
<button type="button" class="btn btn-outline-success" id="addRow2">Add row</button>
<button type="button" class="btn btn-outline-success" id="addRow2"><%= it.lang.labels.row %></button>
</p>
</details>
<br>
<button type="button" class="btn btn-outline-success" id="applyLayout">Apply settings</button>
<button type="button" class="btn btn-outline-success" id="applyLayout"><i class="bi bi-save"></i> Apply
settings</button>
<button type="button" class="btn btn-outline-success" id="saveLayout">Save as startup settings (Layout
<button type="button" class="btn btn-outline-success" id="saveLayout"><i class="bi bi-save"></i> Save as
startup settings (Layout
only)</button>
<hr>
<h2><%= it.lang.titles.uiSettings %></h2>
<label for="lang"><%= it.lang.labels.language %>:</label>
<select name="lang" id="lang">-
<% it.additional.languages.forEach(function(lang){ %>
<option value="<%= lang %>"><%= lang %></option>
<% }) %>
</select>
<button id="applyLang" class="btn btn-outline-success">
<%= it.lang.labels.apply %>
</button>
</page>
<page id="debug" class="pageC hidden flex-fill overflow-auto">
<h1>Debug page</h1>
<div class="alert alert-warning" role="alert">
<h4 class="alert-heading">Attention</h4>
<p>This is a debug page which should only be used by professionals. Changing any options below might
impact operation.</p>
<div class="alert alert-danger" role="alert">
<h4 class="alert-heading"><%= it.lang.titles.attention %></h4>
<p><%= it.lang.informationTexts.debugInfo %></p>
<hr>
<p class="mb-0">Proceed with caution.</p>
<p class="mb-0"><b><%= it.lang.informationTexts.proceedCaution %></b></p>
</div>
<label for="debugMode">Enable time variance display:</label>
<label for="debugMode"><%= it.lang.labels.timeVar %></label>
<input type="checkbox" name="debugMode" id="debugModeEnable" value="true"><br><br>
<button type="button" class="btn btn-outline-success" id="applyDebug">Apply settings</button>
<br>
<div class="full">
<p>Full size thumbnail</p>
<div class="clr-field" style="color: rgb(255, 204, 0);">
<button aria-labelledby="clr-open-label"></button>
<input type="text" class="coloris" value="#ffcc00"></div>
</div>
<br><br>
<hr>
<br>
<h3><%= it.lang.titles.hostinfo %></h3>
<code id="systemInfo" class="overflow-auto">
</code>
<h3>Raw server reponse</h3>
<code id="responeSnippet" style="width: 40%; display: inline-block;" class="overflow-auto">
</code>
<br>
<hr>
<br>
<templateObj>
<table class="table table-bordered table-responsive-md table-striped text-center" id="colors1">
<thead>
<tr><%= it.lang.labels.time %>
<th class="text-center"><%= it.lang.labels.time %></th>
<th class="text-center"><%= it.lang.labels.color %></th>
<th class="text-center"><%= it.lang.labels.remove %></th>
</tr>
</thead>
<tr id="tableCopySource">
<td contenteditable="false" class="time">
<input type="text" class="form-control " id="timeValue-ID" value="#VALUE#">
<value></value>
</td>
<td class="pt-3-half full" contenteditable="false">
<div class="clr-field" style="color: #bg-COLOR#;">
<button aria-labelledby="clr-open-label"></button>
<input type="text" class="coloris" value="#COLOR#">
</div>
</div>
</td>
<td>
<span class="table-remove"><button type="button"
class="btn btn-danger btn-rounded btn-sm my-0 deleteRow1">
Remove
</button></span>
</td>
</tr>
</tbody>
</table>
<tr>
<td class="pt-3-half numVal" contenteditable="true">#VALUE#</td>
<td class="pt-3-half full" contenteditable="false">
<div class="clr-field" style="color: #bg-COLOR#;">
<button aria-labelledby="clr-open-label"></button>
<input id="demo-input1" type="text" class="coloris" value="#COLOR#">
</div>
</div>
</td>
<td>
<span class="table-remove"><button type="button"
class="btn btn-danger btn-rounded btn-sm my-0 deleteRow1">
Remove
</button></span>
</td>
</tr>
</templateObj>
<script>
$('#duration2').durationPicker({
showSeconds: true,
showDays: false,
onChanged: function (newVal, test, val2) {
$('#duration-label2').text(newVal);
val2.days[0].parentElement.parentElement.parentElement.parentElement.children[1].value = newVal
console.log(val2.days[0].parentElement.parentElement.parentElement.parentElement.children[1].value)
}
});
</script>
<div class="demo">
test
<input id="demo-input" class="colorPicky" type="button" value="rgb(255, 128, 0)" />
</div>
<br><br>
</page>
<page id="about" class="pageC hidden flex-fill overflow-auto">
<h1>About</h1>
Version: 1.0.0<br>
NodeJS Version: <i id="nodejsVers"></i><br>
<code id="systemInfo" class="overflow-auto">
</code>
Version: <b id="nodeSwVers"></b><br>
NodeJS Version: <b id="nodejsVers"></b><br>
<h2>About the translation</h2>
Author: <%= it.lang._metadata.authors %><br>
Language: <%= it.lang._metadata.lang %><br>
Version: <%= it.lang._metadata.version %><br>
</page>
</pages>
</main>
<script type="text/javascript" src="js/jsonview.js"></script>
<script type="text/javascript" src="/js/jsonview.js"></script>
<script type="text/javascript" src="/js/interface.js"> </script>
<script type="text/javascript">
Coloris({
el: '.coloris',
alpha: false,
el: '.coloris',
alpha: false,
});
$(function () {
$('[data-toggle="tooltip"]').tooltip({ container: "body" })
})
</script>
</body>

View File

@ -0,0 +1,64 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>openCountdown - Timerpage</title>
<meta name="description" content="openCountdown">
<meta name="author" content="TheGreydiamond">
<link rel="stylesheet" href="css/styles.css?v=1.1">
<link rel="icon" href="/logo/faviconLogo.svg" type="image/svg+xml">
</head>
<body onclick="updateFullscreen()" onresize="handleDVD()">
<div id="overlay">
<div id="text">Message here</div>
</div>
<!-- Collection of warning and errors -->
<noscript>
<div class="connectionWarning">
Javascript is disabled. Please enable it to use openCountdown.
</div>
</noscript>
<div class="connectionWarning" id="warningBanner" style="display: none;">
Connection lost. Trying to reconnect...
</div>
<!-- Color Bar Image -->
<img src='SMPTE_Color_Bars.svg' class='testImg' id="testImg" style="display: none;">
</img>
<div class="container">
<div class="progWrapper" id="wholeProgBar">
<div class="progBar" id="progBar"></div>
</div>
<div class="timer" id="timer">
00:00:00
</div>
<div class="clockSec" id="clockSec">
</div>
<div class="clockSec" id="timediff">
</div>
</div>
<div id="moveClock" style="display: none;">
<img src="logo/logoProposal-invert.svg" alt="openCountdown" height="180px" class="moverLogo" >
<center><div id="screensaverClock">
00:00:00
</div>
</center>
</div>
<!-- Load scripts -->
<script src="js/reconnecting-websocket.min.js"></script>
<script src="js/timer/timerview.js"></script>
</body>
</html>

View File

@ -6,11 +6,13 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>openCountdown</title>
<title>openCountdown - Timerpage</title>
<meta name="description" content="openCountdown">
<meta name="author" content="TheGreydiamond">
<link rel="stylesheet" href="css/styles.css?v=1.1">
<link rel="icon" href="/logo/faviconLogo.svg" type="image/svg+xml">
</head>
<body onclick="updateFullscreen()">
@ -45,8 +47,7 @@
</div>
</div>
<script src="js/reconnecting-websocket.min.js" async defer></script>
<script src="js/countdown.js"></script>
<script src="js/reconnecting-websocket.min.js"></script>
<script src="js/script.js"></script>
</body>