aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgabrielgio <gabriel.giovanini@pm.me>2022-03-25 16:24:46 +0100
committergabrielgio <gabriel.giovanini@pm.me>2022-03-25 16:24:46 +0100
commitdf46e401bd3dac1162cace8e9259ddaba02d5332 (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /src
parent2db3d88503fbe219e99c464c4cc8e768613e1359 (diff)
downloadgenpass-df46e401bd3dac1162cace8e9259ddaba02d5332.tar.gz
genpass-df46e401bd3dac1162cace8e9259ddaba02d5332.tar.bz2
genpass-df46e401bd3dac1162cace8e9259ddaba02d5332.zip
ref: Remove all clojure related Files
Making room for wasm project.
Diffstat (limited to 'src')
-rw-r--r--src/genpass/core.cljs43
-rw-r--r--src/genpass/gen.cljc17
2 files changed, 0 insertions, 60 deletions
diff --git a/src/genpass/core.cljs b/src/genpass/core.cljs
deleted file mode 100644
index f0ca298..0000000
--- a/src/genpass/core.cljs
+++ /dev/null
@@ -1,43 +0,0 @@
-(ns genpass.core
- (:require
- [reagent.core :as r]
- [genpass.gen :refer [genpwd]]))
-
-(def password (r/atom (genpwd)))
-
-(defn magic-selection-trick-took-from-so [e]
- (let [this (.-target e)]
- (if (and (.getSelection js/window) (.createRange js/document))
- (let [selection (.getSelection js/window)
- range (.createRange js/document)]
- (.selectNodeContents range this)
- (.removeAllRanges selection)
- (.addRange selection range))
- (if (and (.-selection js/document) (-> js/document .-body .createTextRange))
- (let [range (-> js/document .-body .createTextRange)]
- (.moveToElementText range this)
- (.select range))))))
-
-
-(defn home-page []
- [:div
- [:nav.navbar
- {:role "navigation"
- :aria-label "main navigation"}
- [:div.navbar-brand>a.navbar-item>h1
- [:a {:href "https://gitlab.com/gabrielgio/genpass"} "Genpass source code"]]]
- [:div.section.container
- [:div.field.has-text-centered
- [:span.title.is-3 {:on-click magic-selection-trick-took-from-so} @password]]
- [:div.field.is-grouped.is-grouped-centered
- [: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")))
-
-(defn init! []
- (mount-root))
diff --git a/src/genpass/gen.cljc b/src/genpass/gen.cljc
deleted file mode 100644
index 12dbc2f..0000000
--- a/src/genpass/gen.cljc
+++ /dev/null
@@ -1,17 +0,0 @@
-(ns genpass.gen)
-
-(def low-case [\a \b \c \d \e \f \g \h \i \j \k \l \m \n \o \p \q \r \s \t \u \v \W \x \Y \z])
-(def upper-case [\A \B \C \D \E \F \G \H \I \J \K \L \M \N \O \P \Q \R \S \T \U \V \W \X \Y \Z])
-(def number [\0 \1 \2 \3 \4 \5 \6 \7 \8 \9])
-(def special-char [\! \@ \# \% \^ \& \* \( \) \{ \} \[ \] \- \+ \= \~])
-(def all-char (concat low-case upper-case number special-char))
-
-(defn rand-char []
- (nth all-char (rand-int (dec (count all-char)))))
-
-(defn genpwd
- ([] (genpwd 12))
- ([length]
- (->> (range length)
- (map (fn [_] (rand-char)))
- (apply str)))) \ No newline at end of file