-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.html
120 lines (104 loc) · 5.39 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html>
<head prefix="og: https://ogp.me/ns#">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="Output tree from Markdown. 手作業で枝を組み立てるのは面倒、楽にツリー(treeコマンド(linux / Windows)結果のようなテキスト)を作りたい時に役に立ちます。また、このページは https://github.com/ddddddO/gtree のライブラリを Wasm 化して呼び出しています。このリポジトリには、当該ライブラリの他に、別機能・別用途のCLIツールとライブラリを提供しています。"/>
<!-- テーマカラー -->
<meta name="theme-color" content="#134e4a">
<!-- テーマカラー モード指定 -->
<meta name="theme-color" content="#134e4a" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#134e4a" media="(prefers-color-scheme: dark)">
<meta property="og:url" content="https://ddddddo.github.io/gtree/" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Tree Maker" />
<meta property="og:description" content="Output tree from Markdown. 手作業で枝を組み立てるのは面倒、楽にツリー(treeコマンド(linux / Windows)結果のようなテキスト)を作りたい時に役に立ちます。また、このページは https://github.com/ddddddO/gtree のライブラリを Wasm 化して呼び出しています。このリポジトリには、当該ライブラリの他に、別機能・別用途のCLIツールとライブラリを提供しています。" />
<meta property="og:site_name" content="Tree Maker" />
<!-- favicon.svg -->
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🌴</text></svg>">
<title>Tree Maker</title>
<link href="main.css" rel="stylesheet">
<link href="toast.css" rel="stylesheet">
<script src="wasm_exec.js"></script>
<script src="main.js"></script>
</head>
<body class="bg-teal-900 text-white px-6 py-4">
<div class="flex items-center gap-4">
<h1 class="text-3xl font-bold">
Tree Maker
</h1>
<iframe src="https://ghbtns.com/github-btn.html?user=ddddddO&repo=gtree&type=star&count=true" frameborder="0" scrolling="0" width="160px" height="30px"></iframe>
</div>
<div id="main" class="md:flex flex-row">
<div class="basis-6/12">
<textarea class="bg-teal-800 rounded-md mt-1 w-full h-64" id="in" spellcheck="false" onchange="generateTree();" oninput="generateTree();">- Output tree from Markdown.
* Assembling branches by typing is tedious.
+ This website is helpful when you want to build tree with ease.
* It can also change the format of tree branches.
* The symbols that can be used in Markdown are *, -, +, and #.
* Indentation represents hierarchy.
* The indentation can be whatever you specify, but use the same pattern.
+ The function to generate tree is written in Go and compiled into WebAssembly.
- Also, once loaded, you can enjoy offline!
* This is due to the use of Service Worker.
# Primate
+ Strepsirrhini
+ Lemuriformes
- Lemuroidea
- Cheirogaleidae
- Indriidae
- Lemuridae
- Lepilemuridae
* Daubentonioidea
* Daubentoniidae
- Lorisiformes
- Galagidae
- Lorisidae
+ Haplorrhini
- Tarsiiformes
- Tarsiidae
- Simiiformes
- Platyrrhini
- Ceboidea
- Atelidae
- Cebidae
- Pithecioidea
- Pitheciidae
- Catarrhini
- Cercopithecoidea
- Cercopithecidae
- Hominoidea
- Hylobatidae
- Hominidae</textarea>
<button class="hover:outline rounded bg-cyan-600 shadow-xl px-1 mt-1" onClick="clearTxt();" id="clearMarkdown">clear</button>
<div class="mt-4">
Parts<br>
<input class="bg-teal-800 rounded-lg w-1/5" type="text" id="parts1" value="└" onchange="generateTree();" oninput="generateTree();">
<input class="bg-teal-800 rounded-lg w-1/5" type="text" id="parts2" value="├" onchange="generateTree();" oninput="generateTree();">
<input class="bg-teal-800 rounded-lg w-1/5" type="text" id="parts3" value="──" onchange="generateTree();" oninput="generateTree();">
<input class="bg-teal-800 rounded-lg w-1/5" type="text" id="parts4" value="│" onchange="generateTree();" oninput="generateTree();">
</div>
<div>
<!-- <button class="hover:outline rounded bg-teal-600 shadow-xl px-1 mt-2 mb-2" onClick="generateTree();" id="gtree" disabled>tree!</button> -->
<button class="hover:outline rounded bg-teal-600 shadow-xl px-1 mt-2 mb-2" onClick="copyToClipboard();" id="copy">copy</button>
<button class="hover:outline rounded bg-cyan-600 shadow-xl px-1 mt-2 mb-2" onClick="reset();" id="reset">reset</button>
<div id="toast"></div>
</div>
</div>
<div class="basis-1/12"></div>
<div id="result" class="basis-5/12 overflow-x-auto"></div>
</div>
<script src="toast.js"></script>
<script src="tab.js"></script>
<script>
// register service_worker.js
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./service_worker.js').then(function(registration) {
console.log('succeeded: ', registration.scope);
}).catch(function(err) {
console.log('failed: ', err);
});
}
</script>
</body>
</html>