Well, sending messages took longer than it should have
This commit is contained in:
25
ui/site/components/LoadingCircle.js
Normal file
25
ui/site/components/LoadingCircle.js
Normal file
@@ -0,0 +1,25 @@
|
||||
class LoadingCircle extends Shadow {
|
||||
render() {
|
||||
div()
|
||||
.borderRadius(100, pct)
|
||||
.width(2, em).height(2, em)
|
||||
.x(45, pct).y(50, pct)
|
||||
.center()
|
||||
.backgroundColor("var(--accent")
|
||||
.transition("transform 1.75s ease-in-out")
|
||||
.onAppear(function () {
|
||||
let growing = true;
|
||||
|
||||
setInterval(() => {
|
||||
if (growing) {
|
||||
this.style.transform = "scale(1.5)";
|
||||
} else {
|
||||
this.style.transform = "scale(0.7)";
|
||||
}
|
||||
growing = !growing;
|
||||
}, 750);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
register(LoadingCircle)
|
||||
@@ -1,5 +1,4 @@
|
||||
class ProfileMenu extends Shadow {
|
||||
profile;
|
||||
|
||||
render() {
|
||||
ZStack(() => {
|
||||
@@ -9,7 +8,7 @@ class ProfileMenu extends Shadow {
|
||||
p("Email: ")
|
||||
.fontWeight("bold")
|
||||
|
||||
p(this.profile?.email)
|
||||
p(window.profile?.email)
|
||||
})
|
||||
.gap(1, em)
|
||||
|
||||
@@ -17,7 +16,7 @@ class ProfileMenu extends Shadow {
|
||||
p("Name: ")
|
||||
.fontWeight("bold")
|
||||
|
||||
p(this.profile?.name)
|
||||
p(window.profile?.name)
|
||||
})
|
||||
.gap(1, em)
|
||||
|
||||
@@ -38,8 +37,8 @@ class ProfileMenu extends Shadow {
|
||||
.center()
|
||||
.display("none")
|
||||
.onAppear(async () => {
|
||||
if(!this.profile) {
|
||||
this.profile = await this.fetchProfile()
|
||||
if(!window.profile) {
|
||||
window.profile = await this.fetchProfile()
|
||||
this.rerender()
|
||||
}
|
||||
})
|
||||
@@ -60,7 +59,6 @@ class ProfileMenu extends Shadow {
|
||||
const profile = await res.json();
|
||||
console.log(profile);
|
||||
return profile
|
||||
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user