diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f38efc5..8630641 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,13 @@ jobs: - name: Checkout respository uses: actions/checkout@v4 + - name: Install rust toolchain + run: | + rustup update --no-self-update ${{ env.RUST_CHANNEL }} + rustup default ${{ env.RUST_CHANNEL }} + env: + RUST_CHANNEL: nightly + - name: Cache cargo binaries uses: actions/cache@v4 id: cache @@ -66,7 +73,7 @@ jobs: run: bun install --frozen-lockfile - name: Check build sass - run: bun run sass + run: bun run deploy:sass - name: Check build static run: bun run check diff --git a/.github/workflows/gh-page.yml b/.github/workflows/gh-page.yml index feb466f..75cdca6 100644 --- a/.github/workflows/gh-page.yml +++ b/.github/workflows/gh-page.yml @@ -27,6 +27,13 @@ jobs: - name: Setup Pages uses: actions/configure-pages@v3 + - name: Install rust toolchain + run: | + rustup update --no-self-update ${{ env.RUST_CHANNEL }} + rustup default ${{ env.RUST_CHANNEL }} + env: + RUST_CHANNEL: nightly + - name: Cache cargo binaries uses: actions/cache@v4 id: cache @@ -77,16 +84,13 @@ jobs: if: steps.bun-cache.outputs.cache-hit != 'true' run: bun install --frozen-lockfile - - name: Generate css from scss - run: bun run sass - - name: Build using Perseus - run: bun run build + run: bun run deploy - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: - path: ./dist/exported/ + path: ./pkg/ deploy: name: Deploy Github Pages diff --git a/Cargo.lock b/Cargo.lock index b390648..301686a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,9 +39,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -63,75 +63,26 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "axum" -version = "0.6.20" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" -dependencies = [ - "async-trait", - "axum-core", - "bitflags", - "bytes", - "futures-util", - "http", - "http-body", - "hyper", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tower", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-core" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "mime", - "rustversion", - "tower-layer", - "tower-service", -] +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -146,20 +97,14 @@ dependencies = [ name = "binhtran432k-portfolio" version = "0.1.0" dependencies = [ + "lol_alloc", "perseus", - "perseus-axum", "serde", "serde_json", "sycamore", "tokio", ] -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bumpalo" version = "3.15.4" @@ -168,9 +113,9 @@ checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" @@ -195,7 +140,7 @@ dependencies = [ "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.4", + "windows-targets", ] [[package]] @@ -291,15 +236,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - [[package]] name = "fs_extra" version = "1.3.0" @@ -362,7 +298,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -444,58 +380,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "http-range-header" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "hyper" -version = "0.14.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "iana-time-zone" version = "0.1.60" @@ -537,9 +421,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" @@ -562,6 +446,16 @@ version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.21" @@ -569,10 +463,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] -name = "matchit" -version = "0.7.3" +name = "lol_alloc" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +checksum = "83e5106554cabc97552dcadf54f57560ae6af3276652f82ca2be06120dc4c5dc" +dependencies = [ + "spin", +] [[package]] name = "memchr" @@ -580,22 +477,6 @@ version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "minify-html-onepass" version = "0.10.8" @@ -635,17 +516,6 @@ dependencies = [ "adler", ] -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.48.0", -] - [[package]] name = "nom" version = "7.1.3" @@ -707,12 +577,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - [[package]] name = "perseus" version = "0.4.2" @@ -744,17 +608,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "perseus-axum" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2a8dbd3d782f689ce771343dfcbabb724e6e130a82179043914a15d594fcc29" -dependencies = [ - "axum", - "perseus", - "tower-http", -] - [[package]] name = "perseus-macro" version = "0.4.2" @@ -767,26 +620,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.52", -] - [[package]] name = "pin-project-lite" version = "0.2.13" @@ -819,11 +652,11 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ - "aho-corasick 1.1.2", + "aho-corasick 1.1.3", "memchr", "regex-automata", "regex-syntax", @@ -835,7 +668,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ - "aho-corasick 1.1.2", + "aho-corasick 1.1.3", "memchr", "regex-syntax", ] @@ -881,18 +714,18 @@ dependencies = [ "semver", ] -[[package]] -name = "rustversion" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" - [[package]] name = "ryu" version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "semver" version = "1.0.22" @@ -916,37 +749,15 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] name = "serde_json" -version = "1.0.114" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_path_to_error" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" -dependencies = [ - "itoa", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ - "form_urlencoded", "itoa", "ryu", "serde", @@ -972,18 +783,17 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] -name = "socket2" -version = "0.5.6" +name = "spin" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" dependencies = [ - "libc", - "windows-sys 0.52.0", + "lock_api", ] [[package]] @@ -1116,21 +926,15 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - [[package]] name = "thiserror" version = "1.0.58" @@ -1148,7 +952,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -1159,13 +963,9 @@ checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", - "libc", - "mio", "num_cpus", "pin-project-lite", - "socket2", "tokio-macros", - "windows-sys 0.48.0", ] [[package]] @@ -1176,107 +976,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", -] - -[[package]] -name = "tokio-util" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-http" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" -dependencies = [ - "bitflags", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-range-header", - "httpdate", - "mime", - "mime_guess", - "percent-encoding", - "pin-project-lite", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "log", - "pin-project-lite", - "tracing-core", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", + "syn 2.0.55", ] [[package]] @@ -1309,15 +1009,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1345,7 +1036,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", "wasm-bindgen-shared", ] @@ -1379,7 +1070,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1406,40 +1097,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.4", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -1448,93 +1106,51 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.4" diff --git a/Cargo.toml b/Cargo.toml index 7280348..1eecda6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,20 +2,26 @@ name = "binhtran432k-portfolio" version = "0.1.0" edition = "2021" +description = "The official website of Binh Duc Tran." +authors = ["Binh Tran "] +license = "MIT" +repository = "https://github.com/binhtran432k/binhtran432k.github.io" +homepage = "https://binhtran432k.com" +readme = "./README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # Dependencies for the engine and the browser go here [dependencies] -perseus = { version = "=0.4.2", features = [ "hydrate" ] } -sycamore = "^0.8.1" -serde = { version = "1", features = [ "derive" ] } +perseus = { version = "=0.4.2" } +sycamore = "0.8.1" +serde = { version = "1", features = ["derive"] } serde_json = "1" # Engine-only dependencies go here [target.'cfg(engine)'.dependencies] -tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] } -perseus-axum = { version = "=0.4.2", features = [ "dflt-server" ] } +tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread"] } # Browser-only dependencies go here [target.'cfg(client)'.dependencies] +lol_alloc = "0.4.1" diff --git a/package.json b/package.json index a7b697a..ffdc19a 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,12 @@ "private": true, "type": "module", "scripts": { - "dev": "perseus serve -w", - "preview": "perseus export -w", - "check": "perseus check", - "sass": "sass static/sass:static/styles", - "sass:watch": "sass --watch static/sass:static/styles", - "build": "perseus export --release && perseus export-error-page -c 404 -o dist/exported/404.html" + "dev": "perseus export -sw | sass --watch static/sass:static/styles", + "deploy": "bun run deploy:sass && bun run deploy:web && bun run deploy:notfound", + "deploy:sass": "sass --style compressed static/sass:static/styles", + "deploy:web": "perseus deploy -e", + "deploy:notfound": "perseus export-error-page -c 404 -o pkg/404.html", + "check": "perseus check" }, "devDependencies": { "sass": "^1.72.0" diff --git a/src/components/layout.rs b/src/components/layout.rs new file mode 100644 index 0000000..8e191c8 --- /dev/null +++ b/src/components/layout.rs @@ -0,0 +1,36 @@ +use sycamore::prelude::*; + +#[component] +pub fn Layout<'a, G: Html>(cx: Scope<'a>, LayoutProps { children }: LayoutProps<'a, G>) -> View { + let children = children.call(cx); + + view! { cx, + div(class="loader") { + div(class="loader__box") { + img(src=".perseus/static/assets/images/mangekyou-sharingan.svg", alt="Loader image", class="loader__image") + div(class="loader__text") { + "L" + div(class="loader__text--dot") + "oading Experience" + div(class="loader__text--border loading__width-animation") + } + div(class="loader__bar") { + div(class="loader__bar--inner") + } + div(class="loader__counter") { + span {"0%"} + span(class="loader__counter--number") {"0%"} + } + } + script(src=".perseus/static/scripts/loader.js", defer=true) + } + main { + (children) + } + } +} + +#[derive(Prop)] +pub struct LayoutProps<'a, G: Html> { + pub children: Children<'a, G>, +} diff --git a/src/components/mod.rs b/src/components/mod.rs index 1d33710..6738e8c 100644 --- a/src/components/mod.rs +++ b/src/components/mod.rs @@ -1 +1,2 @@ +pub mod layout; pub mod seo; diff --git a/src/main.rs b/src/main.rs index 0611a3b..1ed206f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,12 @@ +extern crate alloc; + +#[cfg(client)] +use lol_alloc::{FreeListAllocator, LockedAllocator}; + +#[cfg(client)] +#[global_allocator] +static ALLOCATOR: LockedAllocator = LockedAllocator::new(FreeListAllocator::new()); + mod components; mod error_views; mod templates; @@ -5,7 +14,7 @@ mod templates; use perseus::prelude::*; use sycamore::prelude::view; -#[perseus::main(perseus_axum::dflt_server)] +#[perseus::main_export] pub fn main() -> PerseusApp { PerseusApp::new() .template(crate::templates::index::get_template()) @@ -20,9 +29,10 @@ pub fn main() -> PerseusApp { // fonts link (rel="preconnect", href="https://fonts.googleapis.com") link (rel="preconnect", href="https://fonts.gstatic.com", crossorigin="crossorigin") - link (href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap", rel="stylesheet") - // style + link (href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&family=Orbitron:wght@400;700&display=swap", rel="stylesheet") + // styles link(rel="stylesheet", href=".perseus/static/styles/base.css") + link(rel="stylesheet", href=".perseus/static/styles/loader.css") } body { // Quirk: this creates a wrapper `
` around the root `
` by necessity diff --git a/src/templates/index.rs b/src/templates/index.rs index ac567d8..35340e1 100644 --- a/src/templates/index.rs +++ b/src/templates/index.rs @@ -1,10 +1,11 @@ use perseus::prelude::*; use sycamore::prelude::*; +use crate::components::layout::Layout; + fn index_page(cx: Scope) -> View { view! { cx, - // Don't worry, there are much better ways of styling in Perseus! - div(class="test") { + Layout { h1 { "Welcome to Perseus!" } p { "This is just an example app. Try changing some code inside " diff --git a/static/assets/images/mangekyou-sharingan.svg b/static/assets/images/mangekyou-sharingan.svg new file mode 100644 index 0000000..f5e8755 --- /dev/null +++ b/static/assets/images/mangekyou-sharingan.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/sass/loader.scss b/static/sass/loader.scss new file mode 100644 index 0000000..1bbdeb2 --- /dev/null +++ b/static/sass/loader.scss @@ -0,0 +1,200 @@ +.loader { + $green: #6cff8d; + $green-50: rgba($green, 0.4); + $fg: #fff; + $bg: #0b134f; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + height: 100vh; + width: 100%; + z-index: 99; + background-color: $bg; + display: grid; + place-items: center; + font-family: "Orbitron", sans-serif; + font-size: 1.25rem; + font-weight: 700; + + @media (max-width: 355px) { + & { + font-size: 1rem; + } + } + + &__box { + position: relative; + max-width: 500px; + width: 90%; + padding: 1rem; + border: 0.1875rem solid $green; + border-top-color: $green-50; + border-bottom-color: $green-50; + } + + &--loaded &__box { + animation: box-amination 2s forwards; + + @keyframes box-amination { + 0% { + min-height: 10rem; + } + + 50% { + border-radius: 50%; + min-height: min(500px, 100vw); + } + + 100% { + border-radius: 50%; + min-height: min(500px, 100vw); + border-color: transparent; + } + } + } + + &__bar { + width: 90%; + height: 0.625rem; + margin: 2rem auto 3rem auto; + background-color: #ccc; + + &--inner { + width: 0; + height: 100%; + background-color: $green; + } + + &, + &--inner { + border-radius: 0.125rem; + } + + position: relative; + left: 0; + } + + &--loaded &__bar { + rotate: 90deg; + left: 1000%; + transition-property: left, rotate; + transition-duration: 2s; + } + + &__text { + position: relative; + padding-bottom: 1rem; + color: $fg; + text-transform: uppercase; + text-align: center; + + + &--dot { + display: inline-block; + width: 1rem; + height: 1rem; + margin: 0 0.1875rem; + border-radius: 50%; + background: $fg; + transform: translateY(10%); + animation: pulse 1s infinite; + + @keyframes pulse { + from { + opacity: 0; + background-color: $green; + } + + to { + opacity: 1; + } + } + } + + &--border { + width: 85%; + height: 0.0625rem; + background-color: $green-50; + position: absolute; + bottom: 0; + left: 50%; + transform: translateX(-50%); + } + } + + &__counter { + color: $fg; + display: flex; + justify-content: space-between; + + &--number { + color: $green; + } + } + + &--loaded &__text, + &--loaded &__counter { + opacity: 0; + transition: opacity 600ms; + } + + &__width-animation { + animation: width-amination 1s forwards; + + @keyframes width-amination { + from { + max-width: 85%; + } + + to { + max-width: 250px; + } + } + } + + &__image { + position: absolute; + top: 50%; + left: 50%; + transform-origin: 0 0; + transform: translate(-50%, -50%); + width: 85%; + height: auto; + opacity: 0; + filter: hue-rotate(310deg); + } + + &--loaded &__image { + animation: image-amination 70s forwards; + + @keyframes image-amination { + 0% { + opacity: 0; + } + + 2% { + opacity: 1; + rotate: -60deg; + } + + 100% { + opacity: 1; + rotate: -720deg; + } + } + } + + &--loaded { + animation: loaded-animation 600ms forwards; + animation-delay: 600ms; + + @keyframes loaded-animation { + to { + background-color: transparent; + opacity: 0.3; + } + } + } +} diff --git a/static/scripts/loader.js b/static/scripts/loader.js new file mode 100644 index 0000000..f1362e5 --- /dev/null +++ b/static/scripts/loader.js @@ -0,0 +1,15 @@ +(() => { + const bar = document.querySelector(".loader__bar--inner"); + const counterNum = document.querySelector(".loader__counter--number"); + if (!bar || !counterNum) return; + let i = 0; + const barInterval = setInterval(() => { + bar.style.width = `${i}%`; + counterNum.innerText = `${i}%`; + i += 10; + if (i > 100) { + clearInterval(barInterval); + document.querySelector(".loader").className = "loader loader--loaded"; + } + }, 50); +})();