Skip to content

Simple Front-End JavaScript Framework

License

Notifications You must be signed in to change notification settings

skorotkiewicz/grecha.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grecha.js

KashaHard

Simple Front-End JavaScript Framework. Originally designed for emoteJAM. The name basically means buckwheat in russian.

Quick Start

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

<!DOCTYPE html>
<html>
  <head><title>Grecha.js</title></head>
  <body>
    <div id="entry"></div>
    <script src="./grecha.js"></script>
    <script>
      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(a("Something").att$("href", "#/something-notfound")),
          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", "#"))
        ),
        "/404": () => div(
          h1("404 Not Found"),
          p("The page you are looking for does not exist."),
          div(a("Home").att$("href", "#"))
        ),
      });
      entry.appendChild(r);
    </script>
  </body>
</html>

About

Simple Front-End JavaScript Framework

Resources

License

Stars

Watchers

Forks

Languages

  • JavaScript 63.0%
  • HTML 37.0%