toast X in top right

This commit is contained in:
Til Schmitter 2026-04-18 17:23:45 +02:00
parent bfd572829b
commit 53674248d1
2 changed files with 6 additions and 9 deletions

View file

@ -54,8 +54,7 @@ html {
bottom: 5em; bottom: 5em;
right: -1em; right: -1em;
line-height: 1.5em; line-height: 1.5em;
padding: 1em 1.3em; padding: 1em 2em 1em 1em;
margin-left: 3em;
border-width: .4em 0; border-width: .4em 0;
overflow-wrap: break-word; overflow-wrap: break-word;
transform: translateX(100%); transform: translateX(100%);
@ -92,8 +91,8 @@ html {
display: inline-block; display: inline-block;
position: absolute; position: absolute;
overflow: hidden; overflow: hidden;
left: 0; right: 0;
width: 0; top: -.1em;
opacity: 0; opacity: 0;
padding: .3em 0; padding: .3em 0;
margin: -.3em 0 0 0; margin: -.3em 0 0 0;
@ -102,7 +101,7 @@ html {
border: none; border: none;
outline: none; outline: none;
text-shadow: none; text-shadow: none;
border-radius: .5em 0 0 .5em; border-radius: .5em;
transition: left .3s, width .3s, padding .3s, opacity .3s; transition: left .3s, width .3s, padding .3s, opacity .3s;
} }
#toastb { #toastb {
@ -130,9 +129,7 @@ html {
transform: initial; transform: initial;
} }
#toast.vis #toastc { #toast.vis #toastc {
left: -2em; padding: .3em .5em;
width: .4em;
padding: .3em .8em;
opacity: 1; opacity: 1;
} }
#toast.inf { #toast.inf {

View file

@ -1784,7 +1784,7 @@ var toast = (function () {
setcvar('--tmstep', Math.floor(sec * 20)); setcvar('--tmstep', Math.floor(sec * 20));
html += '<div id="toastt"></div>'; html += '<div id="toastt"></div>';
} }
obj.innerHTML = html + '<a href="#" id="toastc">x</a><div id="toastb">' + lf2br(txt) + '</div>'; obj.innerHTML = html + '<a href="#" id="toastc"></a><div id="toastb">' + lf2br(txt) + '</div>';
obj.className = cl; obj.className = cl;
sec += obj.offsetWidth; sec += obj.offsetWidth;
obj.className += ' vis'; obj.className += ' vis';