Skip to content

Commit 7036e7c

Browse files
committed
ウホ
0 parents  commit 7036e7c

File tree

16 files changed

+464
-0
lines changed

16 files changed

+464
-0
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2

.github/workflows/deploy.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
on:
3+
push:
4+
branches: ["main"]
5+
permissions:
6+
contents: read
7+
pages: write
8+
id-token: write
9+
jobs:
10+
deploy:
11+
environment:
12+
name: github-pages
13+
url: ${{ steps.deployment.outputs.page_url }}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: oven-sh/setup-bun@v2
18+
- run: bun i && bun build
19+
- uses: actions/configure-pages@v5
20+
- uses: actions/upload-pages-artifact@v3
21+
with:
22+
path: './dist'
23+
- uses: actions/deploy-pages@v4

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# dependencies (bun install)
2+
node_modules
3+
4+
# output
5+
out
6+
dist
7+
*.tgz
8+
9+
# code coverage
10+
coverage
11+
*.lcov
12+
13+
# logs
14+
logs
15+
_.log
16+
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
17+
18+
# dotenv environment variable files
19+
.env
20+
.env.development.local
21+
.env.test.local
22+
.env.production.local
23+
.env.local
24+
25+
# caches
26+
.eslintcache
27+
.cache
28+
*.tsbuildinfo
29+
30+
# IntelliJ based IDEs
31+
.idea
32+
33+
# Finder (MacOS) folder config
34+
.DS_Store

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# litetool
2+
Base64エンコードとかのWebツールに広告やトラッカー蔓延っててなんか気に食わなかったのでオープンソースでWebツール作ってみたっていうやつです
3+
4+
To install dependencies:
5+
6+
```bash
7+
bun install
8+
```
9+
10+
To run:
11+
12+
```bash
13+
bun run index.ts
14+
```
15+
16+
This project was created using `bun init` in bun v1.2.21. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.

bun.lock

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<link rel="stylesheet" href="style/main.css">
7+
<title>litetool</title>
8+
</head>
9+
<body>
10+
<header>
11+
<h1><a href="#top">litetool</a></h1>
12+
<nav>
13+
<a href="#urlencode">URLエンコード</a>
14+
<a href="#urldecode">URLデコード</a>
15+
<a href="#radix">進数変換</a>
16+
</nav>
17+
</header>
18+
<main>
19+
<article id="top">
20+
<h1>litetool</h1>
21+
<p>
22+
広告も、トラッカーも無い、シンプルで透明性の高いクリーンなWebツールです。<br>
23+
GitHubリポジトリ: <a target="_blank" href="https://github.com/TNTSuperMan/litetool">TNTSuperMan/litetool</a>
24+
</p>
25+
</article>
26+
<article id="urlencode">
27+
<div class="input">
28+
<h1>URLエンコード</h1>
29+
<aside>使われている技術: <a target="_blank" href="https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent">encodeURIComponent</a></aside>
30+
<textarea></textarea>
31+
<button hidden>変換</button>
32+
</div>
33+
<samp></samp>
34+
</article>
35+
<article id="urldecode">
36+
<div class="input">
37+
<h1>URLでコード</h1>
38+
<aside>使われている技術: <a target="_blank" href="https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent">decodeURIComponent</a></aside>
39+
<textarea></textarea>
40+
<button hidden>変換</button>
41+
</div>
42+
<samp></samp>
43+
</article>
44+
<article id="radix">
45+
<div class="input">
46+
<h1>進数変換</h1>
47+
<aside>使われている技術:
48+
<a target="_blank" href="https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Number/toString">Number.prototype.toString</a>
49+
50+
<a target="_blank" href="https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/BigInt/toString">BigInt.prototype.toString</a>
51+
</aside>
52+
<input id="input" type="number" value="0"><br>
53+
<label><input class="mini" id="inradix" type="number" value="10" max="53">進数</label>
54+
<button hidden>変換</button>
55+
<div class="error" hidden></div>
56+
</div>
57+
<div class="output">
58+
<table>
59+
<tr><td>2進数</td><td id="bin"></td></tr>
60+
<tr><td>8進数</td><td id="oct"></td></tr>
61+
<tr><td>10進数</td><td id="dec"></td></tr>
62+
<tr><td>16進数</td><td id="hex"></td></tr>
63+
<tr><td><input class="mini" id="outradix" value="32" type="number">進数</td><td id="out"></td></tr>
64+
</table>
65+
</div>
66+
</article>
67+
</main>
68+
<script src="src/index.ts"></script>
69+
</body>
70+
</html>

package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "litetool",
3+
"module": "index.ts",
4+
"peerDependencies": {
5+
"typescript": "^5"
6+
},
7+
"private": true,
8+
"type": "module",
9+
"dependencies": {
10+
"base64-js": "^1.5.1"
11+
},
12+
"scripts": {
13+
"build": "bun build --outdir=dist ./index.html"
14+
}
15+
}

serve.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import index from "./index.html";
2+
3+
export default {
4+
routes: {
5+
"/": index
6+
},
7+
fetch: () => new Response,
8+
development: {
9+
hmr: true,
10+
console: true
11+
}
12+
}

src/hash.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const ACTIVE_CLASS_NAME = "active";
2+
3+
let before_hash: string | null = null;
4+
5+
function updateHash() {
6+
const hash = location.hash.substring(1);
7+
8+
if(before_hash)
9+
document.getElementById(before_hash)!.classList.remove(ACTIVE_CLASS_NAME);
10+
11+
const article = document.getElementById(hash);
12+
13+
if(!article) {
14+
before_hash = "top";
15+
document.getElementById("top")!.classList.add(ACTIVE_CLASS_NAME);
16+
} else {
17+
before_hash = hash;
18+
article.classList.add(ACTIVE_CLASS_NAME);
19+
}
20+
}
21+
22+
addEventListener("hashchange", updateHash);
23+
24+
updateHash();

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import "./hash";
2+
import "./tools";

0 commit comments

Comments
 (0)