diff options
| author | stonedDiscord <Tukz@gmx.de> | 2021-03-13 16:30:55 +0100 |
|---|---|---|
| committer | stonedDiscord <Tukz@gmx.de> | 2021-03-13 16:30:55 +0100 |
| commit | 1e59ba929a88ef3508a62e7b5afa754681be7ae4 (patch) | |
| tree | 1c6c6aec98a091de9bb27884c488e3b4c8333283 /webAO | |
| parent | 8feb3f65188214486f6897d94e484acebd6d08a2 (diff) | |
add webp img and code
Diffstat (limited to 'webAO')
| -rw-r--r-- | webAO/client.html | 2 | ||||
| -rw-r--r-- | webAO/client.js | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/webAO/client.html b/webAO/client.html index e1adfc5..fdeddbb 100644 --- a/webAO/client.html +++ b/webAO/client.html @@ -78,11 +78,13 @@ <img id="client_pair_gif" onerror="charError(this);"> <img id="client_pair_png" onerror="charError(this);"> <img id="client_pair_apng" onerror="charError(this);"> + <img id="client_pair_webp" onerror="charError(this);"> </div> <div id="client_char" alt="Character"> <img id="client_char_gif" onerror="charError(this);"> <img id="client_char_png" onerror="charError(this);"> <img id="client_char_apng" onerror="charError(this);"> + <img id="client_char_webp" onerror="charError(this);"> </div> <img id="client_bench"> <img id="client_fg" alt="Various overlay" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="> diff --git a/webAO/client.js b/webAO/client.js index e88d18f..6cc6b9b 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1862,17 +1862,20 @@ async changeBackground(position) { const gif_s = document.getElementById("client_" + pairID + "_gif"); const png_s = document.getElementById("client_" + pairID + "_png"); const apng_s = document.getElementById("client_" + pairID +"_apng"); + const webp_s = document.getElementById("client_" + pairID +"_webp"); if (this.lastChar !== this.chatmsg.name) { //hide the last sprite gif_s.src = transparentPNG; png_s.src = transparentPNG; apng_s.src = transparentPNG; + webp_s.src = transparentPNG; } gif_s.src = characterFolder + `${encodeURI(charactername)}/${encodeURI(prefix)}${encodeURI(emotename)}.gif`; png_s.src = characterFolder + `${encodeURI(charactername)}/${encodeURI(emotename)}.png`; apng_s.src = characterFolder + `${encodeURI(charactername)}/${encodeURI(prefix)}${encodeURI(emotename)}.apng`; + webp_s.src = characterFolder + `${encodeURI(charactername)}/${encodeURI(prefix)}${encodeURI(emotename)}.webp`; } /** |
