almost done it
This commit is contained in:
parent
330f9050b7
commit
4026589963
3 changed files with 21 additions and 25 deletions
|
@ -83,7 +83,7 @@
|
|||
[animated-title (gets [:title])]
|
||||
[:div.project {:style {:font-family "Monaco,monospace" :opacity 0.5}}
|
||||
(gets [:vgapi :project-id])]
|
||||
(rx [vgapi/view (gets [:vgapi]) now (rx @inf-ease)])
|
||||
(rx [vgapi/view (gets [:vgapi]) now inf-ease])
|
||||
]]
|
||||
[page 1 "subtitle" green "#title" "« Back to Title"
|
||||
[animated-title (gets [:subtitle])]]]
|
||||
|
|
|
@ -150,12 +150,12 @@
|
|||
(when message
|
||||
[:div {:style {:height (str height "vh")
|
||||
:line-height "1.6em"
|
||||
:width "100%"
|
||||
:background "rgba(255,255,255,0.8)"
|
||||
:color "rgba(0,0,0,0.5)"
|
||||
:width "99%"
|
||||
:background "rgba(0,0,0,0.9)"
|
||||
:margin "1px"
|
||||
:color "rgba(255,255,255,0.8)"
|
||||
:font-size "0.5em"
|
||||
:overflow "hidden"
|
||||
:border "solid 1px rgba(0,0,0,0.3)"
|
||||
}}
|
||||
[user-pic {:message message}]
|
||||
[user-name message params]
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
(smart-si
|
||||
(fn []
|
||||
(go (let [now (.getTime (new js/Date))
|
||||
from (.toISOString (new js/Date (- now (+ interval (* 40 1000)))))
|
||||
from (.toISOString (new js/Date (- now (+ (* 3 interval) (* 40 1000)))))
|
||||
to (.toISOString (new js/Date (- now (* 40 1000))))
|
||||
response (<! (http/get (str "http://dev.api.vigiglo.be/api" route)
|
||||
{:query-params (into {:project_id (gets [prefix :project-id])
|
||||
|
@ -90,7 +90,7 @@
|
|||
;; ------------------------------------------------------------------------------
|
||||
(defn view-tweets [state now e]
|
||||
(when (:messages state)
|
||||
(let [from (- now (* 50 1000))
|
||||
(let [from (- now (* 65 1000))
|
||||
tweets (:messages state)
|
||||
tweets-by-sec (clojure.set/index (set tweets) [:pub_date_epoch_ms])
|
||||
nb-seconds (count (keys tweets-by-sec))
|
||||
|
@ -103,26 +103,22 @@
|
|||
:position "relative"
|
||||
:overflow "hidden"
|
||||
:height "50vh"
|
||||
:border "solid 1px red"
|
||||
:font-family "Futura, sans-serif"}}
|
||||
e [:br]
|
||||
(inc (rx e)) [:br]
|
||||
:font-family "Verdana, sans-serif"}}
|
||||
(for [tweet-sec (keys tweets-by-sec)]
|
||||
(let [decalage (/ (- (:pub_date_epoch_ms tweet-sec) e from) 1000)]
|
||||
(rx [:div (rx decalage)])
|
||||
#_[:div {:style {:position "absolute"
|
||||
:bottom "0"
|
||||
:left (rx (str (- (* decalage tw-width)) "vh"))
|
||||
:width (str tw-width "vh")
|
||||
}
|
||||
}
|
||||
(str "e:" (rx @e) ", decalage:" decalage)
|
||||
(for [tweet (get tweets-by-sec tweet-sec)]
|
||||
[message tweet vh-height ])
|
||||
[:div {:style {:position "absolute"
|
||||
:bottom "0"
|
||||
:right (rx
|
||||
(str (- (* (- (/ (- (:pub_date_epoch_ms tweet-sec) from)
|
||||
1000) @e ) tw-width)) "vh"))
|
||||
:width (str tw-width "vh")
|
||||
}
|
||||
}
|
||||
(for [tweet (get tweets-by-sec tweet-sec)]
|
||||
[message tweet vh-height ])
|
||||
|
||||
[:div {:style {:font-size ".5em"}} (clojure.string/replace (.toISOString (js/Date. (:pub_date_epoch_ms tweet-sec)))
|
||||
#".*T" "")]
|
||||
]))])))
|
||||
[:div {:style {:font-size ".5em"}} (clojure.string/replace (.toISOString (js/Date. (:pub_date_epoch_ms tweet-sec)))
|
||||
#".*T" "")]
|
||||
])])))
|
||||
|
||||
(defn view-volume [state]
|
||||
[:div
|
||||
|
|
Loading…
Reference in a new issue