From 5e42ddc1c9a52d442b5660036433f636218fe847 Mon Sep 17 00:00:00 2001 From: Rovanion Luckey Date: Mon, 19 Dec 2016 22:41:36 +0100 Subject: [PATCH 1/3] Cleared up table error given by react. --- src/weather_magic/ui.cljs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/weather_magic/ui.cljs b/src/weather_magic/ui.cljs index 436bc49..6557806 100644 --- a/src/weather_magic/ui.cljs +++ b/src/weather_magic/ui.cljs @@ -96,19 +96,21 @@ (defn time-sliders [] [:div {:id "time-slider-containers"} [:table {:class "time-sliders-left"} - [:tr - [:td [play-pause-button "LeftYear" toggle-play-stop state/date-atom :left :year :month]] - [:td [slider-component :left :year]]] - [:tr - [:td [play-pause-button "LeftMonth" toggle-play-stop state/date-atom :left :month :year]] - [:td [slider-component :left :month]]]] + [:tbody + [:tr + [:td [play-pause-button "LeftYear" toggle-play-stop state/date-atom :left :year :month]] + [:td [slider-component :left :year]]] + [:tr + [:td [play-pause-button "LeftMonth" toggle-play-stop state/date-atom :left :month :year]] + [:td [slider-component :left :month]]]]] [:table {:class "time-sliders-right"} - [:tr - [:td [play-pause-button "RightYear" toggle-play-stop state/date-atom :right :year :month]] - [:td [slider-component :right :year]]] - [:tr - [:td [play-pause-button "RightMonth" toggle-play-stop state/date-atom :right :month :year]] - [:td [slider-component :right :month]]]]]) + [:tbody + [:tr + [:td [play-pause-button "RightYear" toggle-play-stop state/date-atom :right :year :month]] + [:td [slider-component :right :year]]] + [:tr + [:td [play-pause-button "RightMonth" toggle-play-stop state/date-atom :right :month :year]] + [:td [slider-component :right :month]]]]]]) (defn map-ui-blur [] "What hides the map UI." From 419249b51672c1b449dd21c8fe0a4bcb4166117e Mon Sep 17 00:00:00 2001 From: Rovanion Luckey Date: Mon, 19 Dec 2016 22:58:02 +0100 Subject: [PATCH 2/3] Made it so that the timelines don't go out all the way to the edge again. --- resources/public/css/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/public/css/style.css b/resources/public/css/style.css index 475a0e1..a1b6317 100644 --- a/resources/public/css/style.css +++ b/resources/public/css/style.css @@ -109,8 +109,8 @@ input[type=range] { .time-slider { cursor: default; - float: right; - width: 100%; + float: left; + width: 97%; } From ec7a89f968c88068e69a32864fb8970419c7bc88 Mon Sep 17 00:00:00 2001 From: Rovanion Luckey Date: Wed, 21 Dec 2016 16:59:10 +0100 Subject: [PATCH 3/3] Cleaned up some of the ui code. --- src/weather_magic/ui.cljs | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/weather_magic/ui.cljs b/src/weather_magic/ui.cljs index 6557806..1767f65 100644 --- a/src/weather_magic/ui.cljs +++ b/src/weather_magic/ui.cljs @@ -24,15 +24,12 @@ (hidden-or-not {:hidden :visible :visible :hidden})) (defn toggle-about-page - [atom1 atom2] - (swap! atom1 hide-unhide) - (swap! atom2 hide-unhide)) + [] + (swap! state/about-page-visible hide-unhide) + (swap! state/blur-visible hide-unhide)) (defn close-side-menu - [side-menu] - (swap! side-menu hide-unhide) - (swap! state/blur-visible (fn [] :hidden)) - (swap! state/about-page-visible (fn [] :hidden))) + [side-menu]) (defn update-climate-model-info [key input] @@ -123,7 +120,7 @@ [:div {:id "data-selection-container" :class (hide-unhide @state/blur-visible)} [button "Data-selection" "selection-button" swap! state/data-menu-visible hide-unhide]] [:div {:id "data-menu-container" :class (str (name (hide-unhide @state/data-menu-visible)) " sidebar")} - [close-button "x" "side-menu-button" close-side-menu state/data-menu-visible] + [close-button "x" "side-menu-button" #(swap! state/data-menu-visible hide-unhide)] [:h4 "Climate model"] [:select {:class "side-menu-button" :name "Climate Model" :on-change (fn [event] (swap! state/climate-model-info assoc-in [:climate-model] (.-target.value event)))} [:option {:value "ICHEC-EC-EARTH"} "ICHEC-EC-EARTH"] @@ -142,8 +139,8 @@ [:option {:value "rcp85"} "RCP 8.5"]] [:input {:type "button" :value "?" :class "help"}] [:div {:class "hidden-helper"} - [:p "These are different exhaust-levels of green house gases (GHGs) for which climate institutes predicts the future around. Both RCP4.5 and RCP8.5 are seen as likely cases, with RCP8.5 beeing a higher level of GHGs than RCP4.5. Try experimenting with these options and see how they affect the predicted climate of the earth. "] - [:p "You can read more about these prediction models on " [:a {:href "https://en.wikipedia.org/wiki/Representative_Concentration_Pathways"} "Wikipedia"]]] + [:p "These are different exhaust-level models of green house gases (GHGs) for which climate institutes predicts the future around. Both RCP4.5 and RCP8.5 are seen as likely cases, with RCP8.5 beeing a higher level of GHGs than RCP4.5."] + [:p "Both RCP4.5 and RCP8.5 are considered to be likely."]] [:h4 "Data type"] [button "No data" "side-menu-button" update-shader-and-data-layer :standard "temperature"] [button "Temperature" "side-menu-button" update-shader-and-data-layer :temperature "temperature"] @@ -155,7 +152,7 @@ [:div [button "Navigation" "selection-button" swap! state/navigation-menu-visible hide-unhide] [:div {:id "navigation-menu-container" :class (str (name (hide-unhide @state/navigation-menu-visible)) " sidebar")} - [close-button "x" "side-menu-button" close-side-menu state/navigation-menu-visible] + [close-button "x" "side-menu-button" #(swap! state/navigation-menu-visible hide-unhide)] [:h4 "Location"] [button "Africa" "side-menu-button" world/get-to-view-angles -0.9418886 0.0472268 0.3325892 true] [button "Antarctica" "side-menu-button" world/get-to-view-angles 0.0 -1.0 0.0 false] @@ -167,7 +164,7 @@ [button "South America" "side-menu-button" world/get-to-view-angles -0.4850580 -0.3197941 -0.8139106 true] [:h4 "Other"] [button "Spin-earth" "side-menu-button" reset! state/earth-animation-fn world/spin-earth!] - [button "About" "side-menu-button" toggle-about-page state/about-page-visible state/blur-visible]]]) + [button "About" "side-menu-button" toggle-about-page]]]) (defn compass [] [:input {:type "button" :id "Compass" :class (hide-unhide @state/blur-visible) @@ -191,7 +188,7 @@ (defn about-page [] [:div {:id "about-page" :class (str (name @state/about-page-visible) " full-page")} - [close-button "x" "side-menu-button" toggle-about-page state/about-page-visible state/blur-visible] + [close-button "x" "side-menu-button" toggle-about-page] [:h1 "WeatherMagic"] [:p "A project built by the dedicated team consisting of:"] [:ul @@ -220,12 +217,14 @@ [:li "uwsgi"] [:li "Pillow"] [:li "Climate data from NetCDF-files delivered by " [:a {:href "http://esgf.llnl.gov"} "ESGF"]]] - [:h2 "Special thanks to"] + [:h3 "Special thanks to"] [:ul [:li "Ingemar Ragnemalm (LiU) - All makt åt Ingemar, vår befriare."] [:li "Ola Leifler (LiU)"] [:li "Gustav Strandberg (SMHI)"]] - [button "Close" "side-menu-button" toggle-about-page state/about-page-visible state/blur-visible]]) + [:br] + [button "Close" "side-menu-button" toggle-about-page] + [:br]]) (defn scale-gradient [] [:div {:class "gradient" :id (str @state/data-layer-atom "-gradient")}])