16 Commits

Author SHA1 Message Date
gitea
717d337535 [no ci] release 1.2.2 2025-02-16 19:05:17 +00:00
c79cce8651 Merge pull request 'adds install button' (#35) from install-as-app into main
All checks were successful
CI / deploy (push) Successful in 5m42s
Reviewed-on: #35
2025-02-16 19:59:43 +01:00
fc82d0397f adds install button
All checks were successful
CI / deploy (push) Successful in 5m42s
CI / deploy (pull_request) Successful in 5m37s
2025-02-16 19:45:54 +01:00
gitea
cd9942068f [no ci] prepare new Version 2025-02-16 17:52:56 +00:00
gitea
fb4c0e7b92 [no ci] release 1.2.1 2025-02-16 17:52:49 +00:00
1a0528933b adds d2 to easy roll
All checks were successful
CI / deploy (push) Successful in 5m49s
2025-02-16 18:47:02 +01:00
gitea
0d324239bf [no ci] prepare new Version 2025-02-16 17:37:27 +00:00
gitea
10eedc06f7 [no ci] release 1.2.0 2025-02-16 17:37:21 +00:00
fe856aa7c8 Merge pull request 'changes to dice-box-threejs' (#33) from changes-dice-box into main
All checks were successful
CI / deploy (push) Successful in 5m58s
Reviewed-on: #33
2025-02-16 18:31:30 +01:00
8524a8674d changes to dice-box-threejs
All checks were successful
CI / deploy (push) Successful in 5m29s
CI / deploy (pull_request) Successful in 5m36s
2025-02-16 18:17:00 +01:00
gitea
5d15976c9f [no ci] prepare new Version 2025-02-16 16:13:19 +00:00
gitea
d0a6a9ce3f [no ci] release 1.1.5 2025-02-16 16:13:12 +00:00
87f4d71cc9 moves userId to index
All checks were successful
CI / deploy (push) Successful in 5m49s
2025-02-16 17:07:24 +01:00
gitea
53a047217a [no ci] prepare new Version 2025-02-16 15:40:18 +00:00
gitea
3dbd19ee3b [no ci] release 1.1.4 2025-02-16 15:40:09 +00:00
c0415561ee fixes rich-preview
All checks were successful
CI / deploy (push) Successful in 6m0s
2025-02-16 16:31:53 +01:00
11 changed files with 74 additions and 19 deletions

View File

@@ -16,6 +16,7 @@
<p align="center"> <p align="center">
<img src=".github/media/preview.gif" /> <img src=".github/media/preview.gif" />
</p> </p>
--- ---
## Key Features ## Key Features
@@ -27,6 +28,7 @@
* Watch roll results (also available as Browser Source in OBS) * Watch roll results (also available as Browser Source in OBS)
--- ---
## Start Container ## Start Container
You can start dice-tower with docker compose You can start dice-tower with docker compose

View File

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

View File

@@ -24,7 +24,7 @@ class ChatOverlayResource {
@QueryParam("cmd") cmd: String? = "roll", @QueryParam("cmd") cmd: String? = "roll",
@QueryParam("theme") theme: String? = "default", @QueryParam("theme") theme: String? = "default",
@QueryParam("faceColor") faceColor: String? = "#ff0202", @QueryParam("faceColor") faceColor: String? = "#ff0202",
@QueryParam("faceColor") numberColor: String? = "#ffffff", @QueryParam("numberColor") numberColor: String? = "#ffffff",
@QueryParam("clearAfter") clearAfter: Long? = -1, @QueryParam("clearAfter") clearAfter: Long? = -1,
@QueryParam("timeout") timeout: Long? = -1 @QueryParam("timeout") timeout: Long? = -1
): TemplateInstance { ): TemplateInstance {

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@@ -219,6 +219,3 @@ document.addEventListener("DOMContentLoaded", async () => {
configurePopover(); configurePopover();
}) })
if (!localStorage.getItem("userId")) {
localStorage.setItem("userId", self.crypto.randomUUID());
}

View File

@@ -0,0 +1,18 @@
{
"name": "Dice-Tower",
"icons": [
{
"src": "192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": "/",
"display_override": ["window-controls-overlay", "minimal-ui"],
"display": "standalone"
}

View File

@@ -32,6 +32,22 @@ button:active {
background: #222222; background: #222222;
} }
#install {
padding: 10px;
border: #666666 3px solid;
border-radius: 10px;
background: #666666;
color: #fff
}
#install:hover {
background: #444444;
}
#install:active {
background: #222222;
}
input { input {
margin: 10px; margin: 10px;
} }

View File

