forked from xhgit/webup-cloud
Initial import of WebUp Cloud
This commit is contained in:
commit
db82325ed7
216 files changed
+33718
No files matched your search
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"apiVersion": 1,
|
||||
"type": "theme",
|
||||
"id": "studio.forest",
|
||||
"version": "1.0.0",
|
||||
"name": "森林主题",
|
||||
"description": "一套包含浅色与深色配色的绿色主题。"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"light": {
|
||||
"accent": "#146B57",
|
||||
"accentSoft": "#DCF5EB",
|
||||
"background": "#F1F8F4",
|
||||
"surface": "#FFFFFF",
|
||||
"text": "#13382C",
|
||||
"muted": "#4B675D",
|
||||
"border": "#CBDDD3",
|
||||
"soft": "#E8F3ED"
|
||||
},
|
||||
"dark": {
|
||||
"accent": "#399D83",
|
||||
"accentSoft": "#21493D",
|
||||
"background": "#15271F",
|
||||
"surface": "#20352B",
|
||||
"text": "#E3F6ED",
|
||||
"muted": "#ACCABD",
|
||||
"border": "#355548",
|
||||
"soft": "#273F34"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>文字统计</title>
|
||||
<style>
|
||||
* { box-sizing: border-box; }
|
||||
body { max-width: 740px; margin: 0 auto; padding: 28px; font: 16px system-ui; color: #18352e; background: #f6fbf8; }
|
||||
h1 { font-size: 24px; }
|
||||
label { display: block; margin-bottom: 7px; }
|
||||
textarea { width: 100%; padding: 12px; border: 1px solid #b6cfc5; border-radius: 8px; font: inherit; resize: vertical; }
|
||||
output { display: block; margin-top: 12px; font-weight: 600; }
|
||||
</style>
|
||||
<h1>文字统计</h1>
|
||||
<label for="source">输入文字</label>
|
||||
<textarea id="source" rows="8"></textarea>
|
||||
<output id="count" for="source" aria-live="polite">0 个字符 · 0 个词 · 0 行</output>
|
||||
<script>
|
||||
const source = document.getElementById("source");
|
||||
const count = document.getElementById("count");
|
||||
const segmenter = new Intl.Segmenter("zh-CN", { granularity: "word" });
|
||||
source.addEventListener("input", () => {
|
||||
const text = source.value;
|
||||
const characters = Array.from(text).length;
|
||||
const words = Array.from(segmenter.segment(text)).filter((part) => part.isWordLike).length;
|
||||
const lines = text ? text.split("\n").length : 0;
|
||||
count.textContent = `${characters} 个字符 · ${words} 个词 · ${lines} 行`;
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"apiVersion": 1,
|
||||
"type": "plugin",
|
||||
"id": "studio.word-counter",
|
||||
"version": "1.0.0",
|
||||
"name": "文字统计",
|
||||
"description": "计算输入文本的字符数、词数与行数。"
|
||||
}
|
||||
Reference in new issue
Block a user