Skip to content

cherniaky/grecha.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grecha.js

KashaHard

Simple Front-End JavaScript Framework.

Quick Start

<!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");

      entry.appendChild(
        router({
          "/": div(
            h1("Grecha.js"),
            div(a("Foo").att$("href", "#/foo")),
            div(a("Bar").att$("href", "#/bar")),
            div(kasha).onclick$(function () {
                if (this.contains(kasha)) {
                    kasha.replaceWith(kashaHard);
                } else {
                    kashaHard.replaceWith(kasha);
                }
            }),
          ),
          "/foo": div(
            h1("Foo"),
            p(LOREM),
            div(a("Home").att$("href", "#")),
          ),
          "/bar": div(
            h1("Bar"),
            p(LOREM),
            div(a("Home").att$("href", "#"))
          )
        })
      );
    </script>
  </body>
</html>

About

Simple Front-End JavaScript Framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 69.3%
  • HTML 30.7%