An open API service indexing awesome lists of open source software.

https://github.com/tsoding/grecha.js

Simple Front-End JavaScript Framework
https://github.com/tsoding/grecha.js

Last synced: 5 months ago
JSON representation

Simple Front-End JavaScript Framework

Awesome Lists containing this project

README

          

# Grecha.js

![KashaHard](KashaHard.gif)

Simple Front-End JavaScript Framework. Originally designed for [emoteJAM](https://github.com/tsoding/emoteJAM). The name basically means [buckwheat](https://en.wikipedia.org/wiki/Buckwheat) in russian.

## Quick Start

https://tsoding.github.io/grecha.js/example.html

```html

Grecha.js




const kasha = img("Kasha.png");
const kashaHard = img("KashaHard.gif");

let count = 0;
let hard = false;
const r = router({
"/": () => div(
h1("Grecha.js"),
div(a("Foo").att$("href", "#/foo")),
div(a("Bar").att$("href", "#/bar")),
div("Counter: "+count),
div(hard ? kashaHard : kasha).onclick$(function () {
count += 1;
hard = !hard
r.refresh();
}),
),
"/foo": () => div(
h1("Foo"),
p(LOREM),
div(a("Home").att$("href", "#")),
),
"/bar": () => div(
h1("Bar"),
p(LOREM),
div(a("Home").att$("href", "#"))
)
});
entry.appendChild(r);

```