(defpoll clock-time :interval "1s" "date +\"%H:%M:%S\"")
(defpoll clock-date :interval "1m" "date +\"%d/%m\"")
(defpoll clock-year :interval "1h" "date +\"%Y\"")
(defvar date-reveal false)

(defwidget clock-module []
  (eventbox :onhover "${EWW_CMD} update date-reveal=true"
            :onhoverlost "${EWW_CMD} update date-reveal=false"
            (box :class "module clock"
                 :orientation "h"
                 :space-evenly "false"
                 (label :text clock-time
                        :class "clock-time")
                 (revealer :transition "slideleft"
                           :duration "750ms"
                           :reveal {date-reveal}
                           (box :orientation "h"
                                (label :text clock-date
                                       :class "clock-date")
                                (label :text clock-year
                                       :class "clock-year"))))))
