From 5e53eeb565d8fb43c67a9f7dcf94e8dcf37083ff Mon Sep 17 00:00:00 2001 From: turtlebasket Date: Sat, 4 Feb 2023 19:00:37 -0800 Subject: [PATCH] more WIP --- ncbi-api-test/index.js | 2 ++ reagent-test/public/css/site.css | 40 +++++++++++++++++++++-- reagent-test/src/reagent_test/core.cljs | 43 ++++++++++++++++++++----- reagent-test/src/reagent_test/ncbi.cljs | 22 ++++++++----- 4 files changed, 89 insertions(+), 18 deletions(-) diff --git a/ncbi-api-test/index.js b/ncbi-api-test/index.js index a1f4e93..fb479a6 100644 --- a/ncbi-api-test/index.js +++ b/ncbi-api-test/index.js @@ -20,6 +20,7 @@ function testSearchPubmed(query) { }); } + function testSearchGene(query) { fetch(`${url}/esearch.fcgi?db=gene&term=${query}`) .then((res) => { @@ -31,6 +32,7 @@ function testSearchGene(query) { }); } + function testLookupGeneById(ids) { fetch(`${url}/esummary.fcgi?db=gene&id=${String(ids)}`) .then(res => { diff --git a/reagent-test/public/css/site.css b/reagent-test/public/css/site.css index 6d5ef4b..63bb59f 100644 --- a/reagent-test/public/css/site.css +++ b/reagent-test/public/css/site.css @@ -1,5 +1,7 @@ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); + body { - font-family: 'Helvetica Neue', Verdana, Helvetica, Arial, sans-serif; + font-family: 'Inter', sans-serif; max-width: 600px; margin: 0 auto; padding-top: 72px; @@ -42,6 +44,40 @@ a:hover { position: absolute; } -.menu-item { +.menu-dropdown-item { width: 5rem; } + +.menu-button { + font-size: 12pt; + background-color: #efefef; + border-color: black; + border-width: 1px; +} + +.menu-button:hover { + background-color: #dedede; +} + +.searchbar { + font-size: 14pt; + padding: 2px 8px; +} + +.searchbar:focus { + outline: #000; + outline-width: 4px; +} + +.button-primary { + border-radius: 6px; + border: none; + padding: 6px 10px; + background-color: black; + color: white; + font-weight: 600; +} +.button-primary:hover { + background-color: #353535; + cursor: pointer; +} diff --git a/reagent-test/src/reagent_test/core.cljs b/reagent-test/src/reagent_test/core.cljs index b8d76ec..3ad1059 100644 --- a/reagent-test/src/reagent_test/core.cljs +++ b/reagent-test/src/reagent_test/core.cljs @@ -4,37 +4,64 @@ [reagent.dom :as d])) ;; ------------------------- -;; Component data (custom) +;; Global state + +;; use this later +(def state {:search-query "" + :searching false}) + +(def search-query "") + +;; ------------------------- +;; Component data (def action-btns [{:text "tools" :action #(js/console.log "hi")} - {:text "search" :action #((go (let [res (