diff --git a/asteroid.lisp b/asteroid.lisp index eb07dcf..7f61005 100644 --- a/asteroid.lisp +++ b/asteroid.lisp @@ -516,7 +516,7 @@ ("message" . "Listening history cleared successfully")))) |# -;; Front page +;; Front page - regular view by default (define-page front-page #@"/" () "Main front page" (let ((template-path (merge-pathnames "template/front-page.chtml" @@ -537,6 +537,44 @@ :now-playing-album "Startup Sounds" :now-playing-duration "โˆž"))) +;; Frameset wrapper for persistent player mode +(define-page frameset-wrapper #@"/frameset" () + "Frameset wrapper with persistent audio player" + (let ((template-path (merge-pathnames "template/frameset-wrapper.chtml" + (asdf:system-source-directory :asteroid)))) + (clip:process-to-string + (plump:parse (alexandria:read-file-into-string template-path)) + :title "๐ŸŽต ASTEROID RADIO ๐ŸŽต"))) + +;; Content frame - front page content without player +(define-page front-page-content #@"/content" () + "Front page content (displayed in content frame)" + (let ((template-path (merge-pathnames "template/front-page-content.chtml" + (asdf:system-source-directory :asteroid)))) + (clip:process-to-string + (plump:parse (alexandria:read-file-into-string template-path)) + :title "๐ŸŽต ASTEROID RADIO ๐ŸŽต" + :station-name "๐ŸŽต ASTEROID RADIO ๐ŸŽต" + :status-message "๐ŸŸข LIVE - Broadcasting asteroid music for hackers" + :listeners "0" + :stream-quality "128kbps MP3" + :stream-base-url *stream-base-url* + :now-playing-artist "The Void" + :now-playing-track "Silence" + :now-playing-album "Startup Sounds" + :now-playing-duration "โˆž"))) + +;; Persistent audio player frame (bottom frame) +(define-page audio-player-frame #@"/audio-player-frame" () + "Persistent audio player frame (bottom of page)" + (let ((template-path (merge-pathnames "template/audio-player-frame.chtml" + (asdf:system-source-directory :asteroid)))) + (clip:process-to-string + (plump:parse (alexandria:read-file-into-string template-path)) + :stream-base-url *stream-base-url* + :default-stream-url (concatenate 'string *stream-base-url* "/asteroid.aac") + :default-stream-encoding "audio/aac"))) + ;; Configure static file serving for other files (define-page static #@"/static/(.*)" (:uri-groups (path)) (serve-file (merge-pathnames (concatenate 'string "static/" path) @@ -837,6 +875,18 @@ :now-playing-album "Startup Sounds" :player-status "Stopped"))) +;; Player content frame (for frameset mode) +(define-page player-content #@"/player-content" () + "Player page content (displayed in content frame)" + (let ((template-path (merge-pathnames "template/player-content.chtml" + (asdf:system-source-directory :asteroid)))) + (clip:process-to-string + (plump:parse (alexandria:read-file-into-string template-path)) + :title "Asteroid Radio - Web Player" + :stream-base-url *stream-base-url* + :default-stream-url (concatenate 'string *stream-base-url* "/asteroid.aac") + :default-stream-encoding "audio/aac"))) + (define-page popout-player #@"/popout-player" () "Pop-out player window" (let ((template-path (merge-pathnames "template/popout-player.chtml" diff --git a/static/js/front-page.js b/static/js/front-page.js index c841b5a..f21fb68 100644 --- a/static/js/front-page.js +++ b/static/js/front-page.js @@ -169,3 +169,30 @@ setInterval(function() { popoutWindow = null; } }, 1000); + +// Frameset mode functionality +function enableFramesetMode() { + // Save preference + localStorage.setItem('useFrameset', 'true'); + // Redirect to frameset wrapper + window.location.href = '/asteroid/frameset'; +} + +function disableFramesetMode() { + // Clear preference + localStorage.removeItem('useFrameset'); + // Redirect to regular view + window.location.href = '/asteroid/'; +} + +// Check if user prefers frameset mode on page load +window.addEventListener('DOMContentLoaded', function() { + const path = window.location.pathname; + const isFramesetPage = path.includes('/frameset') || path.includes('/content') || + path.includes('/audio-player-frame') || path.includes('/player-content'); + + if (localStorage.getItem('useFrameset') === 'true' && !isFramesetPage && path === '/asteroid/') { + // User wants frameset but is on regular front page, redirect + window.location.href = '/asteroid/frameset'; + } +}); diff --git a/template/admin.chtml b/template/admin.chtml index ecfa9a5..5310f18 100644 --- a/template/admin.chtml +++ b/template/admin.chtml @@ -12,9 +12,9 @@

