@khemsok/tunl 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -31
- package/dist/cli.js +4 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,16 +21,6 @@ Then just run `tunl` from anywhere.
|
|
|
21
21
|
3. Progressively reveals animated ASCII art as you stay focused
|
|
22
22
|
4. Unblocks everything when the session ends
|
|
23
23
|
|
|
24
|
-
## Art Themes
|
|
25
|
-
|
|
26
|
-
Three animated themes that evolve in real-time:
|
|
27
|
-
|
|
28
|
-
- **City Skyline** — buildings rise, windows flicker on, moon glows, stars twinkle, shooting stars streak across, clouds drift
|
|
29
|
-
- **Forest** — trees grow from trunks to full canopy, sun rises with rays, birds fly, butterflies flutter, flowers bloom
|
|
30
|
-
- **Space** — stars fill the void, planet forms with rings, nebula swirls, rocket builds and launches with animated fire, comets streak past
|
|
31
|
-
|
|
32
|
-
The art is procedurally generated and animated every 800ms — stars twinkle, windows flicker, neon signs pulse. Nothing is static.
|
|
33
|
-
|
|
34
24
|
## Controls
|
|
35
25
|
|
|
36
26
|
| Key | Action |
|
|
@@ -58,27 +48,6 @@ tunl --reset # reset config, re-run onboarding
|
|
|
58
48
|
tunl --help # show usage help
|
|
59
49
|
```
|
|
60
50
|
|
|
61
|
-
## How blocking works
|
|
62
|
-
|
|
63
|
-
tunl appends entries to `/etc/hosts` mapping blocked domains to `0.0.0.0`. This requires sudo access — you'll be prompted before the timer starts.
|
|
64
|
-
|
|
65
|
-
Sites are unblocked when:
|
|
66
|
-
- The session completes
|
|
67
|
-
- You stop the session with `r`
|
|
68
|
-
- You quit with `q` or `Ctrl+C`
|
|
69
|
-
- If the process crashes, the next run detects stale entries and cleans up
|
|
70
|
-
|
|
71
|
-
## Config
|
|
72
|
-
|
|
73
|
-
Preferences are saved to `~/.tunl.json` after first run. Edit with `tunl --config` to view, `tunl --reset` to start fresh, or press `s`/`t` in the app.
|
|
74
|
-
|
|
75
|
-
## Tech Stack
|
|
76
|
-
|
|
77
|
-
- **Runtime:** Bun
|
|
78
|
-
- **Language:** TypeScript
|
|
79
|
-
- **TUI Framework:** @opentui/react
|
|
80
|
-
- **Art:** Procedurally generated, animated every 800ms
|
|
81
|
-
|
|
82
51
|
## License
|
|
83
52
|
|
|
84
53
|
MIT
|
package/dist/cli.js
CHANGED
|
@@ -56918,7 +56918,7 @@ function useBlocker() {
|
|
|
56918
56918
|
// src/app.tsx
|
|
56919
56919
|
var ALL_THEMES = [cityTheme, forestTheme, spaceTheme];
|
|
56920
56920
|
function App({ initialDuration, noblock, extraBlocks }) {
|
|
56921
|
-
const config = loadConfig();
|
|
56921
|
+
const [config, setConfig] = import_react21.useState(() => loadConfig());
|
|
56922
56922
|
const [screen, setScreen] = import_react21.useState(config.isFirstRun ? "onboarding" : "timer");
|
|
56923
56923
|
const [blockedSites, setBlockedSites] = import_react21.useState(config.blockedSites);
|
|
56924
56924
|
const [currentTheme, setCurrentTheme] = import_react21.useState(ALL_THEMES.find((t2) => t2.name === config.theme) || cityTheme);
|
|
@@ -56927,6 +56927,7 @@ function App({ initialDuration, noblock, extraBlocks }) {
|
|
|
56927
56927
|
const timer = useTimer(initialSeconds, () => {
|
|
56928
56928
|
setScreen("completed");
|
|
56929
56929
|
recordSession(Math.round(timer.totalSeconds / 60));
|
|
56930
|
+
setConfig(loadConfig());
|
|
56930
56931
|
stopBlocking();
|
|
56931
56932
|
});
|
|
56932
56933
|
const { animTick, resetAnimation } = useAnimation(timer.timerStatus);
|
|
@@ -57122,10 +57123,10 @@ function TimerStatusMessage({
|
|
|
57122
57123
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
57123
57124
|
fg: COLORS.textMuted,
|
|
57124
57125
|
children: [
|
|
57125
|
-
config.totalSessions
|
|
57126
|
+
config.totalSessions,
|
|
57126
57127
|
" sessions \xB7",
|
|
57127
57128
|
" ",
|
|
57128
|
-
config.totalMinutesFocused
|
|
57129
|
+
config.totalMinutesFocused,
|
|
57129
57130
|
" min total",
|
|
57130
57131
|
config.currentStreak > 0 ? ` \xB7 ${config.currentStreak} day streak` : ""
|
|
57131
57132
|
]
|