15 Commits

Author SHA1 Message Date
de9d2b3a8a 👷 Run dockerize and deploy CI steps on commits on default branch
Some checks failed
ci/woodpecker/push/dockerize Pipeline failed
ci/woodpecker/push/deploy unknown status
2024-04-16 07:29:09 +02:00
f0d3b91084 🧑‍💻 Add version to the Wallpaper
All checks were successful
ci/woodpecker/push/dockerize Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
This information should be moved to a version panel, when it'll be available...
2024-04-16 07:01:49 +02:00
cae7a1e244 👷 Optimize building process using the homemade dioxus-cli docker image
All checks were successful
ci/woodpecker/push/dockerize Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
2024-04-15 23:18:40 +02:00
6f95e0f57b 👷 Use of the CI to deliver a new image on each commit (temp)
All checks were successful
ci/woodpecker/push/dockerize Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
2024-04-15 22:04:25 +02:00
d4af06d687 🐛 Fix wallpaper-pattern misalignment 2024-04-12 16:59:45 +02:00
53fff64537 🐛 Fix invalid font used in login form on (web platform) 2024-04-12 16:24:28 +02:00
fb4554aa71 🚀 Update Dockerfile to take the new code organization into account 2024-04-12 14:44:44 +02:00
741124e47e ️ Configure cargo to Optimize the size of the generated wasm bundle 2024-04-12 14:42:41 +02:00
9951c2fea6 🔥 Remove the use of LoadingPage component
For now, the LoadingPage component is kept, just in case.
2024-04-12 14:41:31 +02:00
df33e94a12 Add web page to display during the wasm bundle 2024-04-12 14:33:10 +02:00
78cb65e054 ♻️ Move fonts and images directories in a common public on 2024-04-12 12:49:07 +02:00
77fa0c5fd5 🚀 Add the Dockerfile for the web app 2024-04-11 08:32:57 +02:00
d3a35cd81f ️ Configure turf to minify the generated CSS files 2024-04-11 08:31:33 +02:00
b524048563 ⬆️ Bump turf release (0.7.0 -> 0.8.*) 2024-04-11 08:30:29 +02:00
4ab4ac5fee ⬆️ Use of the latest matrix-sdk 0.7.* version (master branch before) 2024-04-11 08:30:17 +02:00
63 changed files with 402 additions and 57 deletions

8
.cargo/config.toml Normal file
View File

@@ -0,0 +1,8 @@
[profile.release]
opt-level = "z"
debug = false
lto = true
codegen-units = 1
panic = "abort"
strip = true
incremental = false

6
.dockerignore Normal file
View File

@@ -0,0 +1,6 @@
# .git directory is not filtered here: we need to copy the .git directory in the builder image to compute the version.
dist
medias
README.md
target
Dockerfile

29
.woodpecker/.deploy.yaml Normal file
View File

@@ -0,0 +1,29 @@
steps:
deploy:
image: euryecetelecom/woodpeckerci-kubernetes
settings:
kubernetes_server:
from_secret: kubernetes_server
kubernetes_token:
from_secret: kubernetes_token
kubernetes_cert:
from_secret: kubernetes_cert
namespace: bg92
wait: true
wait_timeout: 60s
force: true
deployment: beau-gosse-du-92-web
repo: rg.fr-par.scw.cloud/asr-projects/beau-gosse-du-92-web
container: beau-gosse-du-92-web
tag: ${CI_COMMIT_SHA}
secrets:
- kubernetes_cert
- kubernetes_server
- kubernetes_token
when:
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
depends_on:
- dockerize

View File

@@ -0,0 +1,15 @@
steps:
dockerize:
image: woodpeckerci/plugin-kaniko
settings:
registry: rg.fr-par.scw.cloud
repo: asr-projects/beau-gosse-du-92-web
tags: ${CI_COMMIT_SHA}
auto_tag: true
username: nologin
password:
from_secret: registry-password
when:
- event: push
branch: ${CI_REPO_DEFAULT_BRANCH}

View File

