14 Commits
1.0.3 ... 1.0.6

Author SHA1 Message Date
gitea
52d16cfee5 [no ci] release 1.0.6 2025-02-12 04:55:31 +00:00
e23592b6a4 moves git tag before snapshot
All checks were successful
CI / deploy (push) Successful in 8m36s
2025-02-12 05:46:56 +01:00
a166eecd60 Merge pull request 'removes redundant rejoin button' (#28) from redesign into main
Some checks failed
CI / deploy (push) Has been cancelled
Reviewed-on: #28
2025-02-12 05:44:40 +01:00
4b8b2ce5f3 removes redundant rejoin button
Some checks failed
CI / deploy (push) Has been cancelled
CI / deploy (pull_request) Has been cancelled
2025-02-12 05:43:19 +01:00
gitea
022186964d [no ci] prepare new Version 2025-02-12 04:26:25 +00:00
gitea
4604be151b [no ci] release 1.0.5 2025-02-12 04:26:19 +00:00
e906c38630 Merge pull request 'redesigns page to fit inside 800x600' (#27) from redesign into main
All checks were successful
CI / deploy (push) Successful in 4m53s
Reviewed-on: #27
2025-02-12 05:21:31 +01:00
035445ac3f redesigns page to fit inside 800x600
All checks were successful
CI / deploy (push) Successful in 4m25s
CI / deploy (pull_request) Successful in 4m32s
2025-02-12 05:12:16 +01:00
gitea
562a21c4c5 [no ci] prepare new Version 2025-02-12 01:32:20 +00:00
gitea
e8159c78f4 [no ci] release 1.0.4 2025-02-12 01:32:15 +00:00
b9d057a125 Merge pull request 'rejoin' (#26) from rejoin into main
All checks were successful
CI / deploy (push) Successful in 4m36s
Reviewed-on: #26
2025-02-12 02:15:15 +01:00
e565d90b0d renames compose service
All checks were successful
CI / deploy (push) Successful in 4m14s
CI / deploy (pull_request) Successful in 4m15s
2025-02-12 02:06:31 +01:00
d313045005 implements rejoin mechanism 2025-02-12 02:03:47 +01:00
f5dd819c5b [no ci] center preview in readme 2025-02-12 01:37:40 +01:00
5 changed files with 149 additions and 165 deletions

View File

@@ -62,9 +62,9 @@ jobs:
git config user.name "gitea"
git add ./pom.xml
git commit -m "[no ci] release ${{ steps.version.outputs.VERSION }}"
git tag ${{ steps.version.outputs.VERSION }} -m "release ${{ steps.version.outputs.VERSION }}"
./mvnw -B --no-transfer-progress clean validate -Pnew-snapshot
git add ./pom.xml
git commit -m "[no ci] prepare new Version"
git tag ${{ steps.version.outputs.VERSION }} -m "release ${{ steps.version.outputs.VERSION }}"
git push origin main
git push origin ${{ steps.version.outputs.VERSION }}

View File

@@ -12,7 +12,9 @@
<a href="#license">License</a>
</p>
![preview](.github/media/preview.gif)
<p align="center">
<img src=".github/media/preview.gif" />
</p>
---
@@ -32,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

View File

@@ -1,5 +1,5 @@
services:
api:
dice-tower:
container_name: dice-tower
image: git.arindy.de/arindy/dice-tower:latest
restart: always

View File

@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.arindy</groupId>
<artifactId>dice-tower</artifactId>
<version>1.0.4-SNAPSHOT</version>
<version>1.0.6</version>
<properties>
<compiler-plugin.version>3.13.0</compiler-plugin.version>

View File

@@ -27,27 +27,6 @@
border-radius: 10px;
}
.collapsible {
background-color: #333333;
color: black;
margin-top: 10px;
padding: 18px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-size: 15px;
}
.content {
padding: 0 18px;
display: none;
overflow: hidden;
background-color: #999999;
color: #000;
border-radius: 10px;
}
button {
padding: 10px;
border: #333333 3px solid;
@@ -146,6 +125,7 @@
#dice-box {
position: relative;
justify-self: center;
box-sizing: border-box;
width: 100%;
height: 100%;
@@ -156,12 +136,11 @@
#dice-box canvas {
width: 100%;
height: 100%;
margin: 20px
}
.checkbox {
position: relative;
padding-left: 100px;
padding-left: 50px;
margin-bottom: 12px;
margin-left: 10px;
cursor: pointer;
@@ -180,7 +159,7 @@
}
.checkmark {
margin-left: 75px;
margin-left: 25px;
position: absolute;
top: 0;
left: 0;
@@ -259,135 +238,139 @@
<body class="w3-theme-l1">
<div class="w3-container w3-content"
style="height: 95vh; display: flex; flex-direction: column; justify-content: space-between; padding: 25px">
<h1 style="text-align: center"><i class="fa-solid fa-dice-d20"></i> Dice-Tower <i class="fa-solid fa-dice-d20"></i></h1>
<h1 style="text-align: center"><i class="fa-solid fa-dice-d20"></i> Dice-Tower <i class="fa-solid fa-dice-d20"></i>
</h1>
<div class="w3-panel w3-theme-l4 w3-card w3-display-container"
style="padding: 25px; text-align: center; margin-bottom: auto;">
<label for="name" id="nameLabel">Name </label><input type="text" id="name" style="width: 50%; margin-top: 20px"
required onkeyup="start(event)"/><br/>
<label for="room" id="roomLabel">Room </label><input type="text" id="room" style="width: 50%" required
onkeyup="start(event)"/><br/>
<h2 id="nameH" popovertarget="room-hint" data-trigger="hover" style="margin: 0" hidden>Name</h2>
<div>
<button id="start" onclick="start()" style="align-self: center; margin-top: 20px">Join <i
class="fa-solid fa-right-to-bracket"></i></button>
<label class="checkbox" id="gm-container">Join as GM
<input type="checkbox" id="gm" style="margin-left: 50px">
<span class="checkmark"></span>
</label>
<label for="name" id="nameLabel">Name </label>
<input type="text" id="name" style="width: 50%; margin-top: 20px" required onkeyup="start(event)"/>
</div>
<div>
<label for="room" id="roomLabel">Room </label>
<input type="text" id="room" style="width: 50%" required onkeyup="start(event)"/>
</div>
<div id="start-container">
<div>
<button id="start" onclick="start()" style="align-self: center; margin-top: 20px">Join <i
class="fa-solid fa-right-to-bracket"></i></button>
<label class="checkbox" id="gm-container">Join as GM
<input type="checkbox" id="gm">
<span class="checkmark"></span>
</label>
</div>
</div>
<div id="options-container" hidden style="position: absolute; right: 25px; top: 5px">
<button id="customize" popovertarget="customize-overlay" style="align-self: center; margin-top: 20px"><i class="fa-solid fa-palette"></i>
</button>
<button id="urls" popovertarget="urls-overlay" style="align-self: center; margin-top: 20px"><i class="fa-solid fa-link"></i></button>
</div>
</div>
<div id="dice-tower" hidden class="w3-panel w3-theme-l4 w3-card w3-display-container"
style="padding: 25px; margin-bottom: auto">
<button type="button" class="collapsible" style="color: white; font-weight: bold">Overlay URLs <a><i
class="fa-solid fa-chevron-down"></i></a></button>
<div class="content">
<div id="overlay-urls">
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: baseline;">
<label for="overlayId" id="overlayLabel">Dice-Overlay </label>
<input type="text" readonly id="overlayId" style="flex-grow: 1" onclick="copyToClipboard(this.id)"/>
<button id="overlay-hint-button" popovertarget="overlay-hint" data-trigger="hover"
class="overlayButton"><i class="fa-solid fa-circle-info"></i>
</button>
</div>
</div>
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: baseline;"
hidden id="all-results-urls">
<label for="resultsId">All-Results-Overlay </label>
<input type="text" readonly id="resultsId" style="flex-grow: 1" onclick="copyToClipboard(this.id)"/>
<button popovertarget="all-results-hint" data-trigger="hover" class="overlayButton"><i
class="fa-solid fa-circle-info"></i></button>
</div>
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: baseline;">
<label for="myResultsId">My-Results-Overlay </label>
<input type="text" readonly id="myResultsId" style="flex-grow: 1" onclick="copyToClipboard(this.id)"/>
<button popovertarget="my-results-hint" data-trigger="hover" class="overlayButton"><i
class="fa-solid fa-circle-info"></i></button>
</div>
</div>
<button type="button" class="collapsible" style="color: white; font-weight: bold">Customize Dice <a><i
class="fa-solid fa-chevron-down"></i></a>
</button>
<div class="content">
<label for="theme">Theme </label>
<select name="theme" id="theme" style="margin: 25px">
<option value="default">Default</option>
<option value="blueGreenMetal">Blue-Green Metal</option>
<option value="diceOfRolling">Dice of Rolling</option>
<option value="gemstone">Gemstone</option>
<option value="gemstoneMarble">Marble Gemstone</option>
<option value="rock">Rock</option>
<option value="rust">Rust</option>
<option value="smooth">Smooth</option>
<option value="wooden">Wooden</option>
</select>
<color-picker id="themeColor"></color-picker>
<div id="dice-box"></div>
<button style="margin: 10px" id="preview">Preview <i class="fa-solid fa-magnifying-glass"></i></button>
<button style="margin: 10px" onclick="saveDice()">Save <i class="fa-solid fa-floppy-disk"></i></button>
<button popovertarget="save-dice-hint" data-trigger="hover" class="overlayButton"><i
class="fa-solid fa-circle-info"></i></button>
</div>
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin: 20px 25px;">
<label style="font-size: x-large; font-weight: bold;">Roll </label>
<button style="border: transparent; border-radius: 100%; font-size: x-large; font-weight: bold; height: 50px; width: 50px"
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin: 10px; padding-right: 25px; padding-left: 25px">
<label style="font-size: large; font-weight: bold; margin: 10px">Roll </label>
<button style="border: transparent; border-radius: 100%; font-size: large; font-weight: bold; height: 50px; width: 50px"
onclick="removeDice()">-
</button>
<label style="font-size: x-large; font-weight: bold;" id="dice-amount">1</label>
<button style="border: transparent; border-radius: 100%; font-size: x-large; font-weight: bold; height: 50px; width: 50px"
<label style="font-size: large; font-weight: bold" id="dice-amount">1</label>
<button style="border: transparent; border-radius: 100%; font-size: large; font-weight: bold; height: 50px; width: 50px"
onclick="addDice()">+
</button>
<button style="font-size: x-large; font-weight: bold;" onclick="rollEasy('d4')">D4</button>
<button style="font-size: x-large; font-weight: bold;" onclick="rollEasy('d6')">D6</button>
<button style="font-size: x-large; font-weight: bold;" onclick="rollEasy('d8')">D8</button>
<button style="font-size: x-large; font-weight: bold;" onclick="rollEasy('d10')">D10</button>
<button style="font-size: x-large; font-weight: bold;" onclick="rollEasy('d12')">D12</button>
<button style="font-size: x-large; font-weight: bold;" onclick="rollEasy('d20')">D20</button>
<button style="font-size: x-large; font-weight: bold;" onclick="rollEasy('d100')">D100</button>
<button style="font-size: large; font-weight: bold;" onclick="rollEasy('d4')">D4</button>
<button style="font-size: large; font-weight: bold;" onclick="rollEasy('d6')">D6</button>
<button style="font-size: large; font-weight: bold;" onclick="rollEasy('d8')">D8</button>
<button style="font-size: large; font-weight: bold;" onclick="rollEasy('d10')">D10</button>
<button style="font-size: large; font-weight: bold;" onclick="rollEasy('d12')">D12</button>
<button style="font-size: large; font-weight: bold;" onclick="rollEasy('d20')">D20</button>
<button style="font-size: large; font-weight: bold;" onclick="rollEasy('d100')">D100</button>
</div>
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: baseline; margin: 20px 25px;">
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: baseline; margin: 20px 25px 0;">
<label for="command">Command </label>
<input type="text" id="command" style="flex-grow: 1" onkeyup="roll(event)"/>
<input popovertarget="command-hint" data-trigger="hover" type="text" id="command" style="flex-grow: 1" onkeyup="roll(event)"/>
<button hidden id="roll" onclick="roll()">Roll <i class="fa-solid fa-dice"></i></button>
<button popovertarget="command-hint" data-trigger="hover" class="overlayButton"><i
class="fa-solid fa-circle-info"></i></button>
<div style="margin: 20px 25px" id="all-results">
<label for="resultSwitch">Show all results </label>
<label class="switch">
<input type="checkbox" id="resultSwitch">
<span class="slider"></span>
</label>
</div>
</div>
<div style="margin: 20px 25px" id="all-results">
<label for="resultSwitch">Show all results </label>
<label class="switch">
<input type="checkbox" id="resultSwitch">
<span class="slider"></span>
</label>
</div>
</div>
<div id="results" hidden class="w3-panel w3-theme-l6 w3-card w3-display-container"
style="padding: 25px; flex-grow: 1; margin-bottom: auto">
<iframe id="resultFrame" title="results" style="width: 100%; height: 85%; overflow: hidden; border: 0"
<iframe id="resultFrame" title="results" style="width: 100%; height: 100%; overflow: hidden; border: 0"
onload="this.height=this.contentWindow.document.body.scrollHeight;"></iframe>
</div>
<div popover id="overlay-hint" class="tooltip">
<p style="color: red; font-weight: bold">Only the last loaded instance of that overlay rolls the dice!</p>
<p>Query Params you can Change:</p>
<ul>
<li><strong>scale</strong> changes the size of the dice (any value over 1)</li>
<li><strong>clearAfter</strong> time until dice are cleared (in seconds; remove param or set -1 to keep the
dice)
</li>
</ul>
<div popover id="urls-overlay" class="tooltip" style="width: 600px">
<div id="overlay-urls">
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: baseline;">
<label for="overlayId" id="overlayLabel">Dice-Overlay </label>
<input popovertarget="overlay-hint" data-trigger="hover" type="text" readonly id="overlayId" style="flex-grow: 1" onclick="copyToClipboard(this.id)"/>
</div>
</div>
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: baseline;"
hidden id="all-results-urls">
<label for="resultsId">All-Results-Overlay </label>
<input popovertarget="all-results-hint" data-trigger="hover" type="text" readonly id="resultsId" style="flex-grow: 1" onclick="copyToClipboard(this.id)"/>
</div>
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: baseline;">
<label for="myResultsId">My-Results-Overlay </label>
<input popovertarget="my-results-hint" data-trigger="hover" type="text" readonly id="myResultsId" style="flex-grow: 1" onclick="copyToClipboard(this.id)"/>
</div>
</div>
<div popover id="all-results-hint" class="tooltip">
<div popover id="customize-overlay" class="tooltip" style="width: 680px;">
<label for="theme">Theme </label>
<select name="theme" id="theme" style="margin: 25px">
<option value="default">Default</option>
<option value="blueGreenMetal">Blue-Green Metal</option>
<option value="diceOfRolling">Dice of Rolling</option>
<option value="gemstone">Gemstone</option>
<option value="gemstoneMarble">Marble Gemstone</option>
<option value="rock">Rock</option>
<option value="rust">Rust</option>
<option value="smooth">Smooth</option>
<option value="wooden">Wooden</option>
</select>
<color-picker id="themeColor"></color-picker>
<div id="dice-box"></div>
<button style="margin: 10px" id="preview">Preview <i class="fa-solid fa-magnifying-glass"></i></button>
<button popovertarget="save-dice-hint" data-trigger="hover" style="margin: 10px" onclick="saveDice()">Save <i class="fa-solid fa-floppy-disk"></i></button>
</div>
<div hidden id="overlay-hint">
<div style="text-align: left">
<p style="color: red; font-weight: bold">Only the last loaded instance of that overlay rolls the dice!</p>
<p>Query Params you can Change:</p>
<ul>
<li><strong>scale</strong> changes the size of the dice (any value over 1)</li>
<li><strong>clearAfter</strong> time until dice are cleared (in seconds; remove param or set -1 to keep the
dice)
</li>
</ul>
</div>
</div>
<div hidden id="all-results-hint">
<p>Shows all Results in this room</p>
</div>
<div popover id="my-results-hint" class="tooltip">
<div hidden id="my-results-hint">
<p>Shows only my Results in this room</p>
</div>
<div popover id="save-dice-hint" class="tooltip">
This saves your current theme and theme color for current Name
<div hidden id="save-dice-hint">
<p>This saves your current theme and theme color for <a id="save-dice-hint-name"></a></p>
</div>
<div popover id="command-hint" class="tooltip">
Example Commands: "1d6", "2d8 1d100", "1d4 and 1d6", "2d20 & 1d2, "5d6+10"
<div hidden id="command-hint">
<p>Example Commands: "1d6", "2d8 1d100", "1d4 and 1d6", "2d20 & 1d2, "5d6+10"</p>
</div>
<div hidden id="room-hint">
<p>How is your character called?</p>
</div>
<div style="margin-top: 20px; flex-grow: 1" id="how-to">
@@ -405,8 +388,7 @@
<li style="color: red; font-weight: bold">Only the last loaded instance of that overlay rolls the
dice!
</li>
<li>You can configure your Overlay with query parameters (more information at the info element next
to the link)
<li>You can configure your Overlay with query parameters (for more information hover over the link)
</li>
</ul>
<li>Configure your dice</li>
@@ -437,34 +419,43 @@
}
function start(event) {
console.log(document.getElementById('gm').checked)
if ((!event || event.keyCode === 13) && document.getElementById('name').value.length > 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;
document.getElementById('start').hidden = true;
document.getElementById('start-container').hidden = true;
document.getElementById('options-container').hidden = false;
document.getElementById('dice-tower').hidden = false;
document.getElementById('name').hidden = true;
document.getElementById('room').hidden = true;
document.getElementById('gm-container').hidden = true;
document.getElementById('how-to').hidden = true;
document.getElementById('results').hidden = false;
document.getElementById('all-results').hidden = !document.getElementById('gm').checked;
document.getElementById('all-results-urls').style.display = document.getElementById('gm').checked ? 'fles' : 'none';
document.getElementById('nameLabel').innerHTML = '<strong style="font-size:x-large;">' + document.getElementById('name').value + '</strong>';
document.getElementById('roomLabel').innerHTML = '<strong style="font-size:medium;">' + document.getElementById('room').value + '</strong>';
document.getElementById('nameH').innerHTML = '<strong style="font-size:x-large;">' + document.getElementById('name').value + '</strong>';
document.getElementById('save-dice-hint-name').innerHTML = '<strong>' + document.getElementById('name').value + '</strong>';
document.getElementById('roomLabel').hidden = true;
document.getElementById('nameLabel').hidden = true;
document.getElementById('nameH').hidden = false;
document.getElementById('room-hint').innerHTML = '<p>Room: <strong style="font-size:medium;">' + document.getElementById('room').value + '</strong></p>';
document.getElementById('overlayLabel').innerHTML = 'Dice-Overlay for <strong>' + document.getElementById('name').value + '</strong>';
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")
}
if (localStorage.getItem(document.getElementById('name').value + "-themeColor")) {
document.getElementById('themeColor').setColor(localStorage.getItem(document.getElementById('name').value + "-themeColor"));
}
document.getElementById('urls-overlay').showPopover();
let httpRequest = new XMLHttpRequest();
httpRequest.open('POST', url() + '/dice/' + document.getElementById('room').value + '/register')
httpRequest.setRequestHeader('Content-Type', 'application/json')
@@ -491,20 +482,18 @@
let newLabel = document.createElement('label');
newLabel.for = data.id + 'url';
newLabel.innerHTML = "Dice-Overlay for <strong>" + data.name + "</strong>";
let newInput = document.createElement('input');
let newInput = document.getElementById('overlayId').cloneNode();
newInput.type = "text";
newInput.readOnly = true;
newInput.id = data.id + 'url';
newInput.style.flexGrow = '1';
newInput.value = data.overlay;
newInput.onclick = () => copyToClipboard(newInput.id)
let hint = document.getElementById('overlay-hint-button').cloneNode(true);
newOverlay.appendChild(newLabel);
newOverlay.appendChild(newInput);
newOverlay.appendChild(hint);
overlays.appendChild(newOverlay);
}
showPopover();
configurePopover();
});
}
}
@@ -534,37 +523,28 @@
localStorage.setItem(document.getElementById('name').value + "-themeColor", document.getElementById('themeColor').value)
}
let coll = document.getElementsByClassName("collapsible");
for (let i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function () {
const content = this.nextElementSibling;
if (content.style.display === "block") {
content.style.display = "none";
this.children[0].innerHTML = "<i class='fa-solid fa-chevron-down'></i>"
} else {
content.style.display = "block";
this.children[0].innerHTML = "<i class='fa-solid fa-chevron-up'></i>"
}
});
if (localStorage.getItem('last-name') && localStorage.getItem('last-room')) {
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';
}
function showPopover() {
function configurePopover() {
const popover = document.querySelectorAll("[popovertarget][data-trigger='hover']");
popover.forEach((e) => {
const target = document.querySelector("#" + e.getAttribute("popovertarget"));
e.addEventListener("mouseover", () => {
target.showPopover();
showSnackbar(target.innerHTML);
});
e.addEventListener("mouseout", () => {
target.hidePopover();
hideSnackbar();
});
});
}
showPopover();
configurePopover();
document.getElementById('resultSwitch').addEventListener('change', function () {
if (!this.checked) {
@@ -594,10 +574,13 @@
snackbar.innerHTML = message;
snackbar.className = "show";
snackbarContainer.className = "show";
setTimeout(function () {
snackbar.className = snackbar.className.replace("show", "");
snackbarContainer.className = snackbarContainer.className.replace("show", "");
}, 5000);
}
function hideSnackbar() {
let snackbar = document.getElementById("snackbar");
let snackbarContainer = document.getElementById("snackbar-container");
snackbar.className = snackbar.className.replace("show", "");
snackbarContainer.className = snackbarContainer.className.replace("show", "");
}
</script>
<script type="module">
@@ -619,9 +602,8 @@
</script>
</body>
<footer class="w3-theme-l1 w3-center w3-padding-16">
<footer class="w3-theme-l1 w3-center">
Version {version} ::
<a href="https://git.arindy.de/arindy/dice-tower" target="_blank" class="w3-hover-text-black">Dice-Tower on my
GitTea</a>
<a href="https://git.arindy.de/arindy/dice-tower" target="_blank" class="w3-hover-text-black"><i class="fa-solid fa-code"></i> Source on GitTea</a>
</footer>
</html>