mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-11-22 16:23:54 +00:00
small fixes and improvements
This commit is contained in:
parent
48d1077ce4
commit
8f80b7e066
@ -172,12 +172,15 @@ fun main() {
|
|||||||
updateText()
|
updateText()
|
||||||
} ?: window.alert("Unable to load body")
|
} ?: window.alert("Unable to load body")
|
||||||
|
|
||||||
|
document.body ?.appendElement("p", {})
|
||||||
|
|
||||||
document.body ?.appendElement("button") {
|
document.body ?.appendElement("button") {
|
||||||
fun updateHeaderColor() {
|
fun updateHeaderColor() {
|
||||||
val (r, g, b) = Random.nextUBytes(3)
|
val (r, g, b) = Random.nextUBytes(3)
|
||||||
val hex = Color.Hex("#${r.toString(16)}${g.toString(16)}${b.toString(16)}")
|
val hex = Color.Hex("#${r.toString(16)}${g.toString(16)}${b.toString(16)}")
|
||||||
webApp.setHeaderColor(hex)
|
webApp.setHeaderColor(hex)
|
||||||
(this as? HTMLButtonElement) ?.style ?.backgroundColor = hex.value
|
(this as? HTMLButtonElement) ?.style ?.backgroundColor = hex.value
|
||||||
|
textContent = hex.value
|
||||||
}
|
}
|
||||||
addEventListener("click", {
|
addEventListener("click", {
|
||||||
updateHeaderColor()
|
updateHeaderColor()
|
||||||
|
Loading…
Reference in New Issue
Block a user