English | 中文
Tiefsee4 consists of the following 5 sub-projects:
The main program, using WinForm to host WebView2.
It provides Web APIs through HttpListener to enable features such as window management, file operations, and image processing.
The launcher for Tiefsee.
Since importing libraries into a .NET project slows down startup even without any code, a separate clean project is used as the entry point. The launcher checks whether the main program is already running; if it is, it uses Pipe to notify the main program to open a new window, enabling a fast startup.
Used to package the Tiefsee project into MSIX format.
Used to compile Tiefsee and TiefseeLauncher, and then package the output into a ZIP file.
## Www A web project where most of the core logic of the program resides.
It uses Gulp to bundle and compile EJS, TypeScript, SCSS, and Rust.
Www
├📁 ejs: Compiled into HTML
├📁 scss: Compiled into CSS
├📁 ts: Compiled into JS
├📁 rust: Compiled into WASM
├📁 lang: Directory for translation files
├📁 img: Directory for images; SVGs are bundled into JS via Gulp
├📁 iframe: HTML files for iframe pages
│
├📁 vendor: Directory for third-party JS files
│
├📁 css: Generated by Gulp compilation
├📁 js: Generated by Gulp compilation
├📁 wasm: Generated by Gulp compilation
│
├ MainWindow.html: Main window, generated by Gulp compilation
├ SettingWindow.html: Settings window, generated by Gulp compilation
│
└ gulpfile.js
- Install nodejs
https://nodejs.org/
- Install Gulp
npm install gulp -g
- Open the Www directory in Tiefsee4
cd Www
- Update npm packages
npm i
- Install Rust
https://www.rust-lang.org/tools/install
- Install wasm32-unknown-unknown
rustup target add wasm32-unknown-unknown
- Install wasm-pack
cargo install wasm-pack
- Bundle and compile EJS, TypeScript, SCSS, and Rust, then copy the processed files into the output folder of the Tiefsee project.
gulp build
- Continuously monitor file changes, and automatically trigger bundling and compilation whenever changes are detected.
gulp watch
Tiefsee has the function of switching themes. In order to make the icons switch colors, all icons use SVG.
After executing gulp build
, the SVG files in Www/img/default
will all be packaged into one js, output to Www/js/SvgList.js
-
In SVG, you can use
var(--color-white)
to get the main color of the current theme, for example<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25"> <rect style="fill:var(--color-white)" x="7" y="12" width="11" height="1"/> </svg>
-
In ts, you can get the text of SVG through
SvgList["svg name"]
, for examplevar svgText = SvgList["window-menu.svg"];
-
In ejs, you can get the text of SVG through
<%- await readFile("./img/default/"); %>
, for example<div> <%- await readFile("./img/default/tool-rotateCcw.svg"); %> </div>
Tiefsee is a program where all UI is rendered with WebView2,
Commonly used C# features have been encapsulated so that JavaScript can call them directly,
In most cases, there is no need to write C#, so you can directly open the Www
project with Visual Studio Code for development.