# DESU.Life website

A studio website with multilingual content, progressive image loading, and automated releases

Source: https://works.im0o.top/en/projects/0894082f/
Date: 2023-09-01
Tags: Frontend Development, Vue, TypeScript, i18n

## Project links

- [Website](https://desu.life/)
- [Source](https://github.com/desu-life/desu-life)


I have handled the DESU.Life website's frontend since its early development, using Vue 3, Vite, and TypeScript. The work includes the pages, fonts, images, translations, and release process. Several of my frontend development posts came from details I worked through here.

## Random background images

The homepage requests a random background image from an API. The original images took a long time to load, so I prepared compressed WebP files and then added smaller previews. A preview appears first and fades away once the full image is ready.

![Progressive loading of a random background](/images/projects/desu-life/desu-life--20240719161942.gif)

The TSX component has three layers: a default background, a preview, and the full image. The API returns both image URLs, and each has its own loading state. A failed API request uses the local default image. Image load and error events control the visible layers, with an opacity transition between preview and full image.

[Implementation notes](https://blog.im0o.top/posts/116723d.html)

## Fonts and page resources

Loading complete CJK fonts meant transferring many characters the pages never used. I extracted the required characters from page text and translation files, then generated WOFF2 subsets as part of the build.

Images use WebP and lazy loading where appropriate. I split some components with defineAsyncComponent and added loading placeholders. The server uses gzip to reduce transfer size.

I documented the work in posts on [font subsetting](https://blog.im0o.top/posts/e1035436.html), [gzip](https://blog.im0o.top/posts/a967f839.html), [lazy-loaded images](https://blog.im0o.top/posts/bf087cd4.html), and [asynchronous components](https://blog.im0o.top/posts/6317b38a.html).

![Collect characters from pages and translation files to build a WOFF2 font subset](https://image.im0o.top/2026/20261117104116599.webp "Collect characters from pages and translation files to build a WOFF2 font subset")

## Languages and components

vue-i18n manages Chinese, English, Japanese, and Korean, with GitLocalize in the translation workflow. Translation files are separate from page components, and switching language updates the HTML lang attribute.

Page sections cover devices, the team, and support links. Components such as Device, DefaultModal, and Footer handle their respective content and interactions, while image-loading behavior stays in the image component.

## Releases

GitHub Actions builds and uploads the site, then updates its deployed version. Conventional Commits distinguish routine changes from releases and supply the version history.

The deployment endpoint uses a timestamp and HMAC to generate a one-time password. I wrote up the [authentication mechanism](https://blog.im0o.top/posts/29f324f.html) and the [release workflow](https://blog.im0o.top/posts/31eaaef6.html).

[Website](https://desu.life) · [Source code](https://github.com/desu-life/desu-life)


[Related experience](/en/about/#desu-life)

