diff options
author | Gabriel Giovanini <gabrielg.desouza@gmail.com> | 2019-06-22 16:26:09 +0200 |
---|---|---|
committer | Gabriel Giovanini <gabrielg.desouza@gmail.com> | 2019-06-22 16:26:09 +0200 |
commit | 02efbed9b5d01a813cd07c6631a17c4744a191d6 (patch) | |
tree | f631611e51ff9add399c72fd167b3332639ea639 | |
parent | a0e1e0e62ea192569684fb0523495552438b9f97 (diff) | |
download | genpass-02efbed9b5d01a813cd07c6631a17c4744a191d6.tar.gz genpass-02efbed9b5d01a813cd07c6631a17c4744a191d6.tar.bz2 genpass-02efbed9b5d01a813cd07c6631a17c4744a191d6.zip |
Adds a simple layout
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | src/genpass/core.cljs | 20 |
2 files changed, 24 insertions, 8 deletions
@@ -1,3 +1,15 @@ +# Genpass + +Just a simple page for generating password. + +## Why reactjs or cljs + +For the the size of the project it would not need any type of js script library, vanilla javascript would suffice. +But I build this also to learn a little bit more more cljs and get to know a bit more how it works and how difficult it is to be deployed. +Also this page does not have any sort of ad/tracker, and the footprint for the lib plus cljs is quite small. +With help github pages it will run faster the most sites out there. + + ### Development mode To start the Figwheel compiler, navigate to the project folder and run the following command in the terminal: diff --git a/src/genpass/core.cljs b/src/genpass/core.cljs index e6b33ca..c65714f 100644 --- a/src/genpass/core.cljs +++ b/src/genpass/core.cljs @@ -1,15 +1,19 @@ (ns genpass.core - (:require - [reagent.core :as r])) + (:require + [reagent.core :as r] + [genpass.gen :refer [genpwd]])) -;; ------------------------- -;; Views +(def password (r/atom (genpwd))) (defn home-page [] - [:div [:h2 "Welcome to Reagent"]]) - -;; ------------------------- -;; Initialize app + [:div.columns>div.column + [:div.field>div.control>input.input.is-primary + {:type "text" + :value @password}] + [:div.field>div.control>input.button.is-primary + {:value "Generate" + :type "button" + :on-click #(reset! password (genpwd))}]]) (defn mount-root [] (r/render [home-page] (.getElementById js/document "app"))) |