TelUI:易于使用的应用程序的 UI 框架

2作者: telui7 个月前
# TelUI TelUI 是一个基于 Electron 的 UI 框架,它打包了一些可复用的前端基本组件——颜色工具、排版助手和基本的结构样式——因此您可以以最少的设置来原型化简单的桌面 UI 想法。 ## 功能 * 捆绑的 Electron 运行器 (`npm start`),用于提供 `index.html` 以进行即时桌面预览。 * 标记化样式层:`color.css`、`font.css` 和 `header.css` 保持呈现规则的隔离,并易于混搭。 * Google Fonts 集成(Funnel Display)以及可选的实用程序类,如 `.arial`。 * 在 `icons/` 下放置图标资源,以帮助说明加载和状态。 ## 快速开始 ```bash npm install npm start ``` 该应用程序启动一个 800×600 的 Electron 窗口,加载 `index.html`。修改任何 CSS 或 HTML 文件并重新启动(或重新加载)以查看更改。 ## 项目布局 ```text index.js # Electron 引导程序 index.html # 消耗 TelUI 样式的演示画布 font.css # 排版工具和 Google Fonts 导入 color.css # 颜色标记(例如,gentleblue、brightblue、gray/grey、green) header.css # 针对标题容器的结构调整 icons/ # 共享位图 / gif 资源(例如,loading.gif) package.json # 依赖项和 npm 脚本 ``` ## 使用实用程序 1. 在您的 HTML 入口点中引用您需要的样式: ```html <link rel="stylesheet" href="font.css"> <link rel="stylesheet" href="color.css"> <link rel="stylesheet" href="header.css"> ``` 2. 应用提供的类或自定义元素标签: ```html <header class="gentleblue"> <h1 class="funneldisplay">TelUI</h1> </header> <p class="arial">Prototype copy goes here.</p> ``` `font.css` 暴露了 `.funneldisplay` 和 `.arial`。颜色标记(`gentleblue`、`brightblue`、`gray`、`grey`、`green`)既可以用作元素选择器,也可以转换为类(如果您更喜欢 `.gentleblue` 语法)。 3. 通过指向资源目录来重用图标: ```html <img src="icons/loading.gif" alt="Loading indicator"> ``` ## 扩展 TelUI * 通过更新相应的 CSS 文件来添加新的颜色标记或排版助手;保持选择器声明性和按类别组织。 * 对于额外的 Electron 行为(菜单、预加载脚本、IPC),扩展 `index.js`,同时保持 UI 导向的文件与框架无关。 * 当作为可分发的应用程序发布时,配置 `electron-builder` 或您喜欢的打包程序;当前的设置是有意为之的。 ## 许可证 除非在单个文件中另有说明,否则 TelUI 在 MIT 许可证下分发。在重新分发 TelUI 或衍生作品时,请包含许可证文本。 URL: https://github.com/eotter-beep/telui/blob/main
查看原文
# TelUI<p>TelUI is a Electron-based UI framework that packages a handful of reusable front-end primitives—color utilities, typography helpers, and basic structural styles—so you can prototype simple desktop UI ideas with minimal setup.<p>## Features - Bundled Electron runner (`npm start`) that serves `index.html` for instant desktop previews. - Tokenized styling layers: `color.css`, `font.css`, and `header.css` keep presentation rules isolated and easy to remix. - Google Fonts integration (Funnel Display) plus opt-in utility classes like `.arial`. - Drop-in icon assets under `icons&#x2F;` to help illustrate loading and status states.<p>## Quick start<p>```bash npm install npm start ```<p>The app launches an 800×600 Electron window that loads `index.html`. Modify any CSS or HTML file and restart (or reload) to see the changes.<p>## Project layout<p>```text index.js # Electron bootstrapper index.html # Demo canvas that consumes TelUI styles font.css # Typography utilities and Google Fonts import color.css # Color tokens (e.g., gentleblue, brightblue, gray&#x2F;grey, green) header.css # Structural tweaks for header containers icons&#x2F; # Shared bitmap &#x2F; gif assets (e.g., loading.gif) package.json # Dependencies and npm scripts ```<p>## Using the utilities<p>1. Reference the styles you need in your HTML entry point:<p><pre><code> ```html &lt;link rel=&quot;stylesheet&quot; href=&quot;font.css&quot;&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;color.css&quot;&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;header.css&quot;&gt; ``` </code></pre> 2. Apply the provided classes or custom element tags:<p><pre><code> ```html &lt;header class=&quot;gentleblue&quot;&gt; &lt;h1 class=&quot;funneldisplay&quot;&gt;TelUI&lt;&#x2F;h1&gt; &lt;&#x2F;header&gt; &lt;p class=&quot;arial&quot;&gt;Prototype copy goes here.&lt;&#x2F;p&gt; ``` `font.css` exposes `.funneldisplay` and `.arial`. The color tokens (`gentleblue`, `brightblue`, `gray`, `grey`, `green`) can be used either as element selectors or converted into classes if you prefer `.gentleblue` syntax. </code></pre> 3. Reuse icons by pointing to the assets directory:<p><pre><code> ```html &lt;img src=&quot;icons&#x2F;loading.gif&quot; alt=&quot;Loading indicator&quot;&gt; ``` </code></pre> ## Extending TelUI<p>- Add new color tokens or typography helpers by updating the corresponding CSS file; keep selectors declarative and organized by category. - For additional Electron behaviors (menus, preload scripts, IPC), expand `index.js` while leaving the UI-focused files framework‑agnostic. - When shipping as a distributable app, configure `electron-builder` or your favorite packager; the current setup is intentionally minimal.<p>## License<p>Unless stated otherwise in individual files, TelUI is distributed under the MIT License. Please include the license text when redistributing TelUI or derivative works,<p>URL:<p>https:&#x2F;&#x2F;github.com&#x2F;eotter-beep&#x2F;telui&#x2F;blob&#x2F;main