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
- Host: GitHub
- URL: https://github.com/tsoding/grecha.js
- Owner: tsoding
- License: mit
- Created: 2021-05-16T11:09:07.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-05T12:03:37.000Z (almost 2 years ago)
- Last Synced: 2025-04-29T12:24:09.916Z (8 months ago)
- Language: JavaScript
- Size: 141 KB
- Stars: 206
- Watchers: 6
- Forks: 17
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Grecha.js

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);
```