@@ -13,14 +13,15 @@ dioxus = "0.5.*"
dioxus-free-icons = { version = "0.8", features = ["material-design-icons-navigation", "ionicons"] } dioxus-free-icons = { version = "0.8", features = ["material-design-icons-navigation", "ionicons"] }
dioxus-sdk = { version = "0.5.*", features = ["utils"] } dioxus-sdk = { version = "0.5.*", features = ["utils"] }
matrix-sdk = { git = "https://github.com/matrix-org/matrix-rust-sdk.git", branch = "main", default-features = false, features = ["js", "rustls-tls"] } # matrix-sdk = { git = "https://github.com/matrix-org/matrix-rust-sdk.git", branch = "main", default-features = false, features = ["js", "rustls-tls"] }
matrix-sdk = { version = "0.7.*", default-features = false, features = ["js", "rustls-tls"] }
anyhow = "1.0.75" anyhow = "1.0.75"
url = "2.5.0" url = "2.5.0"
dirs = "5.0.1" dirs = "5.0.1"
ctrlc-async = "3.2.2" ctrlc-async = "3.2.2"
thiserror = "1.0.50" thiserror = "1.0.50"
turf = "0.7.0" turf = "0.8.*"
tokio = { version = "1.34.0", default-features = false, features = ["rt", "sync"] } tokio = { version = "1.34.0", default-features = false, features = ["rt", "sync"] }
log = "0.4.20" log = "0.4.20"
futures-util = "0.3.29" futures-util = "0.3.29"
@@ -34,12 +35,15 @@ async-std = "1.12.0"
tracing = "0.1.40" tracing = "0.1.40"
tracing-web = "0.1.3" tracing-web = "0.1.3"
tracing-subscriber = "0.3.18" tracing-subscriber = "0.3.18"
git-version = "0.3.9"
[target.'cfg(target_family = "wasm")'.dependencies] [target.'cfg(target_family = "wasm")'.dependencies]
web-sys = { version = "0.3.69" } web-sys = "0.3.69"
[build-dependencies] [build-dependencies]
regex = "1.10.3" regex = "1.10.3"
[package.metadata.turf]
minify = true
[package.metadata.turf.class_names] [package.metadata.turf.class_names]
template = "<original_name>--<id>" template = "<original_name>--<id>"

View File

@@ -3,14 +3,14 @@ name = "beau-gosse-du-92"
default_platform = "desktop" default_platform = "desktop"
[web.app] [web.app]
name = "beau-gosse-du-92" title = "BG92"
[web.watcher] [web.watcher]
reload_html = true reload_html = true
watch_path = ["src", "font"] watch_path = ["public/index.html", "public/assets/index.css", "src"]
[web.resource] [web.resource]
script = [] style = ["assets/index.css"]
[web.resource.dev] [web.resource.dev]
style = [] style = []

22
Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
FROM rust:latest AS builder
# Homemade docker image providing the dioxus-cli
COPY --from=rg.fr-par.scw.cloud/asr-projects/dioxus-cli:asr-0.5.2 /usr/local/bin/dx /usr/local/bin/dx
ARG JOBS_NB=${JOBS_NB:-default}
# Disable incremental compilation
# Cf. https://doc.rust-lang.org/cargo/reference/profiles.html#incremental
ARG CARGO_INCREMENTAL=0
WORKDIR /usr/src/beau-gosse-du-92
COPY . .
RUN /usr/local/bin/dx build -r --platform web -- -j ${JOBS_NB}
FROM nginx:mainline-alpine-slim
WORKDIR /usr/share/nginx/html
COPY --from=builder /usr/src/beau-gosse-du-92/dist .

1
index.html Symbolic link
View File

@@ -0,0 +1 @@
public/index.html

207
public/assets/index.css Normal file
View File

@@ -0,0 +1,207 @@
@font-face {
src: url("../fonts/Geist/Geist-Medium.woff2") format("woff2");
font-family: "Geist";
font-weight: normal;
}
@font-face {
src: url("../fonts/Geist/Geist-Bold.woff2") format("woff2");
font-family: "Geist";
font-weight: bold;
}
html, body {
height: 100%;
width: 100%;
margin: 0;
font-family: "Geist";
font-weight: normal;
}
#main {
height: 100%;
width: 100%;
}
@keyframes multicolor {
0% { fill: #1DB2CF; /* color-primary-100 */ }
33% { fill: #7E6BB6; /* color-secondary-100 */ }
66% { fill: #D53583; /* color-ternary-100 */ }
}
:root {
--wallpaper-pattern-height: 128px;
--spinner-height: calc(32px * 2);
--window-center-pos: calc(50% + (var(--wallpaper-pattern-height) / 2) - (var(--spinner-height) / 2));
}
/* @media (0px < height <= calc(var(--wallpaper-pattern-height) * 5)) { */
@media (min-height: 0px) and (max-height: 640px) {
:root {
--spinner-top: var(--window-center-pos);
}
}
/* @media (calc($wallpaper-pattern-height * 5) < height <= calc($wallpaper-pattern-height * 6)) { */
@media (min-height: 640px) and (max-height: 768px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 1));
}
}
/* @media (calc($wallpaper-pattern-height * 6) < height <= calc($wallpaper-pattern-height * 8)) { */
@media (min-height: 768px) and (max-height: 1024px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 2));
}
}
/* @media (calc($wallpaper-pattern-height * 8) < height <= calc($wallpaper-pattern-height * 10)) { */
@media (min-height: 1024px) and (max-height: 1280px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 3));
}
}
/* @media (calc($wallpaper-pattern-height * 10) < height <= calc($wallpaper-pattern-height * 12)) { */
@media (min-height: 1280px) and (max-height: 1536px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 4));
}
}
/* @media (calc($wallpaper-pattern-height * 12) < height <= calc($wallpaper-pattern-height * 14)) { */
@media (min-height: 1536px) and (max-height: 1792px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 5));
}
}
/* @media (calc($wallpaper-pattern-height * 14) < height <= calc($wallpaper-pattern-height * 16)) { */
@media (min-height: 1792px) and (max-height: 2048px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 6));
}
}
/* @media (calc($wallpaper-pattern-height * 16) < height <= calc($wallpaper-pattern-height * 18)) { */
@media (min-height: 2048px) and (max-height: 2304px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 7));
}
}
/* @media (calc($wallpaper-pattern-height * 18) < height <= calc($wallpaper-pattern-height * 20)) { */
@media (min-height: 2304px) and (max-height: 2560px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 8));
}
}
/* @media (calc($wallpaper-pattern-height * 20) < height <= calc($wallpaper-pattern-height * 22)) { */
@media (min-height: 2560px) and (max-height: 2816px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 9));
}
}
/* @media (calc($wallpaper-pattern-height * 22) < height <= calc($wallpaper-pattern-height * 24)) { */
@media (min-height: 2816px) and (max-height: 3072px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 10));
}
}
/* @media (calc($wallpaper-pattern-height * 24) < height <= calc($wallpaper-pattern-height * 26)) { */
@media (min-height: 3072px) and (max-height: 3328px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 11));
}
}
/* @media (calc($wallpaper-pattern-height * 26) < height <= calc($wallpaper-pattern-height * 28)) { */
@media (min-height: 3328px) and (max-height: 3584px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 12));
}
}
/* @media (calc($wallpaper-pattern-height * 28) < height <= calc($wallpaper-pattern-height * 30)) { */
@media (min-height: 3584px) and (max-height: 3840px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 13));
}
}
/* @media (calc($wallpaper-pattern-height * 30) < height <= calc($wallpaper-pattern-height * 32)) { */
@media (min-height: 3840px) and (max-height: 4096px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 14));
}
}
/* @media (calc($wallpaper-pattern-height * 32) < height <= calc($wallpaper-pattern-height * 34)) { */
@media (min-height: 4096px) and (max-height: 4352px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 15));
}
}
/* @media (calc($wallpaper-pattern-height * 34) < height <= calc($wallpaper-pattern-height * 36)) { */
@media (min-height: 4352px) and (max-height: 4608px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 16));
}
}
/* @media (calc($wallpaper-pattern-height * 36) < height <= calc($wallpaper-pattern-height * 38)) { */
@media (min-height: 4608px) and (max-height: 4864px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 17));
}
}
/* @media (calc($wallpaper-pattern-height * 38) < height <= calc($wallpaper-pattern-height * 40)) { */
@media (min-height: 4864px) and (max-height: 5120px) {
:root {
--spinner-top: calc(var(--window-center-pos) + (var(--wallpaper-pattern-height) * 18));
}
}
.loader {
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
.wallpaper {
height: 100%;
width: 100%;
z-index: -1;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
.content {
background-image: url("../images/wallpaper-pattern.svg");
background-position: center;
width: 150%;
height: 150%;
}
}
.spinner {
height: 5%;
aspect-ratio: 2;
position: absolute;
top: var(--spinner-top);
svg {
--fps: 4;
--duration_sec: 3;
--steps: calc(var(--duration_sec) * var(--fps));
height: 100%;
width: 100%;
fill: #1DB2CF; /* color-primary-100 */
stroke: #1B1B1B; /* greyscale-90 */
animation: 3s multicolor linear infinite;
animation-timing-function: steps(var(--steps), end);
}
}
}

View File

Before

Width:  |  Height:  |  Size: 698 B

After

Width:  |  Height:  |  Size: 698 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 494 B

After

Width:  |  Height:  |  Size: 494 B

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 221 B

View File

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 223 B

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

Before

Width:  |  Height:  |  Size: 755 B

After

Width:  |  Height:  |  Size: 755 B

View File

Before

Width:  |  Height:  |  Size: 864 B

After

Width:  |  Height:  |  Size: 864 B

View File

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 306 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 853 B

After

Width:  |  Height:  |  Size: 853 B

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 430 B

After

Width:  |  Height:  |  Size: 430 B

View File

Before

Width:  |  Height:  |  Size: 639 B

After

Width:  |  Height:  |  Size: 639 B

View File

Before

Width:  |  Height:  |  Size: 388 B

After

Width:  |  Height:  |  Size: 388 B

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 323 B

After

Width:  |  Height:  |  Size: 323 B

View File

@@ -4,7 +4,7 @@
<path fill="#1DB2CF" d="M 9.736 -15 L -30 3.337 l 23.642 -0.088 L -10.212 15 L 30 -3.425 H 6.834 L 9.736 -15 Z"/> <path fill="#1DB2CF" d="M 9.736 -15 L -30 3.337 l 23.642 -0.088 L -10.212 15 L 30 -3.425 H 6.834 L 9.736 -15 Z"/>
<path fill="#D53583" d="M 201.736 -15 L 162 3.337 l 23.642 -0.088 L 181.788 15 L 222 -3.425 H 198.834 L 201.736 -15 Z"/> <path fill="#D53583" d="M 201.736 -15 L 162 3.337 l 23.642 -0.088 L 181.788 15 L 222 -3.425 H 198.834 L 201.736 -15 Z"/>
<path fill="#1DB2CF" d="M 393.736 -15 L 354 3.337 l 23.642 -0.088 L 373.788 15 L 414 -3.425 H 390.834 L 393.736 -15 Z"/> <path fill="#1DB2CF" d="M 393.736 -15 L 354 3.337 l 23.642 -0.088 L 373.788 15 L 414 -3.425 H 390.834 L 393.736 -15 Z"/>
<path fill="#7E6BB6" d="M 109.736 50 L 70 68.337 l 23.642 -0.088 L 89.788 80 L 130 61.575 H 106.834 L 109.736 50 Z"/> <path fill="#7E6BB6" d="M 105.736 50 L 66 68.337 l 23.642 -0.088 L 85.788 80 L 126 61.575 H 102.834 L 105.736 50 Z"/>
<path fill="#7E6BB6" d="M 297.736 50 L 258 68.337 l 23.642 -0.088 L 277.788 80 L 318 61.575 H 294.834 L 297.736 50 Z"/> <path fill="#7E6BB6" d="M 297.736 50 L 258 68.337 l 23.642 -0.088 L 277.788 80 L 318 61.575 H 294.834 L 297.736 50 Z"/>
<path fill="#1DB2CF" d="M 9.736 114 L -30 132.337 l 23.642 -0.088 L -10.212 144 L 30 125.575 H 6.834 L 9.736 114 Z"/> <path fill="#1DB2CF" d="M 9.736 114 L -30 132.337 l 23.642 -0.088 L -10.212 144 L 30 125.575 H 6.834 L 9.736 114 Z"/>
<path fill="#D53583" d="M 201.736 114 L 162 132.337 l 23.642 -0.088 L 181.788 144 L 222 125.575 H 198.834 L 201.736 114 Z"/> <path fill="#D53583" d="M 201.736 114 L 162 132.337 l 23.642 -0.088 L 181.788 144 L 222 125.575 H 198.834 L 201.736 114 Z"/>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 562 B

