Created
April 12, 2023 17:02
-
-
Save chwan1/82d6f643d9216e68101dc6b41388d5ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Tools | |
// Description:_ | |
import "@johnlindquist/kit"; | |
import { readFile } from "fs/promises"; | |
await arg("Select a tool", [ | |
// { | |
// name: "Sorry, no matches", | |
// info: "onNoChoices", // or "always" | |
// }, | |
{ | |
name: "QR Code", | |
description: "Generator website by Adobe", | |
onSubmit: async () => { | |
open("https://express.adobe.com/zh-Hant-TW/tools/qr-code-generator"); | |
}, | |
}, | |
{ | |
name: "Oblique Strategies", | |
description: "by Brian Eno and Peter Schmidt", | |
onSubmit: async () => { | |
const data = await readFile("./ObliqueStrategies.json", { | |
encoding: "utf-8", | |
}); | |
const obliqueStrategiesList = JSON.parse(data); | |
const strategy = | |
obliqueStrategiesList[ | |
Math.floor(Math.random() * obliqueStrategiesList.length) | |
]; | |
await div( | |
strategy, | |
" bg-blue-600 p-8 flex flex-col items-center justify-center rounded-lg font-bold text-4xl text-gray-50", | |
); | |
}, | |
}, | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment