跳转到内容
项目模板·Pro

Vite + Svelte + TypeScript

用 Svelte 5 和 TypeScript 写的记忆卡片,基于 Vite 8。每张卡片在五个莱特纳盒子之间移动,到期时再次出现。需要带 Node.js 的 Linux 环境;首次 npm install 约下载 45 个包(约 75 MB)。

安装它需要 PocketCode Pro。

如果你的 Android 设备上装了 PocketCode,这会在应用里打开此页面。

预览

文件

README.md
index.html
package-lock.json
package.json
public/favicon.svg
src/App.svelte
src/app.css
src/lib/ReviewCard.svelte
src/lib/leitner.ts
src/lib/storage.ts
src/main.ts
src/vite-env.d.ts
svelte.config.js
test/leitner.test.ts
tsconfig.json
vite.config.ts

README.md

# Flashcards: Svelte + Vite + TypeScript A flashcard app in Svelte 5 and TypeScript, built with Vite. Cards move through five Leitner boxes: one you know comes back after 2, 4, 8 and then 16 days, one you miss goes back to box 1 and comes back tomorrow. Cards are saved in the browser (localStorage). It shows the usual pieces of a Svelte project: runes (`$state`, `$derived`, `$effect`, `$props`), a component with typed props and a callback, and a test. ## Run it in PocketCode You need the app's Linux environment with Node.js 20.19 or newer (the Developer pack in Terminal › Linux includes Node.js and npm). 1. Open the terminal in this project's folder (Open Terminal Here, in the editor menu). 2. Install the dependencies. The first time downloads about 45 packages (around 75 MB on disk) and needs internet: ```sh npm install ``` 3. Start the development server: ```sh npm run dev ``` 4. Open http://localhost:5173 in the DevBrowser (or in the phone's browser). Saving a file updates the page. Stop the server with Ctrl+C in the terminal. With no cards yet, the Review screen offers 5 example cards so you can try it straight away. ## Other commands | Command | What it does | |---|---| | `npm run build` | Checks types and Svelte warnings with `svelte-check`, then writes the production build to `dist/` | | `npm run preview` | Serves `dist/` on http://localhost:4173 | | `npm run check` | Only the check |

此预览已截短。安装后可获得完整内容。

1.0.0 的变更

首个版本。

相关

Vite + React + TypeScriptPro项目模板用 React 和 TypeScript 写的习惯打卡应用,基于 Vite 8:每周网格、连续天数、一个自定义 hook 和一个测试。需要带 Node.js 的 Linux 环境;首次 npm install 约下载 25 个包(约 80 MB)。Vite + Vue + TypeScriptPro项目模板用 Vue 3 和 TypeScript 写的专注计时器,基于 Vite 8:专注时段、休息、今日合计、两个 composable 和一个测试。需要带 Node.js 的 Linux 环境;首次 npm install 约下载 50 个包(约 85 MB)。Next.js + Tailwind + i18nPro项目模板Next.js 15 项目,带 next-intl 和 Tailwind CSS,在 /en 和 /es 提供一个英语和西班牙语页面。深色模式跟随系统。需要带 Node.js 的 Linux 环境;首次 npm install 约下载 400 MB。静态落地页Pro项目模板纯 HTML 和 CSS 编写的单页网站:带折叠菜单的页头、首屏、功能网格、常见问题和页脚。颜色跟随系统的浅色或深色模式。无需构建,也不需要 Linux:打开 index.html,点地球图标即可。Flask + SQLite 网页应用Pro项目模板用 Flask 写的阅读清单:服务端渲染页面和普通表单,数据存入 SQLite,另有一个小型 JSON API。测试使用 Flask 的测试客户端。需要 Linux 环境中的 Python 和 pip,会安装 7 个固定版本的包。Rust 命令行:行数统计Pro项目模板用 Rust 写的命令行工具,按语言统计文件夹里的代码行、注释行和空行。这是一个没有依赖的 Cargo 项目,带单元测试。需要 Linux 环境中的 Rust 和 Cargo(约 370 MB)。