Compare commits

...

2 commits

Author SHA1 Message Date
3d68117ff4
Feat: add instructions to webinterface
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone/tag Build was killed
2023-02-17 16:16:23 +01:00
c9f3883c19
CI: do gitea release on tag 2023-02-17 15:20:18 +01:00
4 changed files with 113 additions and 24 deletions

View file

@ -45,4 +45,32 @@ steps:
settings: settings:
folder: web folder: web
ssh_key: ssh_key:
from_secret: gitea-ssh-key from_secret: gitea-ssh-key
trigger:
ref:
- refs/tags/v*
---
kind: pipeline
name: release
depends_on:
- build-receiver-windows
- build-and-deploy-web
steps:
- name: download-receiver
image: alpine/curl
commands:
- curl https://itsblue.dev/api/packages/dorian/generic/ok-ready-go/$DRONE_COMMIT_SHA/receiver-windows.exe -o receiver-windows.exe
- name: gitea-release
image: plugins/gitea-release
settings:
base_url: https://itsblue.dev
api_key:
from_secret: gitea-token
files: ./receiver-windows.exe
trigger:
ref:
- refs/tags/v*

View file

@ -28,12 +28,21 @@
animation: blinker 2s ease infinite; animation: blinker 2s ease infinite;
} }
html {
height: 100%;
}
body {
height: 100%;
}
main { main {
padding-top: 0 !important; padding-top: 0 !important;
height: 100%;
} }
.timer-container-div { .timer-container-div {
height: 100vh; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -50,4 +59,21 @@ main {
top: 0; top: 0;
left: 0; left: 0;
cursor: pointer; cursor: pointer;
}
.hide-before-init {
display: none;
}
.remote-connection-card {
position: absolute;
bottom: 10px;
left: 0;
background-color: var(--background-color);
width: 100%;
}
details {
border-bottom: 0;
padding-bottom: 0;
} }

View file

@ -30,47 +30,72 @@
</head> </head>
<body> <body>
<script> <div class="timer-container-div hide-after-init">
const event = new Event('wasm-loaded'); <h1 class="loading" aria-busy="true">Initializing...</h1>
wasm_bindgen('lib/crypto_helper_bg.wasm').then(() => { </div>
document.dispatchEvent(event); <main class="container hide-before-init" x-data>
});
</script>
<main class="container" x-data>
<div class="timer-container-div" x-show="$store.localState._state !== 5"> <div class="timer-container-div" x-show="$store.localState._state !== 5">
<div @click="$store.localState.next()" class="tap-area" x-show="$store.localState._state === 2"></div> <div @click="$store.localState.next()" class="tap-area" x-show="$store.localState._state === 2"></div>
<div @click="$store.localState.next()" class="timer-div"> <div @click="$store.localState.next()" class="timer-div">
<hgroup> <hgroup>
<h1>OK! .. READY! ... GO!</h1> <h1>OK! .. READY! ... GO!</h1>
<h2 x-text="$store.localState.stateHint"></h2> <h2><span x-text="$store.localState.stateHint"></span> <b x-show="$store.mqtt.connected">(connected)</b></h2>
</hgroup> </hgroup>
<div x-data="Timer"> <div x-data="Timer">
<p :class="'timer' + (over ? ($store.localState._state === 3 ? ' sending':' over'):'')" x-text="time + 's'"></p> <p :class="'timer' + (over ? ($store.localState._state === 3 ? ' sending':' over'):'')"
x-text="time + 's'"></p>
</div> </div>
</div> </div>
</div> </div>
<div x-show="$store.localState._state === 0"> <div x-show="$store.localState._state === 0" class="remote-connection-card">
<div class="container">
<details> <details>
<summary>Remote connection</summary> <div class="container">
<p>If you want to automatically transfer the time to a computer, follow these steps:</p>
<div x-show="!$store.mqtt.connected"> <div x-show="!$store.mqtt.connected">
<p>To send the times to a computer, please enter a password here:</p> <ul>
<form x-data="PasswordForm()" @submit.prevent="submitForm"> <li>Enter a password and press tap connect</li>
<label for="passwordForm_password">Password:</label>
<input id="passwordForm_password" type="text" x-model="formData.password" placeholder="Password" /> <li>
<small>Make sure, this is exactly the same on your computer!</small> <form x-data="PasswordForm()" @submit.prevent="submitForm">
<button type="submit">Connect</button> <label for="passwordForm_password">Password:</label>
</form> <input id="passwordForm_password" type="text" x-model="formData.password"
placeholder="Password" />
<small>Make sure, this is exactly the same on your computer!</small>
<button type="submit">Connect</button>
</form>
</li>
<li>Download the receiver tool from <a
href="https://itsblue.dev/dorian/ok-ready-go/releases/latest">here</a> to your computer
</li>
<li>Start the receiver tool on your computer</li>
<li>Enter the same password on the receiver tool and click connect</li>
<li>Done!</li>
</ul>
</div> </div>
<div x-show="$store.mqtt.connected"> <div x-show="$store.mqtt.connected">
<p>Connected</p> <ul>
<button @click="$store.localState.password = ''">Disconnect</button> <li>Download the receiver tool from <a
href="https://itsblue.dev/dorian/ok-ready-go/releases/latest">here</a> to your computer
</li>
<li>Start the receiver tool on your computer</li>
<li>Enter the password '<b x-text="$store.localState.password"></b>' on the receiver tool and click connect</li>
<li>Done!</li>
<li>
<p>If you no longer want to send the time, tap Disconnect</p>
<button @click="$store.localState.password = ''">Disconnect</button>
</li>
</ul>
</div> </div>
</div>
<summary role="button">Remote connection</summary>
</details> </details>
</div> </div>
</div>
<div class="timer-container-div" x-show="$store.localState._state === 5"> <div class="timer-container-div" x-show="$store.localState._state === 5">
<h1 class="loading" aria-busy="true">Connecting...</h1> <h1 class="loading" aria-busy="true">Connecting...</h1>

View file

@ -59,4 +59,14 @@ function Timer() {
}, 10); }, 10);
}, },
}; };
} }
const event = new Event('wasm-loaded');
wasm_bindgen('lib/crypto_helper_bg.wasm').then(() => {
document.dispatchEvent(event);
});
document.addEventListener("alpine:init", () => {
document.getElementsByClassName("hide-after-init").item(0).outerHTML = ""
document.getElementsByClassName("hide-before-init").item(0).classList.remove("hide-before-init")
});