๐ŸŽ›๏ธ ADMIN DASHBOARD

diff --git a/template/audio-player-frame.chtml b/template/audio-player-frame.chtml new file mode 100644 index 0000000..a7d8669 --- /dev/null +++ b/template/audio-player-frame.chtml @@ -0,0 +1,174 @@ + + + + + + + + + +
+ ๐ŸŸข LIVE: + +
+ + + +
+ + + + Loading... + + +
+ + + + diff --git a/template/frameset-wrapper.chtml b/template/frameset-wrapper.chtml new file mode 100644 index 0000000..0cf1f2e --- /dev/null +++ b/template/frameset-wrapper.chtml @@ -0,0 +1,23 @@ + + + + ๐ŸŽต ASTEROID RADIO ๐ŸŽต + + + + + + + + + <body> + <p>Your browser does not support frames. Please use a modern browser or visit <a href="/asteroid/content">the main site</a>.</p> + </body> + + + diff --git a/template/front-page-content.chtml b/template/front-page-content.chtml new file mode 100644 index 0000000..f4e8c97 --- /dev/null +++ b/template/front-page-content.chtml @@ -0,0 +1,47 @@ + + + + ๐ŸŽต ASTEROID RADIO ๐ŸŽต + + + + + + + +
+
+

๐ŸŽต ASTEROID RADIO ๐ŸŽต

+ +
+ +
+
+

Station Status

+

๐ŸŸข LIVE - Broadcasting asteroid music for hackers

+

Current listeners: 0

+

Stream quality: AAC 96kbps Stereo

+
+ +
+

๐ŸŸข LIVE STREAM

+

The live stream player is now in the persistent bar at the bottom of the page.

+

Stream URL:

+

Format:

+

Status: โ— BROADCASTING

+
+ +
+
+
+ + diff --git a/template/front-page.chtml b/template/front-page.chtml index cbf1ee5..dff4977 100644 --- a/template/front-page.chtml +++ b/template/front-page.chtml @@ -35,9 +35,14 @@

๐ŸŸข LIVE STREAM

- +
+ + +
diff --git a/template/login.chtml b/template/login.chtml index 7c315c2..584ab07 100644 --- a/template/login.chtml +++ b/template/login.chtml @@ -11,9 +11,9 @@

๐ŸŽต ASTEROID RADIO - LOGIN

diff --git a/template/player-content.chtml b/template/player-content.chtml new file mode 100644 index 0000000..c347c46 --- /dev/null +++ b/template/player-content.chtml @@ -0,0 +1,120 @@ + + + + Asteroid Radio - Web Player + + + + + + + +
+

๐ŸŽต WEB PLAYER

+ + + +
+

๐ŸŸข Live Radio Stream

+

The live stream player is now in the persistent bar at the bottom of the page. It will continue playing as you navigate between pages!

+
+ +
+ + +
+

Personal Track Library

+
+ + +
+
Loading tracks...
+
+ + +
+
+ + +
+

Audio Player

+
+
+
๐ŸŽต
+
+
No track selected
+
Unknown Artist
+
Unknown Album
+
+
+ + + +
+ + + + + +
+ +
+
+ 0:00 / 0:00 +
+
+ + +
+
+
+
+ + +
+

Playlists

+
+ + +
+ +
+
+
No playlists created yet.
+
+
+
+ + +
+

Play Queue

+
+ + +
+
+
Queue is empty
+
+
+
+ + diff --git a/template/player.chtml b/template/player.chtml index 5911737..4ddcb91 100644 --- a/template/player.chtml +++ b/template/player.chtml @@ -12,9 +12,9 @@

๐ŸŽต WEB PLAYER