Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2025
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.50 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Currently Playing</title>
  8. <style>
  9. body {
  10. margin: 0;
  11. padding: 0;
  12. background-color: transparent;
  13. font-family: Arial, sans-serif;
  14. }
  15. .overlay {
  16. display: flex;
  17. align-items: center;
  18. position: fixed;
  19. bottom: 15px;
  20. left: 15px;
  21. padding: 15px;
  22. background: linear-gradient(90deg, rgba(0, 0, 0, 0.9), rgba(30, 30, 30, 0.9)); /* Gradient background */
  23. color: white;
  24. border-radius: 10px;
  25. opacity: 0; /* Start hidden for fade-in effect */
  26. transition: opacity 1s ease-in; /* Fade-in transition */
  27. }
  28. .album-art {
  29. height: 100%; /* Make album artwork match the height of the container */
  30. max-height: 150px;
  31. margin-right: 20px;
  32. border-radius: 5px 0 0 5px; /* Rounded corners on the left side only */
  33. }
  34. .song-info {
  35. display: flex;
  36. flex-direction: column;
  37. }
  38. .song-title {
  39. font-size: 33px; /* Increased size */
  40. font-weight: bold;
  41. margin-bottom: 10px;
  42. }
  43. .artist-name {
  44. font-size: 25px; /* Increased size */
  45. color: #ddd;
  46. }
  47. </style>
  48. </head>
  49. <body>
  50. <div class="overlay" id="overlay">
  51. <img src="" alt="Album Art" class="album-art" id="albumArt">
  52. <div class="song-info">
  53. <div class="song-title" id="songTitle">Loading...</div>
  54. <div class="artist-name" id="artistName">Loading...</div>
  55. </div>
  56. </div>
  57.  
  58. <script>
  59. // Fetch and display currently playing song information
  60. async function fetchCurrentlyPlayingInfo() {
  61. try {
  62. const [artResponse, songResponse, artistResponse] = await Promise.all([
  63. fetch('http://10.0.10.114:8000/api/custom-variable/currently_playing_art/value'),
  64. fetch('http://10.0.10.114:8000/api/custom-variable/currently_playing_song/value'),
  65. fetch('http://10.0.10.114:8000/api/custom-variable/currently_playing_artist/value')
  66. ]);
  67.  
  68. if (!artResponse.ok || !songResponse.ok || !artistResponse.ok) {
  69. console.error('Error fetching currently playing information');
  70. return;
  71. }
  72.  
  73. const albumArtUrl = await artResponse.text();
  74. const songTitle = await songResponse.text();
  75. const artistName = await artistResponse.text();
  76.  
  77. document.getElementById('albumArt').src = albumArtUrl;
  78. document.getElementById('songTitle').textContent = songTitle;
  79. document.getElementById('artistName').textContent = artistName;
  80.  
  81. // Fade in the overlay after the data is loaded
  82. document.getElementById('overlay').style.opacity = 1;
  83. } catch (error) {
  84. console.error('Error fetching data:', error);
  85. }
  86. }
  87.  
  88. // Fetch the information every 5 seconds to keep it up to date
  89. fetchCurrentlyPlayingInfo();
  90. setInterval(fetchCurrentlyPlayingInfo, 5000);
  91. </script>
  92. </body>
  93. </html>
  94.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement