Gif picker improvements
This commit is contained in:
parent
4cbddfe9ac
commit
b0d726b8ef
2 changed files with 27 additions and 1 deletions
|
@ -2315,6 +2315,8 @@ class Localuser {
|
||||||
if (sValue !== search.value) {
|
if (sValue !== search.value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
let left = 0,
|
||||||
|
right = 0;
|
||||||
for (const gif of gifReturns) {
|
for (const gif of gifReturns) {
|
||||||
const div = document.createElement("div");
|
const div = document.createElement("div");
|
||||||
div.classList.add("gifBox");
|
div.classList.add("gifBox");
|
||||||
|
@ -2326,7 +2328,19 @@ class Localuser {
|
||||||
img.width = gif.width / scale;
|
img.width = gif.width / scale;
|
||||||
img.height = gif.height / scale;
|
img.height = gif.height / scale;
|
||||||
div.append(img);
|
div.append(img);
|
||||||
|
|
||||||
|
if (left <= right) {
|
||||||
|
div.style.top = left + "px";
|
||||||
|
left += Math.ceil(img.height) + 10;
|
||||||
|
div.style.left = "5px";
|
||||||
|
} else {
|
||||||
|
div.style.top = right + "px";
|
||||||
|
right += Math.ceil(img.height) + 10;
|
||||||
|
div.style.left = "210px";
|
||||||
|
}
|
||||||
|
|
||||||
gifs.append(div);
|
gifs.append(div);
|
||||||
|
|
||||||
div.onclick = () => {
|
div.onclick = () => {
|
||||||
if (this.channelfocus) {
|
if (this.channelfocus) {
|
||||||
this.channelfocus.sendMessage(gif.url, {embeds: [], attachments: [], replyingto: null});
|
this.channelfocus.sendMessage(gif.url, {embeds: [], attachments: [], replyingto: null});
|
||||||
|
@ -2334,6 +2348,7 @@ class Localuser {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
gifs.style.height = Math.max(left, right) + "px";
|
||||||
};
|
};
|
||||||
let last = "";
|
let last = "";
|
||||||
search.onkeyup = () => {
|
search.onkeyup = () => {
|
||||||
|
|
|
@ -2690,6 +2690,8 @@ fieldset input[type="radio"] {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
margin: 0.1in;
|
margin: 0.1in;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
overflow-x: clip;
|
||||||
}
|
}
|
||||||
.searchGifBar {
|
.searchGifBar {
|
||||||
height: 0.3in;
|
height: 0.3in;
|
||||||
|
@ -2704,7 +2706,16 @@ fieldset input[type="radio"] {
|
||||||
.gifBox {
|
.gifBox {
|
||||||
img {
|
img {
|
||||||
max-width: 196px;
|
max-width: 196px;
|
||||||
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
cursor: p;
|
position: absolute;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue