Compare commits

..

No commits in common. "d9f904231a5716548cdedb0215426f4bc275c790" and "3fb233ebcc3f7820136b81cabcb13c19b0a15fdf" have entirely different histories.

18 changed files with 159 additions and 289 deletions

131
Cargo.lock generated
View File

@ -87,6 +87,19 @@ dependencies = [
"pin-project-lite",
]
[[package]]
name = "async-compression"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e9eabd7a98fe442131a17c316bd9349c43695e49e730c3c8e12cfb5f4da2693"
dependencies = [
"flate2",
"futures-core",
"memchr",
"pin-project-lite",
"tokio",
]
[[package]]
name = "async-lock"
version = "3.3.0"
@ -117,7 +130,7 @@ dependencies = [
[[package]]
name = "athome"
version = "0.2.1"
version = "0.1.0"
dependencies = [
"dioxus",
"dioxus-free-icons",
@ -485,6 +498,15 @@ dependencies = [
"libc",
]
[[package]]
name = "crc32fast"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa"
dependencies = [
"cfg-if",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.19"
@ -572,9 +594,9 @@ dependencies = [
[[package]]
name = "dioxus"
version = "0.5.6"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8e7fe217b50d43b27528b0f24c89b411f742a3e7564d1cfbf85253f967954db"
checksum = "1e50735a28b303b0d67e1b5637fb57e4711bf2776266290cbc987c0adfdabb55"
dependencies = [
"dioxus-config-macro",
"dioxus-core",
@ -593,9 +615,9 @@ dependencies = [
[[package]]
name = "dioxus-cli-config"
version = "0.5.6"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7dffc452ed91af6ef772b0d9a5899573f6785314e97c533733ec55413c01df3"
checksum = "a5d4661064bad2f0b12929faf6c9cea4d94e60217ba6b11ff4146b505a57124b"
dependencies = [
"once_cell",
"serde",
@ -605,9 +627,9 @@ dependencies = [
[[package]]
name = "dioxus-config-macro"
version = "0.5.6"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb1a1aa34cc04c1f7fcbb7a10791ba773cc02d834fe3ec1fe05647699f3b101f"
checksum = "ebe244197b320dec9e9f38742985fe98c058136ada770df73e9429878ed92863"
dependencies = [
"proc-macro2",
"quote",
@ -615,9 +637,9 @@ dependencies = [
[[package]]
name = "dioxus-core"
version = "0.5.6"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3730d2459ab66951cedf10b09eb84141a6eda7f403c28057cbe010495be156b7"
checksum = "088daa3f45aaa729e9eef32dc0a9393dd709ee906b092089e5839cad1cad7c85"
dependencies = [
"futures-channel",
"futures-util",
@ -626,16 +648,15 @@ dependencies = [
"rustc-hash",
"serde",
"slab",
"slotmap",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "dioxus-core-macro"
version = "0.5.6"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d9c0dfe0e6a46626fa716c4aa1d2ccb273441337909cfeacad5bb6fcfb947d2"
checksum = "e29a07448245451334eec2883a394e207f28caedf0a57fd1a903e9ccea0b9531"
dependencies = [
"constcat",
"convert_case",
@ -663,11 +684,12 @@ dependencies = [
[[package]]
name = "dioxus-fullstack"
version = "0.5.6"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b80f0ac18166302341164e681322e0385131c08a11c3cc1c51ee8df799ab0d3d"
checksum = "db7fb1a22ff7af8756bc9506eebfbecf374b1c8c57f087c85c752ba8bd767fce"
dependencies = [
"anymap",
"async-compression",
"async-trait",
"axum",
"base64",
@ -701,9 +723,9 @@ dependencies = [
[[package]]
name = "dioxus-hooks"
version = "0.5.6"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa8f9c661eea82295219d25555d5c0b597e74186b029038ceb5e3700ccbd4380"
checksum = "5a8c7019308a6d8381fce84a51006f207407af265aebc5425871399c98d788e4"
dependencies = [
"dioxus-core",
"dioxus-debug-cell",
@ -718,9 +740,9 @@ dependencies = [
[[package]]
name = "dioxus-hot-reload"
version = "0.5.6"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77d01246cb1b93437fb0bbd0dd11cfc66342d86b4311819e76654f2017ce1473"
checksum = "8d5a28a2af6655473c6521fb5a428538807b985e8e5f1a8c30e2ab71bd54e637"
dependencies = [
"dioxus-core",
"dioxus-html",
@ -732,9 +754,9 @@ dependencies = [
[[package]]
name = "dioxus-html"
version = "0.5.6"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f01a0826f179adad6ea8d6586746e8edde0c602cc86f4eb8e5df7a3b204c4018"
checksum = "a8d612d9732f32adc1852e13e1387a9d5baa710b0b004641b5123def53065c8d"
dependencies = [
"async-trait",
"dioxus-core",
@ -755,9 +777,9 @@ dependencies = [
[[package]]
name = "dioxus-html-internal-macro"
version = "0.5.6"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b96f35a608d0ab8f4ca6f66ce1828354e4ebd41580b12454f490221a11da93c"
checksum = "1799f34affdb158f6ebec23b46b11f9e65de0bbadbbb781dc68c3eddfe6fd32b"
dependencies = [
"convert_case",
"proc-macro2",
@ -767,9 +789,9 @@ dependencies = [
[[package]]
name = "dioxus-interpreter-js"
version = "0.5.6"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "351fad098c657d14f3ac2900362d2b86e83c22c4c620a404839e1ab628f3395b"
checksum = "cc68a22e33562317b40ccc7b2d140017e510745c5d7e062e911c6a4f9042e4b1"
dependencies = [
"dioxus-core",
"dioxus-html",
@ -778,15 +800,14 @@ dependencies = [
"sledgehammer_bindgen",
"sledgehammer_utils",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
]
[[package]]
name = "dioxus-lib"
version = "0.5.6"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8bd39b2c41dd1915dcb91d914ea72d8b646f1f8995aaeff82816b862ec586ecd"
checksum = "9af36a9f985ad68783acf62dc276b0a8f0aa928f1c3b42f78e2ae222b19d445c"
dependencies = [
"dioxus-core",
"dioxus-core-macro",
@ -798,9 +819,9 @@ dependencies = [
[[package]]
name = "dioxus-liveview"
version = "0.5.6"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ada18a8fe0764f492fd4fb169b818877799e887dbb6ffb19289801d924faf18"
checksum = "2dc132aacc3eb3d11db8f20afa5f3cfc74147374cc41285488083476a0ed1f17"
dependencies = [
"axum",
"dioxus-cli-config",
@ -836,9 +857,9 @@ dependencies = [
[[package]]
name = "dioxus-router"
version = "0.5.6"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c235c5dbeb528c0c2b0424763da812e7500df69b82eddac54db6f4975e065c5f"
checksum = "0c4cbbc1aff811aa3715c94a7ca0375be0be34356aba7f3897328d844323519b"
dependencies = [
"dioxus-cli-config",
"dioxus-fullstack",
@ -858,9 +879,9 @@ dependencies = [
[[package]]
name = "dioxus-router-macro"
version = "0.5.6"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e7cd1c5137ba361f2150cdea6b3bc9ddda7b1af84b22c9ee6b5499bf43e1381"
checksum = "67fcb6e4a203dc816bca720c638562d5a782695dc71d6598de088ce50ba2a0f8"
dependencies = [
"proc-macro2",
"quote",
@ -870,9 +891,9 @@ dependencies = [
[[package]]
name = "dioxus-rsx"
version = "0.5.6"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15c400bc8a779107d8f3a67b14375db07dbd2bc31163bf085a8e9097f36f7179"
checksum = "faa83056104f63fdc6f7f9fc1137208c7b7648bf88d6c86db1e095f15297a0f3"
dependencies = [
"dioxus-core",
"internment",
@ -901,9 +922,9 @@ dependencies = [
[[package]]
name = "dioxus-signals"
version = "0.5.7"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e3e224cd3d3713f159f0199fc088c292a0f4adb94996b48120157f6a8f8342d"
checksum = "4fd04e2b3739d5c12255005cbf3185446e750fc2b3eeee9fa4e83c989132415c"
dependencies = [
"dioxus-core",
"futures-channel",
@ -917,9 +938,9 @@ dependencies = [
[[package]]
name = "dioxus-ssr"
version = "0.5.6"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "753b1eb29372bb3afcdbc0ac603893802a8b7b70fa94b86a1641408e2b87173b"
checksum = "30ba8e16b3c7e154a61d814a39505c910403b9df29a113e2920cd23334a4e71c"
dependencies = [
"askama_escape",
"async-trait",
@ -938,9 +959,9 @@ dependencies = [
[[package]]
name = "dioxus-web"
version = "0.5.6"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0855ac81fcc9252a0863930a7a7cbb2504fc1b6efe893489c8d0e23aaeb2cb9"
checksum = "a75cfbe115b193a05c649a80a54a90a6bdd88779694a617daf27d287d6fb944f"
dependencies = [
"async-trait",
"console_error_panic_hook",
@ -963,9 +984,9 @@ dependencies = [
[[package]]
name = "dioxus_server_macro"
version = "0.5.6"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5ef2cad17001c1155f019cb69adbacd620644566d78a77d0778807bb106a337"
checksum = "4b723da95503f739f9fc5fb23b6ad1e456f1438a496a0427210fa94e4e0d5fe9"
dependencies = [
"convert_case",
"proc-macro2",
@ -1095,6 +1116,16 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
[[package]]
name = "flate2"
version = "1.0.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4556222738635b7a3417ae6130d8f52201e45a0c4d1a907f0826383adb5f85e7"
dependencies = [
"crc32fast",
"miniz_oxide",
]
[[package]]
name = "fnv"
version = "1.0.7"
@ -1226,9 +1257,9 @@ dependencies = [
[[package]]
name = "generational-box"
version = "0.5.6"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "557cf2cbacd0504c6bf8c29f52f8071e0de1d9783346713dc6121d7fa1e5d0e0"
checksum = "f132919c96b85c02a067ceae965fd50ace57111e2f55c7384b95ac191f4d966b"
dependencies = [
"parking_lot",
]
@ -2645,16 +2676,6 @@ dependencies = [
"rustc-hash",
]
[[package]]
name = "slotmap"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a"
dependencies = [
"serde",
"version_check",
]
[[package]]
name = "smallvec"
version = "1.13.2"

View File

@ -1,6 +1,6 @@
[package]
name = "athome"
version = "0.2.1"
version = "0.1.0"
authors = ["Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>"]
edition = "2021"

View File

@ -1,9 +1,9 @@
FROM rust:1.79.0 AS dioxus
FROM rust:1.77.2 as dioxus
RUN cargo install dioxus-cli@^0.5
FROM dioxus AS builder
FROM dioxus as builder
WORKDIR /athome/
RUN apt-get update && apt-get install nodejs npm libssl-dev musl-tools -y && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install nodejs npm -y && rm -rf /var/lib/apt/lists/*
RUN npm install -D tailwindcss
COPY ./src/ ./src/
COPY ./assets/ ./assets/
@ -13,7 +13,7 @@ COPY ./Dioxus.toml ./Dioxus.toml
COPY ./tailwind.config.js ./tailwind.config.js
RUN npx tailwindcss -i ./input.css -o ./assets/tailwind.css && dx build --platform fullstack --release
FROM dioxus AS runner
FROM dioxus as runner
WORKDIR /app/
COPY --from=builder /athome/docs/ ./docs/
CMD [ "./docs/athome" ]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

View File

@ -1,41 +0,0 @@
User-agent: CCBot
Disallow: /
User-agent: img2dataset
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: anthropic-ai
Disallow: /
User-agent: Claude-Web
Disallow: /
User-agent: Omgilibot
Disallow: /
User-agent: Omgili
Disallow: /
User-agent: FacebookBot
Disallow: /
User-agent: Bytespider
Disallow: /
User-agent: magpie-crawler
Disallow: /
User-Agent: GPTBot
Disallow: /
User-agent: *
Disallow: /*
Allow: /
Allow: /resume
Allow: /publications
Allow: /consulting
Sitemap: https://www.tudattr.dev/sitemap.xml

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.tudattr.dev/</loc>
<lastmod>2024-07-25</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://www.tudattr.dev/resume</loc>
<lastmod>2024-07-25</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://www.tudattr.dev/publications</loc>
<lastmod>2024-07-25</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://www.tudattr.dev/consulting</loc>
<lastmod>2024-07-25</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>

View File

@ -554,40 +554,6 @@ video {
--tw-contain-style: ;
}
.container {
width: 100%;
}
@media (min-width: 640px) {
.container {
max-width: 640px;
}
}
@media (min-width: 768px) {
.container {
max-width: 768px;
}
}
@media (min-width: 1024px) {
.container {
max-width: 1024px;
}
}
@media (min-width: 1280px) {
.container {
max-width: 1280px;
}
}
@media (min-width: 1536px) {
.container {
max-width: 1536px;
}
}
.static {
position: static;
}
@ -676,6 +642,10 @@ video {
display: flex;
}
.inline-flex {
display: inline-flex;
}
.size-auto {
width: auto;
height: auto;
@ -725,6 +695,11 @@ video {
width: 0.75rem;
}
.w-fit {
width: -moz-fit-content;
width: fit-content;
}
.w-full {
width: 100%;
}
@ -742,8 +717,8 @@ video {
max-width: 2rem;
}
.max-w-md {
max-width: 28rem;
.max-w-screen-xl {
max-width: 1280px;
}
.max-w-sm {
@ -754,10 +729,6 @@ video {
max-width: 36rem;
}
.flex-grow {
flex-grow: 1;
}
.cursor-pointer {
cursor: pointer;
}
@ -774,8 +745,8 @@ video {
align-items: center;
}
.justify-end {
justify-content: flex-end;
.justify-start {
justify-content: flex-start;
}
.justify-center {
@ -796,10 +767,8 @@ video {
margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse)));
}
.space-y-2 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0;
margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));
.overflow-hidden {
overflow: hidden;
}
.overflow-x-auto {
@ -956,6 +925,10 @@ video {
background-clip: text;
}
.p-1 {
padding: 0.25rem;
}
.p-3 {
padding: 0.75rem;
}
@ -1076,10 +1049,6 @@ video {
text-transform: uppercase;
}
.italic {
font-style: italic;
}
.leading-none {
line-height: 1;
}
@ -1282,16 +1251,6 @@ video {
margin-top: 0px;
}
.sm\:flex-row {
flex-direction: row;
}
.sm\:space-y-0 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0;
margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse)));
margin-bottom: calc(0px * var(--tw-space-y-reverse));
}
.sm\:text-center {
text-align: center;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,20 +1,9 @@
#!/bin/sh
TAG=$(git branch | grep "*" | awk '{ print $2 }')
VERSION=0.1.1
LOCAL_IMAGE="athome"
REGISTRY="mos4"
REMOTE_IMAGE="athome"
DOCKERFILE="./Dockerfile"
echo "DOCKERFILE: $DOCKERFILE"
echo "TAG: $TAG"
echo "LOCAL_IMAGE: $LOCAL_IMAGE"
echo "REGISTRY: $REGISTRY"
echo "REMOTE_IMAGE: $REMOTE_IMAGE"
#docker buildx build --platform linux/amd64,linux/arm64 -f ${DOCKERFILE} -t \
# ${REGISTRY}/${REMOTE_IMAGE}:${TAG} . --push
docker buildx build --platform linux/amd64 -f ${DOCKERFILE} \
-t ${REGISTRY}/${REMOTE_IMAGE}:${TAG} \
-t ${REGISTRY}/${REMOTE_IMAGE}:latest . --push
docker build -t $LOCAL_IMAGE .
docker tag $LOCAL_IMAGE:latest mos4/$REMOTE_IMAGE:$VERSION
docker push mos4/$REMOTE_IMAGE:$VERSION

View File

@ -80,7 +80,7 @@ pub fn Card(prop: CardProp) -> Element {
div {
class: "pb-4",
div {
class: "justify-between",
class: "flex justify-between",
Picture {src: "{prop.picture}"},
}
}
@ -112,11 +112,11 @@ pub fn UnderConstruction() -> Element {
rsx! {
div {
class:"rounded justify-between w-full p-4 border-b border-gray-200 bg-gray-50 dark:bg-gray-700 dark:border-gray-600 my-8",
class:"rounded flex justify-between w-full p-4 border-b border-gray-200 bg-gray-50 dark:bg-gray-700 dark:border-gray-600 my-8",
div {
class:"items-center mx-auto",
class:"flex items-center mx-auto",
p {
class:"items-center text-sm font-normal text-gray-500 dark:text-gray-400",
class:"flex items-center text-sm font-normal text-gray-500 dark:text-gray-400",
span { { translate!(i18, "components.under_construction") } }
}
}

View File

@ -29,7 +29,7 @@ fn Introduction() -> Element {
class: "flex",
img {
class: "rounded-full w-16 h-16 mx-16",
src: "/pictures/headshot.webp"
src: "/pictures/portrait.webp"
}
P { { translate!(i18, "cv.introduction") }}
}

View File

@ -6,34 +6,34 @@ use dioxus_sdk::{i18n::use_i18, translate};
pub fn Home() -> Element {
let i18 = use_i18();
rsx! {
div {
class: "container mx-auto p-4 flex items-center justify-center max-w-md w-full",
Card {
name: translate!(i18, "home.card.name"),
gender: translate!(i18, "home.card.gender"),
picture: "/pictures/headshot.webp",
Card {
name: translate!(i18, "home.card.name"),
gender: translate!(i18, "home.card.gender"),
picture: "/pictures/comfy.webp",
div {
class: "py-4",
div {
class: "py-4",
div {
class: "mb-2",
P { { translate!(i18, "home.card.l1") } },
P { { translate!(i18, "home.card.l2") } },
P { { translate!(i18, "home.card.l3") },
Link {
to: "https://git.tudattr.dev/explore/repos",
new_tab: true,
class: "items-center font-medium hover:underline",
"gitea"},
{ translate!(i18, "home.card.l3_1") }
},
class: "mb-2",
P { { translate!(i18, "home.card.l1") } },
P { { translate!(i18, "home.card.l2") } },
P { { translate!(i18, "home.card.l3") },
Link {
to: "https://git.tudattr.dev/explore/repos",
new_tab: true,
class: "inline-flex items-center font-medium hover:underline",
"gitea"},
{ translate!(i18, "home.card.l3_1") }
},
},
Link {
to: "mailto:tuan-dat.tran@tudattr.dev",
class: "text-gray-900 bg-gradient-to-br from-green-400 to-blue-600 group-hover:from-green-400 group-hover:to-blue-600 hover:text-white rounded-full shadow-lg py-4 px-4",
},
Link {
to: "mailto:tuan-dat.tran@tudattr.dev",
class: "w-fit relative inline-flex items-center justify-center p-1 mb-2 me-2 overflow-hidden text-sm font-medium text-gray-900 rounded-lg group bg-gradient-to-br from-green-400 to-blue-600 group-hover:from-green-400 group-hover:to-blue-600 hover:text-white dark:text-white w-fill",
p {
class: "p-1",
{ translate!(i18, "home.card.contact_button") }
}
},
}
}
},
}
}

View File

@ -8,7 +8,6 @@ pub fn Footer() -> Element {
rsx! {
div {
class: "container mx-auto",
// ToolsUsed {},
footer {
class:"bg-white rounded-lg shadow dark:bg-gray-800",

View File

@ -9,25 +9,21 @@ pub fn Header() -> Element {
rsx! {
nav {
div {
// class: "justify-between p-4 space-x-8",
class: "container mx-auto p-4",
class: "flex items-center justify-between p-4 space-x-8",
Link {
to: Route::Home {},
class: "justify-start",
img { src:"/pictures/ClackCat_t.webp", class:"rounded-full h-8", alt:"TuDatTr Logo" },
},
ul {
class:"flex flex-col justify-between sm:flex-row justify-center space-y-2 sm:space-y-0 sm:space-s-4",
li {
Link {
to: Route::Home {},
class: "rounded-md shadow-sm",
img { src:"/pictures/ClackCat_t.webp", class:"rounded-full h-8", alt:"TuDatTr Logo" },
},
},
class:"flex space-x-8",
li { HeaderLink { url: Route::Home {}, text: translate!(i18, "headers.home")} },
li { HeaderLink { url: Route::CV {}, text: translate!(i18, "headers.cv") } },
li { HeaderLink { url: Route::PublicationsProjects {}, text: translate!(i18, "headers.publications_projects") } },
li { HeaderLink { url: Route::Consulting {}, text: translate!(i18, "headers.consulting") } },
li { HeaderLink { url: Route::Impressum {}, text: translate!(i18, "headers.about") } },
li { LanguageButtonGroup {} },
},
LanguageButtonGroup { },
}
}
}
@ -42,7 +38,7 @@ fn LanguageButtonGroup() -> Element {
rsx! {
div {
class: "rounded-md shadow-sm justify-end",
class: "inline-flex rounded-md shadow-sm",
button { class: "px-4 py-2 text-sm font-medium text-gray-900 bg-white border border-gray-200 rounded-s-lg hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:bg-gray-800 dark:border-gray-700 dark:text-white dark:hover:text-white dark:hover:bg-gray-700 dark:focus:ring-blue-500 dark:focus:text-white", onclick: change_to_english, label { { translate!(i18, "headers.language_buttons.english") } } },
button { class: "px-4 py-2 text-sm font-medium text-gray-900 bg-white border border-gray-200 rounded-e-lg hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:bg-gray-800 dark:border-gray-700 dark:text-white dark:hover:text-white dark:hover:bg-gray-700 dark:focus:ring-blue-500 dark:focus:text-white", onclick: change_to_german, label { { translate!(i18, "headers.language_buttons.german") } } }
}

View File

@ -9,17 +9,16 @@ use header::Header;
pub fn Layout() -> Element {
rsx! {
meta {
name: "description",
content: "Explore Tuan-Dat Tran's personal website featuring his CV, publications, projects, and consulting services. Get insights into his professional journey and connect for collaboration opportunities.",
}
div {
class: "flex flex-col min-h-screen" ,
Header {},
Body {
Outlet::<Route> {},
class: "flex justify-center ",
div {
class: "max-w-screen-xl flex-col" ,
Header {},
Body {
Outlet::<Route> {},
}
Footer {},
}
Footer {},
}
}
}

View File

@ -60,6 +60,10 @@ fn App() -> Element {
});
rsx! {
meta {
name: "robots",
content: "noindex",
},
div {
class: "bg-white dark:bg-gray-900 min-h-screen",
Router::<Route> {},
@ -71,7 +75,7 @@ fn App() -> Element {
fn PageNotFound(route: Vec<String>) -> Element {
rsx! {
div {
class: "h-screen items-center justify-center",
class: "h-screen flex items-center justify-center",
img {
class: "size-auto",
src: "https://raw.githubusercontent.com/SAWARATSUKI/ServiceLogos/main/404Notfound/NotFound.png"
@ -88,7 +92,7 @@ pub struct BodyProp {
pub fn Body(prop: BodyProp) -> Element {
rsx! {
div {
class: "flex-grow container mx-auto p-4",
class: "my-4 flex justify-center",
{prop.children}
}
}

View File

@ -60,7 +60,6 @@ fn Publications() -> Element {
}
}
fn Publication(prop: PublicationProp) -> Element {
let pattern = "T.-D. Tran";
rsx! {
Link {
class:"block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700",
@ -72,11 +71,8 @@ fn Publication(prop: PublicationProp) -> Element {
},
span { class: "text-lg text-gray-900 dark:text-white", "{prop.conference}" },
p {
class:"font-normal text-gray-700 dark:text-gray-400 italic",
Authors {
authors: "{prop.authors}",
pattern: "{pattern}",
},
class:"font-normal text-gray-700 dark:text-gray-400",
"{prop.authors}",
}
p {
class:"font-normal text-gray-700 dark:text-gray-400",
@ -129,8 +125,6 @@ struct ProjectProp {
}
fn Project(prop: ProjectProp) -> Element {
let pattern = "T.-D. Tran";
rsx! {
Link {
class:"block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700",
@ -143,10 +137,7 @@ fn Project(prop: ProjectProp) -> Element {
p { class: "text-lg text-gray-900 dark:text-white", "{prop.kind}" },
p {
class:"font-normal text-gray-700 dark:text-gray-400",
Authors {
authors: "{prop.authors}",
pattern: "{pattern}",
},
"{prop.authors}",
}
p {
class:"font-normal text-gray-700 dark:text-gray-400",
@ -155,23 +146,3 @@ fn Project(prop: ProjectProp) -> Element {
}
}
}
#[derive(Clone, PartialEq, Props)]
struct AuthorProp {
authors: String,
pattern: String,
}
fn Authors(prop: AuthorProp) -> Element {
if let Some(start) = prop.authors.find(&prop.pattern) {
let end = start + prop.pattern.len();
let left = &prop.authors[..start];
let middle = &prop.authors[start..end];
let right = &prop.authors[end..];
rsx! {
"{left}" , b { "{middle}" }, "{right}",
}
} else {
rsx! { "{prop.authors}" }
}
}