Skip to content

Commit

Permalink
avoid layout-shift for qr-codes
Browse files Browse the repository at this point in the history
  • Loading branch information
9001 committed Nov 22, 2024
1 parent db069c3 commit 5afb562
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion copyparty/web/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4673,7 +4673,7 @@ var fileman = (function () {
return;
}
surl = surl.slice(15).trim();
var txt = esc(surl) + '<img class="b64" src="' + surl + '?qr" />';
var txt = esc(surl) + '<img class="b64" width="100" height="100" src="' + surl + '?qr" />';
modal.confirm(txt + L.fs_ok, function() {
cliptxt(surl, function () {
toast.ok(2, L.clipped);
Expand Down
2 changes: 1 addition & 1 deletion copyparty/web/shares.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function qr(e) {

function showqr(href) {
var vhref = href.replace('?qr&', '?').replace('?qr', '');
modal.alert(esc(vhref) + '<img class="b64" src="' + href + '" />');
modal.alert(esc(vhref) + '<img class="b64" width="100" height="100" src="' + href + '" />');
}

(function() {
Expand Down
2 changes: 2 additions & 0 deletions copyparty/web/ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ html.y #tth {
margin: .1em auto;
width: 60%;
height: 60%;
background: #999;
background: rgba(128,128,128,0.2);
}
#modalb {
position: sticky;
Expand Down

0 comments on commit 5afb562

Please sign in to comment.