@@ -12,15 +12,20 @@
<div popover id="results" class="tooltip"> <div popover id="results" class="tooltip">
</div> </div>
<script type="module"> <script type="module">
import DiceBox from "/vendor/dice-box/dice-box.es.js"; import DiceBox from "/vendor/dice-box/dice-box-threejs.es.js";
const diceBox = new DiceBox("#dice-box", { const diceBox = new DiceBox("#dice-box", {
assetPath: "/vendor/assets/", assetPath: "/vendor/dice-box/",
theme: '{theme}', light_intensity: 2,
faceColor: '{faceColor}', gravity_multiplier: 600,
scale: {scale} baseScale: {scale} * 10,
strength: Math.floor(Math.random() * 4),
theme_customColorset: {
texture: '{theme}',
background: '{faceColor}',
foreground: '{numberColor}'
}
}); });
diceBox.init() diceBox.initialize();
ComfyJS.Init('{channel}'); ComfyJS.Init('{channel}');
//maxDice //maxDice
@@ -33,16 +38,16 @@
toggleWait(true); toggleWait(true);
diceBox.onRollComplete = (rollResult) => { diceBox.onRollComplete = (rollResult) => {
rollResult.forEach(result => { rollResult.sets.forEach(result => {
let values = [] let values = []
result.rolls.forEach(roll => { result.rolls.forEach(roll => {
values.push(roll.value); values.push(roll.value);
}) })
document.getElementById('results').innerHTML = '<strong>' + user + '</strong> rolls <strong>' + message + '</strong>:<br/> [' + values.map(value => value === 1 ? '<strong style="text-shadow: 2px 2px 10px red">' + value + '</strong>' : value === result.sides ? '<strong style="text-shadow: 2px 2px 10px green">' + value + '</strong>' : value).join(' + ') + (result.modifier > 0 ? ' <a style="text-decoration: underline">+' + result.modifier + '</a>' : result.modifier < 0 ? ' <a style="text-decoration: underline">' + result.modifier + '</a>' : '') + '] = <strong>' + result.value + '</strong> ' document.getElementById('results').innerHTML = '<strong>' + user + '</strong> rolls <strong>' + message + '</strong>:<br/> [' + values.map(value => value === 1 ? '<strong style="text-shadow: 2px 2px 10px red">' + value + '</strong>' : value === result.sides ? '<strong style="text-shadow: 2px 2px 10px green">' + value + '</strong>' : value).join(' + ') + '] = <strong>' + result.total + '</strong> '
}) })
document.getElementById('results').showPopover() document.getElementById('results').showPopover()
setTimeout(() => { setTimeout(() => {
diceBox.clear(); diceBox.clearDice();
document.getElementById('results').hidePopover() document.getElementById('results').hidePopover()
}, {clearAfter} * 1000) }, {clearAfter} * 1000)
} }

View File

@@ -23,7 +23,7 @@
<div class="w3-panel w3-theme-l4 w3-card w3-display-container" <div class="w3-panel w3-theme-l4 w3-card w3-display-container"
style="padding: 25px; text-align: center; margin-bottom: auto;"> style="padding: 25px; text-align: center; margin-bottom: auto;">
<label for="theme">Theme </label> <label for="theme">Theme </label>
<select name="theme" id="theme" style="margin: 25px"></select> <select name="theme" id="theme" style="margin: 0 25px"></select>
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: baseline"> <div style="display: flex; flex-direction: row; justify-content: space-between; align-items: baseline">
<div style="flex-grow: 1; padding: 0 10px"> <div style="flex-grow: 1; padding: 0 10px">

View File

@@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Dice-Tower</title> <title>Dice-Tower</title>
<meta name="version" content="{version}"> <meta name="version" content="{version}">
<link rel="manifest" href="manifest.json" />
<link rel="stylesheet" href="/vendor/w3css/4/w3.css"> <link rel="stylesheet" href="/vendor/w3css/4/w3.css">
<link rel="stylesheet" href="/vendor/font-awesome/css/fontawesome.css"> <link rel="stylesheet" href="/vendor/font-awesome/css/fontawesome.css">
<link rel="stylesheet" href="/vendor/font-awesome/css/all.css"> <link rel="stylesheet" href="/vendor/font-awesome/css/all.css">
@@ -29,6 +29,22 @@
<meta property="twitter:domain" content="{http:request.authority}"> <meta property="twitter:domain" content="{http:request.authority}">
</head> </head>
<body class="w3-theme-l1"> <body class="w3-theme-l1">
<script>
if (!localStorage.getItem("userId")) {
localStorage.setItem("userId", self.crypto.randomUUID());
}
addEventListener("beforeinstallprompt", (event) => {
event.preventDefault()
let install = document.createElement('button');
install.id = 'install'
install.style.position = 'absolute'
install.style.top = '25px'
install.style.right = '25px'
install.innerHTML = 'Install Dice-Tower'
install.onclick = () => event.prompt()
document.body.appendChild(install)
});
</script>
<div class="w3-container w3-content" <div class="w3-container w3-content"
style="height: 95vh; display: flex; flex-direction: column; justify-content: space-between; padding: 25px"> 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 style="text-align: center"><i class="fa-solid fa-dice-d20"></i> Dice-Tower <i class="fa-solid fa-dice-d20"></i>
@@ -73,6 +89,7 @@
<button style="border: transparent; border-radius: 100%; font-size: large; font-weight: bold; height: 50px; width: 50px" <button style="border: transparent; border-radius: 100%; font-size: large; font-weight: bold; height: 50px; width: 50px"
onclick="addDice()">+ onclick="addDice()">+
</button> </button>
<button style="font-size: large; font-weight: bold;" onclick="rollEasy('d2')">D2</button>
<button style="font-size: large; font-weight: bold;" onclick="rollEasy('d4')">D4</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('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('d8')">D8</button>
@@ -133,10 +150,10 @@
</div> </div>
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: baseline"> <div style="display: flex; flex-direction: row; justify-content: space-between; align-items: baseline">
<div style="flex-grow: 1; padding: 0 10px"> <div style="flex-grow: 1; padding: 0 10px">
<color-picker id="faceColor" name="Face"></color-picker> <color-picker id="faceColor" name="Face" value="#8d8981"></color-picker>
</div> </div>
<div style="flex-grow: 1; padding: 10px 0"> <div style="flex-grow: 1; padding: 10px 0">
<color-picker id="numberColor" name="Numbers"></color-picker> <color-picker id="numberColor" name="Numbers" value="black"></color-picker>
</div> </div>
</div> </div>
<div id="dice-box"> <div id="dice-box">