Merge pull request #191 from LubricantJam/main

Further Mobile Optimisations
This commit is contained in:
Harvey Tindall
2022-01-30 16:27:33 +00:00
committed by GitHub
12 changed files with 459 additions and 598 deletions
+2 -2
View File
@@ -257,7 +257,7 @@ class DOMInvite implements Invite {
this._header.appendChild(this._codeArea);
this._codeArea.classList.add("inv-codearea");
this._codeArea.innerHTML = `
<a class="invite-link code font-mono bg-inherit mr-4" href=""></a>
<a class="invite-link text-black dark:text-white font-mono bg-inherit mr-4" href=""></a>
<span class="button ~info @low" title="${window.lang.strings("copy")}"><i class="ri-file-copy-line"></i></span>
`;
const copyButton = this._codeArea.querySelector("span.button") as HTMLSpanElement;
@@ -427,7 +427,7 @@ export class inviteList implements inviteList {
<div class="inv inv-empty">
<div class="card dark:~d_neutral @low inv-header flex-expand mt-2">
<div class="inv-codearea">
<span class="code font-mono bg-inherit">${window.lang.strings("inviteNoInvites")}</span>
<span class="text-black dark:text-white font-mono bg-inherit">${window.lang.strings("inviteNoInvites")}</span>
</div>
</div>
</div>
+6 -5
View File
@@ -24,11 +24,12 @@ export class Modal implements Modal {
if (event) {
event.preventDefault();
}
this.modal.classList.add('modal-hiding');
this.modal.classList.add('animate-fade-out');
this.modal.classList.remove("animate-fade-in");
const modal = this.modal;
const listenerFunc = () => {
modal.classList.remove('modal-shown');
modal.classList.remove('modal-hiding');
modal.classList.remove('block');
modal.classList.remove('animate-fade-out');
modal.removeEventListener(window.animationEvent, listenerFunc);
document.dispatchEvent(this.closeEvent);
};
@@ -43,11 +44,11 @@ export class Modal implements Modal {
}
show = () => {
this.modal.classList.add('modal-shown');
this.modal.classList.add('block', 'animate-fade-in');
document.dispatchEvent(this.openEvent);
}
toggle = () => {
if (this.modal.classList.contains('modal-shown')) {
if (this.modal.classList.contains('animate-fade-in')) {
this.close();
} else {
this.show();