-
-
Save zacharycarter/f4aa62b06c156408e3bdecf13e4a7bea to your computer and use it in GitHub Desktop.
playground
This file contains 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
include karax / prelude | |
import karax/[kdom, vdom], playgroundpkg/components/[header, editor, welcome], jsconsole, jsffi | |
const editorId = "editor" | |
proc postRender() = | |
discard registerLanguages() | |
discard createEditor(kdom.getElementById(editorId)) | |
proc createDom(): VNode = | |
result = buildHtml(tdiv(class = "")): | |
createHeader() | |
createWelcomeScreen() | |
tdiv(id = editorId, class = "h-screen") | |
setRenderer createDom, "playground", postRender |
This file contains 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
include karax / prelude | |
import karax/[kdom, vdom] | |
var welcomeScreenOpen = true | |
proc closeWelcomeScreen() = | |
welcomeScreenOpen = false | |
proc createWelcomeScreen*(): VNode = | |
if welcomeScreenOpen: | |
result = buildHtml(tdiv(id = "welcome", class = "animated fadeIn fixed z-50 pin overflow-auto bg-smoke-dark flex")): | |
tdiv(class = "animated fadeInUp fixed shadow-inner max-w-md md:relative pin-b pin-x align-top m-auto justify-end md:justify-center p-8 bg-nim-navy md:rounded w-full md:h-auto md:shadow flex flex-col"): | |
h2(class = "text-4xl text-center font-hairline md:leading-loose text-white md:mt-8 mb-4"): | |
text("Welcome!") | |
p(class = "text-xl leading-normal mb-8 text-center text-nim-purp"): | |
text("What kind of project would you like to create?") | |
tdiv(class = "inline-flex justify-center"): | |
tdiv(class = "hvr-icon-hang"): | |
button(id = "enim", class = "hvr-icon bg-nim-gray border-b-2 border-black ml-2 hover:bg-nim-yellow text-nim-navy font-bold py-4 px-6 rounded inline-flex items-center"): | |
span(): | |
text("Empty Nim Project") | |
tdiv(class = "hvr-icon-hang"): | |
button(id = "hwnim", class = "hvr-icon bg-nim-gray border-b-2 border-black ml-2 hover:bg-nim-yellow text-nim-navy font-bold py-4 px-6 rounded inline-flex items-center"): | |
span(): | |
text("Hello World Nim Project") | |
button(class = "close hvr-icon-grow absolute pin-t pin-r pt-4 px-4 text-nim-gray hover:text-nim-yellow", onclick = closeWelcomeScreen): | |
span(class = "fas fa-window-close fa-2x hvr-icon") | |
else: | |
result = buildHtml(tdiv()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment