Merge pull request 'adds Readme & adjusts Layout of index' (#10) from readme-and-overlay-adjustements into main
All checks were successful
CI / deploy (push) Successful in 4m21s

Reviewed-on: #10
This commit is contained in:
arindy 2025-02-10 14:06:46 +01:00
commit 1518783090
3 changed files with 77 additions and 14 deletions

BIN
.github/media/preview.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -1,2 +1,63 @@
# dice-tower
<h1 align="center">
Dice-Tower
</h1>
<h4 align="center">... they see them rolling ...</h4>
<p align="center">
<a href="#key-features">Key Features</a>
<a href="#how-to-build">How To Build</a>
<a href="#credits">Credits</a>
<a href="#license">License</a>
</p>
![preview](.github/media/preview.gif)
---
## Key Features
* Connect to a room with others
* Configure your dice (theme and color)
* Roll any dice
* See the dice roll (Can be used as a Browser Source in OBS)
* Watch roll results (also available as Browser Source in OBS)
---
## How To Build
To clone and run this application, you'll need `git`, `java21` and `docker`.
```bash
# Clone this repository
$ git clone https://git.arindy.de/arindy/dice-tower.git
# Go into the repository
$ cd dice-tower
# Build the binary
$ ./mvnw clean verify -Pnative
# Build the container
$ docker build -f src/main/docker/Dockerfile.native-micro -t dice-tower .
# run the container in the background
$ docker run --network host -d dice-tower
# Visit the dice-tower in your browser on http://localhost:8080
```
---
## Credits
This software uses the following open source packages:
- [3D-Dice/dice-box](https://github.com/3d-dice/dice-box)
- [3D-Dice/dice-themes](https://github.com/3d-dice/dice-themes)
- [W3.CSS Color Themes](https://www.w3schools.com/w3css/w3css_color_themes.asp)
## License
GPL-3

View File

@ -94,21 +94,22 @@
</style>
</head>
<body class="w3-theme-l1">
<div class="w3-container w3-content" style="height: 100vh">
<h1>Dice-Tower</h1>
<p>Welcome to Dice-Tower</p>
<div class="w3-panel w3-theme-l4 w3-card w3-display-container" style="padding: 25px">
<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">Dice-Tower</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: 75%" required onkeyup="start(event)"/><br/>
<label for="room" id="roomLabel">Room </label><input type="text" id="room" style="width: 75%" required onkeyup="start(event)"/><br/>
<button id="start" onclick="start()" style="align-self: center">Start</button>
</div>
<div id="dice-tower" hidden class="w3-panel w3-theme-l4 w3-card w3-display-container" style="padding: 25px">
<button type="button" class="collapsible" style="color: white; font-weight: bold">Overlay URLs</button>
<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>🞃</a></button>
<div class="content">
<label for="overlayId">Dice-Overlay (Only open once) </label><input type="text" readonly id="overlayId" style="width: 70%"/><br/>
<label for="resultsId">All-Results-Overlay </label><input type="text" readonly id="resultsId" style="width: 75%"/><br/>
<label for="myResultsId">My-Results-Overlay </label><input type="text" readonly id="myResultsId" style="width: 75%"/><br/>
</div>
<button type="button" class="collapsible" style="color: white; font-weight: bold">Customize Dice</button>
<button type="button" class="collapsible" style="color: white; font-weight: bold">Customize Dice <a>🞃</a></button>
<div class="content">
<label for="theme">Theme </label>
<select name="theme" id="theme" style="margin: 25px">
@ -134,11 +135,7 @@
<span class="slider"></span>
</label>
</div>
<button id="start" onclick="start()">Start</button>
<div id="results" hidden class="w3-panel w3-theme-l6 w3-card w3-display-container" style="padding: 25px; overflow: hidden; height: 50vh;">
<h2>Results</h2>
<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" onload="this.height=this.contentWindow.document.body.scrollHeight;" ></iframe>
</div>
@ -160,7 +157,7 @@
document.getElementById('room').hidden = true;
document.getElementById('results').hidden = false;
document.getElementById('nameLabel').innerHTML = '<strong style="font-size:x-large;">' + document.getElementById('name').value + '</strong>';
document.getElementById('roomLabel').innerHTML = '<strong style="font-size:large;">' + document.getElementById('room').value + '</strong>';
document.getElementById('roomLabel').innerHTML = '<strong style="font-size:medium;">' + document.getElementById('room').value + '</strong>';
document.title = document.getElementById('name').value + ' - Dice-Tower';
if (localStorage.getItem(document.getElementById('name').value + "-theme")) {
@ -195,8 +192,10 @@
const content = this.nextElementSibling;
if (content.style.display === "block") {
content.style.display = "none";
this.children[0].innerHTML = "🞃"
} else {
content.style.display = "block";
this.children[0].innerHTML = "🞁"
}
});
}
@ -216,4 +215,7 @@
})
</script>
</body>
<footer class="w3-theme-l1 w3-center w3-padding-16">
<a href="https://git.arindy.de/arindy/dice-tower" target="_blank" class="w3-hover-text-black">Dice-Tower on my GitTea</a>
</footer>
</html>