first commit
This commit is contained in:
38
src/index.ts
Normal file
38
src/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import "dotenv"
|
||||
import { Screen, Box, Flow, Text, Button, interceptConsoleLog, ConsoleLog, iTerm2, Window, Flex } from 'wretched'
|
||||
import * as utility from "wretched/dist/components/utility";
|
||||
import { projectView } from "./components/listProjects.js";
|
||||
|
||||
|
||||
|
||||
interceptConsoleLog();
|
||||
process.title = 'Wretched';
|
||||
|
||||
const consoleLog = new ConsoleLog({
|
||||
height: 10,
|
||||
})
|
||||
const [screen, program] = await Screen.start(
|
||||
async (program) => {
|
||||
await iTerm2.setBackground(program, [23, 23, 23])
|
||||
|
||||
return new Window({
|
||||
child: new utility.TrackMouse({
|
||||
content: Flex.down({
|
||||
children: [
|
||||
['flex1', projectView],
|
||||
['natural', consoleLog],
|
||||
],
|
||||
}),
|
||||
}),
|
||||
})
|
||||
},
|
||||
)
|
||||
|
||||
program.key('escape', function () {
|
||||
consoleLog.clear()
|
||||
screen.render()
|
||||
})
|
||||
|
||||
process.on("beforeExit", () => {
|
||||
|
||||
})
|
||||
Reference in New Issue
Block a user