aboutsummaryrefslogtreecommitdiffhomepage
path: root/explore.lisp
blob: f562448227f9f6b75eee7e8fd6d2505f9ae7b374 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
;;; explore.lisp

(in-package :vampire)

(defun create-media-search-area (parent)
  (with-clog-create parent
      (p (:content "media search area"))))

(defun create-playlist-explore-card (parent pl)
  (with-clog-create parent
      (div ()
           (img (:bind thumb))
           (section (:h4)
                    (a (:link (url-to-playlist pl) :content (playlist-title pl)))
                    (span (:content " -- "))
                    (span (:content (secs-to-hms (playlist-duration pl))))))
    (setf (maximum-width thumb) "120px")
    (when-let (track (first (playlist-tracks pl)))
      (setf (url-src thumb) (or (track-thumb-url track) "")))))

(defun create-recent-playlists-area (parent)
  (let* ((container (create-div parent)))
    (dolist (pl (recent-playlists 10))
      (create-playlist-explore-card container pl))))

(defun explore-page (body)
  (with-clog-create body
      (div ()
           (navigation-header ())
                                        ;(media-search-area ())
           (section (:h2 :content "Recent Playlists"))
           (recent-playlists-area ()))))