After

Width:  |  Height:  |  Size: 562 B

View File

Before

Width:  |  Height:  |  Size: 719 B

After

Width:  |  Height:  |  Size: 719 B

53
public/index.html Normal file
View File

@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>
<head>
<!-- Hack to avoid the addition of the script part by dioxus-cli -->
<!-- <title>{base_path}</title> -->
<!-- <title>{app_name}</title> -->
<title></title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8" />
{style_include}
{script_include}
</head>
<body>
<div id="main">
<div id="preloader" class="loader">
<div class="wallpaper">
<div class="content"></div>
</div>
<div class="spinner">
<svg viewBox="0 0 184 94" xmlns="http://www.w3.org/2000/svg">
<path
stroke-linejoin="round"
stroke-width="6"
d="M121.208 2 2 57.011l70.927-.265L61.363 92 182 36.724h-69.498L121.208 2Z"
/>
</svg>
</div>
</div>
</div>
<script type="module" async>
import init from "{base_path}/assets/dioxus/beau-gosse-du-92.js";
// Ensure that everything needed to render preloader has been downloaded
// before fetching the app wasm bundle.
window.onload=function() {
init("{base_path}/assets/dioxus/beau-gosse-du-92_bg.wasm").then(
wasm => {
const preloader = document.getElementById("preloader");
if (preloader !== undefined) {
preloader.style.display = 'none';
}
if (wasm.__wbindgen_start == undefined) {
wasm.main();
}
}
);
}
</script>
</body>
</html>

View File

