diff --git a/README.md b/README.md
index 4f55335..1f54d1c 100644
--- a/README.md
+++ b/README.md
@@ -34,7 +34,7 @@ You can start dice-tower with docker compose
Create a `compose.yml`-File with following content:
```yaml
services:
- api:
+ dice-tower:
container_name: dice-tower
image: git.arindy.de/arindy/dice-tower:latest
restart: always
diff --git a/compose.yml b/compose.yml
index 2403b5f..3407685 100644
--- a/compose.yml
+++ b/compose.yml
@@ -1,5 +1,5 @@
services:
- api:
+ dice-tower:
container_name: dice-tower
image: git.arindy.de/arindy/dice-tower:latest
restart: always
diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html
index 902f65f..33c9a8a 100644
--- a/src/main/resources/templates/index.html
+++ b/src/main/resources/templates/index.html
@@ -161,7 +161,7 @@
.checkbox {
position: relative;
- padding-left: 100px;
+ padding-left: 50px;
margin-bottom: 12px;
margin-left: 10px;
cursor: pointer;
@@ -180,7 +180,7 @@
}
.checkmark {
- margin-left: 75px;
+ margin-left: 25px;
position: absolute;
top: 0;
left: 0;
@@ -266,13 +266,14 @@
required onkeyup="start(event)"/>
-
0 && document.getElementById('room').value.length > 0) {
document.getElementById('overlayId').value = url() + '/overlay/' + document.getElementById('room').value + ':' + localStorage.getItem('userId') + '?scale=7&clearAfter=30';
document.getElementById('resultsId').value = url() + '/overlay/' + document.getElementById('room').value + '/results';
document.getElementById('myResultsId').value = document.getElementById('resultsId').value + '?name=' + encodeURIComponent(document.getElementById('name').value) + '&user=' + localStorage.getItem('userId');
document.getElementById('resultFrame').src = document.getElementById('myResultsId').value;
document.getElementById('roll').hidden = false;
+ if (document.getElementById('rejoin')) {
+ document.getElementById('rejoin').hidden = true;
+ }
document.getElementById('start').hidden = true;
document.getElementById('dice-tower').hidden = false;
document.getElementById('name').hidden = true;
@@ -459,6 +461,10 @@
document.getElementById('overlayLabel').innerHTML = 'Dice-Overlay for ' + document.getElementById('name').value + '';
document.title = document.getElementById('name').value + ' - Dice-Tower';
+ localStorage.setItem('last-name', document.getElementById('name').value)
+ localStorage.setItem('last-room', document.getElementById('room').value)
+ localStorage.setItem('last-gm', document.getElementById('gm').checked)
+
if (localStorage.getItem(document.getElementById('name').value + "-theme")) {
document.getElementById('theme').value = localStorage.getItem(document.getElementById('name').value + "-theme")
}
@@ -549,6 +555,22 @@
});
}
+ if (localStorage.getItem('last-name') && localStorage.getItem('last-room')) {
+ let rejoin = document.createElement('button');
+ rejoin.id = 'rejoin';
+ rejoin.style.alignSelf = 'center';
+ rejoin.style.marginTop = '20px';
+ rejoin.style.marginRight = '20px';
+ rejoin.innerHTML = 'Rejoin as ' + (localStorage.getItem('last-gm') === 'true' ? 'GM ' : '') + localStorage.getItem('last-name') + ' in ' + localStorage.getItem('last-room') + ' '
+ rejoin.onclick = () => {
+ document.getElementById('name').value = localStorage.getItem('last-name');
+ document.getElementById('room').value = localStorage.getItem('last-room');
+ document.getElementById('gm').checked = localStorage.getItem('last-gm') === 'true';
+ start();
+ }
+ document.getElementById('start-container').appendChild(rejoin)
+ }
+
function showPopover() {
const popover = document.querySelectorAll("[popovertarget][data-trigger='hover']");