adds color to name in results
This commit is contained in:
parent
001a35165a
commit
ce1f43fe98
@ -37,7 +37,7 @@ final class DiceResource(@Context val sse: Sse) {
|
||||
.mediaType(MediaType.APPLICATION_JSON_TYPE).data(data).build()
|
||||
)
|
||||
if (data.roll.all { it.trim().isNotEmpty() }) {
|
||||
results(data.room!!, Result(data.name, data.user!!))
|
||||
results(data.room!!, Result(data.name, data.user!!, data.themeColor))
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,6 +72,6 @@ final class DiceResource(@Context val sse: Sse) {
|
||||
}
|
||||
|
||||
@RegisterForReflection
|
||||
data class Result(val name: String, val user: String) {}
|
||||
data class Result(val name: String, val user: String, val themeColor: String) {}
|
||||
|
||||
}
|
||||
|
@ -71,6 +71,7 @@
|
||||
httpRequest.send(JSON.stringify({
|
||||
name: data.name,
|
||||
user: data.user,
|
||||
themeColor: data.themeColor,
|
||||
results: rollResult,
|
||||
} ))
|
||||
}
|
||||
|
@ -30,7 +30,7 @@
|
||||
resultText += '<br/>  D' + result.sides + ': [' + values.map(value => value === 1 ? '<strong style="color: red">' + value + '</strong>' : value === result.sides ? '<strong style="color: 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 style="font-size: x-large">' + result.value + '</strong> '
|
||||
})
|
||||
}
|
||||
node.innerHTML = '<strong>' + data.name + ':</strong> 🎲 ' + resultText
|
||||
node.innerHTML = '<strong style="text-shadow: 2px 2px 10px ' + data.themeColor + ';">' + data.name + ':</strong> 🎲 ' + resultText
|
||||
name.appendChild(node)
|
||||
document.getElementById('results').appendChild(name);
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user