Compare commits
2 commits
a7c1ff2a4a
...
5a68f41b0b
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a68f41b0b | |||
| 7403eb140b |
3 changed files with 5 additions and 3 deletions
2
cat.yarn
2
cat.yarn
|
|
@ -1 +1 @@
|
|||
{"protected":false,"mode":"f","metadata":{"name":"cat","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"cat.js":"%B/cat.js"}},"content":"{\"cat.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"program.autoOutput = false\\n\\nfor (let a of args) {\\n let file\\n try {\\n file = io.open(a)\\n } catch (e) {\\n display.print(\\\"Cannot open file\\\", 0x9000)\\n }\\n if (file) {\\n const lines = file.lines()\\n for (let line of lines) {\\n io.output(\\\"%n\\\" + line)\\n display.print(line, itty.baseStyle, false)\\n }\\n }\\n}\\n \\nquit()\"}}"}
|
||||
{"protected":false,"mode":"f","metadata":{"name":"cat","author":"Luna Magdalena :3","version":[1,1],"dependencies":[],"paths":{"cat.js":"%B/cat.js"}},"content":"{\"cat.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"program.autoOutput = false\\n\\nfor (let a of args) {\\n let file\\n try {\\n file = io.open(a)\\n } catch (e) {\\n display.print(\\\"Cannot open file\\\", 0x9000)\\n }\\n if (file) {\\n const lines = file.lines()\\n for (let line of lines) {\\n line = line.replace(/%/g, \\\"%%\\\")\\n io.output(\\\"\\\\n\\\" + line)\\n display.print(line, itty.baseStyle, false)\\n }\\n }\\n}\\n \\nquit()\"}}"}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "itty",
|
||||
"packages": {
|
||||
"cat": {"url": "~cat.yarn", "version": [1]},
|
||||
"cat": {"url": "~cat.yarn", "version": [1, 1]},
|
||||
"clear": {"url": "~clear.yarn", "version": [1]},
|
||||
"cp": {"url": "~cp.yarn", "version": [1]},
|
||||
"echo": {"url": "~echo.yarn", "version": [1]},
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
"yarn": {"url": "~yarn.yarn", "version": [1]},
|
||||
"plist": {"url": "~plist.yarn", "version": [1]},
|
||||
"kill": {"url": "~kill.yarn", "version": [1]},
|
||||
"bg": {"url": "~bg.yarn", "version": [1]}
|
||||
"bg": {"url": "~bg.yarn", "version": [1]},
|
||||
"scroll": {"scroll": "~scroll.yarn", "version": [1]}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
1
scroll.yarn
Normal file
1
scroll.yarn
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"protected":false,"mode":"f","metadata":{"name":"scroll","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"scroll.js":"%B/scroll.js"}},"content":"{\"scroll.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"if (!pipe)\\n quit()\\n\\nprogram.enterFullscreen()\\n\\nconst lines = pipe.split(\\\"\\\\n\\\")\\n\\nfunction renderLines() {\\n display.clear()\\n for (let i = start; i < lines.length; i++) {\\n if (lines[i].length / itty.width > itty.height - itty.cursorY) {\\n for (let x = 0; x < Math.floor(lines[i].length / itty.width); x++)\\n display.lift()\\n break\\n }\\n display.print(lines[i] || \\\" \\\", undefined, false)\\n }\\n}\\n\\nlet start = 0\\nrenderLines()\\n\\nfunction onInput(k) {\\n switch (k) {\\n case \\\"%^\\\":\\n start = Math.max(start - 1, 0)\\n renderLines()\\n break\\n case \\\"%v\\\":\\n start = Math.min(start + 1, lines.length - 1)\\n renderLines()\\n break\\n case \\\"%e\\\":\\n case \\\"q\\\":\\n quit()\\n }\\n}\\n\\nfunction onQuit() {\\n display.clear()\\n}\"}}"}
|
||||
Loading…
Add table
Add a link
Reference in a new issue