Skip to content

Commit

Permalink
refine palette styles
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Mar 28, 2020
1 parent 4f28e7a commit 5e5f48e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 17 deletions.
14 changes: 14 additions & 0 deletions entry/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,17 @@ body * {
.is-unremarkable:hover {
opacity: 1;
}

::-webkit-scrollbar {
width: 1px;
height: 1px;
}

::-webkit-scrollbar-track {
background-color: hsla(0,0%,100%,0);
}

::-webkit-scrollbar-thumb {
background-color: hsla(0,0%,100%,0.3);
}

18 changes: 10 additions & 8 deletions src/app/comp/command.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@
(ns app.comp.command
(:require [clojure.string :as string]
[respo.core :refer [defcomp div <> span input]]
[hsl.core :refer [hsl]]))

(defn on-click [on-select] (fn [e dispatch!] (on-select dispatch!)))
[hsl.core :refer [hsl]]
[respo.comp.space :refer [=<]]
[respo-ui.core :as ui]))

(def style-command
{:backgroud-color (hsl 0 0 0),
:padding "0 8px",
:line-height 2.4,
:font-family "Source Code Pro, Menlo,monospace",
:line-height "30px",
:font-family ui/font-normal,
:cursor "pointer"})

(defcomp
comp-command
(command selected? on-select)
(div
{:style (merge style-command (if selected? {:background-color (hsl 0 0 30)})),
:on-click (on-click on-select)}
(<> span (string/join " " command) nil)))
{:style (merge style-command (if selected? {:background-color (hsl 0 0 20 0.8)})),
:on-click (fn [e dispatch!] (on-select dispatch!))}
(case (first command)
:defs (div {} (<> (get command 2)) (=< 16 nil) (<> (get command 1) {:color (hsl 0 0 40)}))
(<> (string/join " " command) nil))))
5 changes: 4 additions & 1 deletion src/app/util/detect.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@

(defn fuzzy-search [pieces queries]
(every?
(fn [query] (some (fn [piece] (string/includes? (str piece) query)) pieces))
(fn [query]
(some
(fn [piece] (string/includes? (str piece) query))
(if (= :defs (first pieces)) (subvec pieces 1) pieces)))
queries))

(defn strip-atom [token]
Expand Down
18 changes: 10 additions & 8 deletions stack.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,21 @@
:procs $ []
|comp.command $ {}
:ns $ [] |ns |app.comp.command
[] |:require ([] |[] |clojure.string |:as |string) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |<> |span |input) ([] |[] |hsl.core |:refer $ [] |[] |hsl)
[] |:require ([] |[] |clojure.string |:as |string) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |<> |span |input) ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.comp.space |:refer $ [] |[] |=<) ([] |[] |respo-ui.core |:as |ui)
:defs $ {}
|style-command $ [] |def |style-command
[] |{} ([] |:backgroud-color $ [] |hsl |0 |0 |0) ([] |:padding "||0 8px") ([] |:line-height |2.4) ([] |:font-family "||Source Code Pro, Menlo,monospace") ([] |:cursor ||pointer)
|on-click $ [] |defn |on-click ([] |on-select)
[] |fn ([] |e |dispatch!) ([] |on-select |dispatch!)
[] |{} ([] |:backgroud-color $ [] |hsl |0 |0 |0) ([] |:padding "||0 8px") ([] |:line-height "|\"30px") ([] |:font-family |ui/font-normal) ([] |:cursor ||pointer)
|comp-command $ [] |defcomp |comp-command ([] |command |selected? |on-select)
[] |div
[] |{}
[] |:style $ [] |merge |style-command
[] |if |selected? $ [] |{} ([] |:background-color $ [] |hsl |0 |0 |30)
[] |:on-click $ [] |on-click |on-select
[] |<> |span ([] |string/join "|| " |command) (, |nil)
[] |if |selected? $ [] |{} ([] |:background-color $ [] |hsl |0 |0 |20 |0.8)
[] |:on-click $ [] |fn ([] |e |dispatch!) ([] |on-select |dispatch!)
[] |case ([] |first |command)
[] |:defs $ [] |div ([] |{}) ([] |<> $ [] |get |command |2) ([] |=< |16 |nil)
[] |<> ([] |get |command |1)
[] |{} $ [] |:color ([] |hsl |0 |0 |40)
[] |<> ([] |string/join "|| " |command) (, |nil)
:procs $ []
|updater $ {}
:ns $ [] |ns |app.updater
Expand Down Expand Up @@ -1111,7 +1113,7 @@
[] |some
[] |fn ([] |piece)
[] |string/includes? ([] |str |piece) (, |query)
, |pieces
[] |if ([] |= |:defs $ [] |first |pieces) ([] |subvec |pieces |1) (, |pieces)
, |queries
|contains-def? $ [] |defn |contains-def? ([] |files |ns-part |name-part) ([] |println "||Contains def:" |ns-part |name-part)
[] |if ([] |contains? |files |ns-part)
Expand Down

0 comments on commit 5e5f48e

Please sign in to comment.