@@ -147,7 +147,7 @@ async fn fetch_dicebear_svg(
#[cfg(feature = "desktop")] #[cfg(feature = "desktop")]
fn gen_placeholder_fetcher<'a>(path: &'static str) -> Box<impl Future<Output = Option<String>>> { fn gen_placeholder_fetcher<'a>(path: &'static str) -> Box<impl Future<Output = Option<String>>> {
let path = format!(".{}", &path); let path = format!("./public/{}", &path);
Box::new(async move { Box::new(async move {
match read_to_string(&path).await { match read_to_string(&path).await {
Ok(content) => Some(content), Ok(content) => Some(content),

View File

@@ -5,9 +5,6 @@ mod infrastructure;
mod ui; mod ui;
mod utils; mod utils;
use std::time::Duration;
use async_std::task;
use dioxus::prelude::*; use dioxus::prelude::*;
#[cfg(feature = "desktop")] #[cfg(feature = "desktop")]
@@ -21,7 +18,6 @@ use tracing_web::MakeWebConsoleWriter;
use crate::base::{login, sync_rooms}; use crate::base::{login, sync_rooms};
use crate::base::{APP_SETTINGS, ROOMS, SESSION}; use crate::base::{APP_SETTINGS, ROOMS, SESSION};
use crate::ui::components::loading::LoadingPage;
use crate::ui::components::login::Login; use crate::ui::components::login::Login;
use crate::ui::components::main_window::MainWindow; use crate::ui::components::main_window::MainWindow;
@@ -30,17 +26,6 @@ mod base;
fn app() -> Element { fn app() -> Element {
debug!("*** App rendering ***"); debug!("*** App rendering ***");
let mut ready = use_signal(|| false);
// Dummy timer simulating the loading of the application
let _: Coroutine<()> = use_coroutine(|_: UnboundedReceiver<_>| async move {
debug!("Not ready");
task::sleep(Duration::from_secs(3)).await;
// task::sleep(Duration::from_secs(0)).await;
debug!("Ready");
ready.set(true);
});
let login_coro = use_coroutine(|rx| login(rx, &APP_SETTINGS, &SESSION)); let login_coro = use_coroutine(|rx| login(rx, &APP_SETTINGS, &SESSION));
let mut sync_rooms_coro = None; let mut sync_rooms_coro = None;
@@ -100,7 +85,6 @@ fn app() -> Element {
// } // }
} }
if *ready.read() {
if SESSION.read().is_logged { if SESSION.read().is_logged {
debug!("Should render the MainWindow component"); debug!("Should render the MainWindow component");
rsx! { rsx! {
@@ -111,11 +95,6 @@ fn app() -> Element {
Login {}, Login {},
} }
} }
} else {
rsx! {
LoadingPage {},
}
}
} }
fn main() { fn main() {

View File

@@ -230,10 +230,10 @@ body {
margin-right: 1%; margin-right: 1%;
} }
.aeroButton:hover { .aeroButton:hover {
border-image: url(./images/aerobutton_border.png) 2 round; border-image: url(/public/images/aerobutton_border.png) 2 round;
} }
.aeroButton:active { .aeroButton:active {
border-image: url(./images/aerobutton_border_down.png) 2 round; border-image: url(/public/images/aerobutton_border_down.png) 2 round;
} }
.button { .button {
@@ -246,8 +246,8 @@ body {
margin-right: 1%; margin-right: 1%;
} }
.button:hover { .button:hover {
border-image: url(./images/button_border.png) 2 round; border-image: url(/public/images/button_border.png) 2 round;
} }
.button:active { .button:active {
border-image: url(./images/button_border_down.png) 2 round; border-image: url(/public/images/button_border_down.png) 2 round;
} }

View File

@@ -47,7 +47,7 @@ pub fn AvatarSelector() -> Element {
}, },
img { img {
class: ClassName::AVATAR_SELECTOR_PICTURE, class: ClassName::AVATAR_SELECTOR_PICTURE,
src: "./images/default-avatar.png", src: "/public/images/default-avatar.png",
}, },
}, },
} }

View File

@@ -48,7 +48,7 @@ fn render_rooms_tabs(
class: ClassName::TAB, class: ClassName::TAB,
button { button {
img { img {
src: "./images/status_online.png", src: "/public/images/status_online.png",
}, },
"{room_name}", "{room_name}",
}, },

View File

@@ -13,37 +13,37 @@ pub fn Navbar() -> Element {
class: ClassName::NAVBAR, class: ClassName::NAVBAR,
button { button {
style: "background: url(./images/add_user2.png) center no-repeat", style: "background: url(/public/images/add_user2.png) center no-repeat",
}, },
button { button {
style: "background: url(./images/directory.png) center no-repeat", style: "background: url(/public/images/directory.png) center no-repeat",
}, },
button { button {
style: "background: url(./images/phone.png) center no-repeat", style: "background: url(/public/images/phone.png) center no-repeat",
}, },
button { button {
style: "background: url(./images/medias.png) center no-repeat", style: "background: url(/public/images/medias.png) center no-repeat",
}, },
button { button {
style: "background: url(./images/games.png) center no-repeat", style: "background: url(/public/images/games.png) center no-repeat",
}, },
button { button {
style: "background: url(./images/ban_user.png) center no-repeat", style: "background: url(/public/images/ban_user.png) center no-repeat",
}, },
button { button {
class: ClassName::FLEX_RIGHT_AERO_BUTTON, class: ClassName::FLEX_RIGHT_AERO_BUTTON,
style: "background: url(./images/brush.png) center no-repeat", style: "background: url(/public/images/brush.png) center no-repeat",
}, },
button { button {
class: ClassName::FLEX_LAST_BUTTON, class: ClassName::FLEX_LAST_BUTTON,
style: "background: url(./images/settings.png) center no-repeat", style: "background: url(/public/images/settings.png) center no-repeat",
}, },
}, },
} }

View File

@@ -110,7 +110,7 @@ pub fn ContactsSection(props: ContactsSectionProps) -> Element {
li { li {
onclick: move |_| on_clicked_room(&id, &CHATS_WIN_INTERFACE), onclick: move |_| on_clicked_room(&id, &CHATS_WIN_INTERFACE),
img { img {
src: "./images/status_online.png", src: "/public/images/status_online.png",
}, },
p { p {
{formatted}, {formatted},

View File

@@ -40,24 +40,24 @@ pub fn ContactsWindow() -> Element {
button { button {
class: ClassName::AERO_BUTTON, class: ClassName::AERO_BUTTON,
style: "background: url(./images/letter.png) center no-repeat", style: "background: url(/public/images/letter.png) center no-repeat",
}, },
button { button {
class: ClassName::AERO_BUTTON, class: ClassName::AERO_BUTTON,
style: "background: url(./images/directory.png) no-repeat center", style: "background: url(/public/images/directory.png) no-repeat center",
}, },
button { button {
class: ClassName::AERO_BUTTON, class: ClassName::AERO_BUTTON,
style: "background: url(./images/news.png) no-repeat center", style: "background: url(/public/images/news.png) no-repeat center",
}, },
button { button {
class: ClassName::FLEX_RIGHT_AERO_BUTTON, class: ClassName::FLEX_RIGHT_AERO_BUTTON,
style: "background: url(./images/brush.png) no-repeat center", style: "background: url(/public/images/brush.png) no-repeat center",
}, },
button { button {
class: ClassName::AERO_BUTTON, class: ClassName::AERO_BUTTON,
style: "background: url(./images/settings.png) no-repeat center", style: "background: url(/public/images/settings.png) no-repeat center",
}, },
}, },
@@ -78,12 +78,12 @@ pub fn ContactsWindow() -> Element {
button { button {
class: ClassName::BUTTON, class: ClassName::BUTTON,
style: "background: url(./images/add_user.png) no-repeat center", style: "background: url(/public/images/add_user.png) no-repeat center",
}, },
button { button {
class: ClassName::BUTTON, class: ClassName::BUTTON,
style: "background: url(./images/tbc_transfert.png) no-repeat center", style: "background: url(/public/images/tbc_transfert.png) no-repeat center",
}, },
}, },
}, },

View File

@@ -9,7 +9,7 @@ pub fn Header() -> Element {
div { div {
class: ClassName::ROOT, class: ClassName::ROOT,
img { img {
src: "./images/logo-msn.png" src: "/public/images/logo-msn.png"
} }
svg { svg {
view_box: "0 0 100 10", view_box: "0 0 100 10",

View File

@@ -90,6 +90,10 @@
} }
} }
input {
font-family: inherit;
}
&__homeserver { &__homeserver {
grid-area: homeserver; grid-area: homeserver;
} }

View File

@@ -1,4 +1,7 @@
use dioxus::prelude::*; use dioxus::prelude::*;
use git_version::git_version;
const GIT_VERSION: &str = git_version!();
turf::style_sheet!("src/ui/components/wallpaper.scss"); turf::style_sheet!("src/ui/components/wallpaper.scss");
@@ -11,6 +14,11 @@ pub fn Wallpaper() -> Element {
div { div {
class: ClassName::WALLPAPER_CONTENT, class: ClassName::WALLPAPER_CONTENT,
} }
div {
class: ClassName::WALLPAPER_VERSION,
{GIT_VERSION},
}
} }
} }
} }

View File

@@ -18,4 +18,13 @@
width: 150%; width: 150%;
height: 150%; height: 150%;
} }
&__version {
position: absolute;
top: 97vh;
font-size: 1.5vh;
color: get-color(greyscale, 80);
}
} }