This commit is contained in:
Steven Tracey 2023-06-07 14:52:37 -04:00
parent 9a0576b2a4
commit 64d566c5cc
4 changed files with 2 additions and 128 deletions

View File

@ -50,7 +50,6 @@
<ul>
<li><a class="active" href="#">Home</a></li>
<li><a href="install/">Install</a></li>
<li><a href="websocket/">WebSocket</a></li>
</ul>
</nav>

View File

@ -1,5 +1,4 @@
//let backendUrl = "https://signature.caiu.org"
let backendUrl = "http://localhost:8080"
let backendUrl = "https://signature.caiu.org"
let locations = JSON.parse("{}");
const locationSelector = document.getElementById("location");

View File

@ -1,4 +1,4 @@
let liveGenWS = new WebSocket("ws://localhost:8080/backend/generate/live");
let liveGenWS = new WebSocket("wss://signature.caiu.org/backend/generate/live");
let backgroundLayer = document.getElementById("backgroundLayer");
let loc = document.getElementById("location");

View File

@ -1,124 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="../stylesheet.css">
<link rel="stylesheet" href="../darkmode.css">
<link rel="icon" href="../favicon.ico">
<title>Websocket</title>
<script>document.documentElement.dataset.theme = localStorage.getItem('theme') || 'light';</script>
</head>
<body>
<header>
<a class="navbar-brand" href="https://www.caiu.org">
<img class="logo" src="../logo.png" alt="CAIU Logo">
</a>
<div style="margin-right: 0.5em;">
<label for="theme" class="theme">
<span class="toggle-wrap">
<input id="theme" class="toggle" type="checkbox" role="switch" name="theme" value="dark">
<span class="icon">
<span class="icon-part"></span>
<span class="icon-part"></span>
<span class="icon-part"></span>
<span class="icon-part"></span>
<span class="icon-part"></span>
<span class="icon-part"></span>
<span class="icon-part"></span>
<span class="icon-part"></span>
<span class="icon-part"></span>
</span>
</span>
</label>
</div>
</header>
<nav class="navbar">
<ul>
<li><a href="../">Home</a></li>
<li><a href="../install/">Install</a></li>
<li><a class="active" href="#">WebSocket</a></li>
</ul>
</nav>
<main>
<div class="card">
<a id="card" href="#">
<canvas id="backgroundLayer" width="404" height="225" style="z-index: 0;"></canvas>
<canvas id="nameLayer" width="404" height="225" style="z-index: 1;"></canvas>
<canvas id="titleLayer" width="404" height="225" style="z-index: 2;"></canvas>
<canvas id="emailLayer" width="404" height="225" style="z-index: 3;"></canvas>
<canvas id="locationLayer" width="404" height="225" style="z-index: 4;"></canvas>
<canvas id="numbersLayer" width="404" height="225" style="z-index: 5;"></canvas>
</a>
</div>
<div class="container">
<div class="mt mb">
<label for="code">Code to Execute:</label>
<textarea id="code" rows="8" cols="120"></textarea>
<button id="execCode" class="btn btn-primary">Execute</button>
</div>
<div class="mt mb">
<label for="output">Output:</label>
<textarea id="output" rows="8" cols="120" readonly></textarea>
<button id="clearOutput" class="btn btn-primary">Clear</button>
</div>
<div class="form-group">
<label for="location">Location:</label>
<select class="form-control" id="location" name="location"></select>
</div>
<div class="form-group">
<label for="full_name">Full Name &amp; Credentials</label>
<input type="text" class="form-control" id="full_name" name="full_name" maxlength="36" required="">
</div>
<div class="form-group">
<label for="title">Title</label>
<input type="text" class="form-control" id="title" name="title" maxlength="48" required="">
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" class="form-control" id="email" name="email" required="">
</div>
<div class="form-group">
<input type="checkbox" id="directNumberCheckbox" onclick="handleCheckbox()">
<label for="directNumberCheckbox">Direct Line</label>
</div>
<div class="form-group" id="directNumberInput" style="display:none">
<label for="directNumber">Direct Line:</label>
<input type="text" class="form-control" id="directNumber" name="directNumber" maxlength="15" required="">
</div>
<div class="form-group" id="extensionInput">
<label for="extension">Extension</label>
<input type="tel" class="form-control" id="extension" name="extension" required="">
</div>
<div class="form-group">
<label for="cellNumber">Cell Number</label>
<input type="tel" class="form-control" id="cellNumber" name="cellNumber" maxlength="15" required="">
</div>
</div>
</main>
<footer>Made by the best intern!</footer>
<script>
(()=>{
const console_log = window.console.log;
window.console.log = function(...args){
console_log(...args);
let textarea = document.getElementById('output');
if(!textarea) return;
args.forEach(arg=>textarea.value += `${JSON.stringify(arg)}\n`);
}
})();
document.getElementById("execCode").addEventListener("click", (e) => {
eval(document.getElementById("code").value);
}, false);
document.getElementById("clearOutput").addEventListener("click", (e) => {
document.getElementById("output").value = "";
}, false);
</script>
<script src="../darkmode.js"></script>
<script src="../websocket.js"></script>
</body>
</html>