New script s

I am vague to give it a name and are grinder the text below

  1. // ==UserScript==
  2. // @name New script s
  3. // @namespace Violentmonkey Scripts
  4. // @match *://sploop.io/*
  5. // @grant none
  6. // @version 1.0
  7. // @author -
  8. // @license mit
  9. // @description I am vague to give it a name and are grinder the text below
  10. // @description 27/1/2025, 17:31:27
  11. // ==/UserScript==
  12.  
  13. // Insert the music player container into the body of the page
  14. const container = document.createElement('div');
  15. container.id = 'musicContainer';
  16. container.style = `
  17. position: absolute;
  18. top: 20px;
  19. left: 20px;
  20. background: rgba(0, 0, 0, 0.8);
  21. border-radius: 10px;
  22. padding: 10px;
  23. z-index: 10000;
  24. color: white;
  25. font-family: Arial, sans-serif;
  26. font-size: 14px;
  27. max-width: 200px;
  28. `;
  29. document.body.appendChild(container);
  30.  
  31. // Create a title
  32. const title = document.createElement('h3');
  33. title.textContent = 'Music Player';
  34. title.style = 'margin: 0 0 10px 0; text-align: center;';
  35. container.appendChild(title);
  36.  
  37. // Create a select dropdown for songs
  38. const select = document.createElement('select');
  39. select.id = 'songSelect';
  40. select.style = 'width: 100%; margin-bottom: 10px;';
  41. container.appendChild(select);
  42.  
  43. // Add songs to the select dropdown (only with "Song {number}")
  44. const songs = [
  45. { id: 'r_1LUSn25J4', name: 'Song 1', lyrics: 'Hello, is it me you\'re looking for?' },
  46. { id: '1_t2pQqkmtg', name: 'Song 2', lyrics: 'I see you driving ’round town with the girl I love' },
  47. { id: 'anLOn1B-6Ns', name: 'Song 3', lyrics: 'First things first, I\'ll say all the words inside my head' },
  48. { id: 'qlzcHe_gusE', name: 'Song 4', lyrics: 'Shoes on, get up in the morn’ cup of milk, let’s rock and roll' },
  49. { id: 'Inf4tDEgyYw', name: 'Song 5', lyrics: 'I want it, I got it' },
  50. { id: 'J_Jt3VOVpoI', name: 'Song 6', lyrics: 'The club isn’t the best place to find a lover' },
  51. { id: 'OVh0bMNSFss', name: 'Song 7', lyrics: 'I got my peaches out in Georgia (Oh yeah, s**t)' },
  52. { id: 'riqwrGoklj8', name: 'Song 8', lyrics: 'Baby girl, I’ll be your man' },
  53. { id: 'w-sQRS-Lc9k', name: 'Song 9', lyrics: 'I’m not fazed, only here to sin' },
  54. { id: 'ELCVwv1T-aE', name: 'Song 10', lyrics: 'White shirt now red, my bloody nose' },
  55. { id: 'z9nHtotESH4', name: 'Song 11', lyrics: 'Seasons change and our love went cold' },
  56. { id: 'R_BFdeFtWC8', name: 'Song 12', lyrics: 'Astro, yeah, Sun is down, freezin’ cold' },
  57. { id: 'kvHvxKHYMBA', name: 'Song 13', lyrics: 'I got the eye of the tiger, a fighter' },
  58. { id: '9Zj0JOHJR-s', name: 'Song 14', lyrics: 'I found a love, to carry more than just my secrets' },
  59. { id: 'Qx2gvHjNhQ0', name: 'Song 15', lyrics: 'I love it when you call me señorita' },
  60. { id: 'n8X9_MgEdCg', name: 'Song 16', lyrics: 'So baby, pull me closer in the backseat of your Rover' },
  61. { id: '9bZkp7q19f0', name: 'Song 17', lyrics: 'Oppa Gangnam Style!' },
  62. { id: 'uZQNC3awICU', name: 'Song 18', lyrics: 'When I’m without you so insecure' },
  63. { id: 'ih2xubMaZWI', name: 'Song 19', lyrics: 'Lately I’ve been, I’ve been losing sleep' },
  64. { id: 'oC-GflRB0y4', name: 'Song 20', lyrics: 'And the players gonna play, play, play, play, play' },
  65. { id: 'bPs0xFd4skY', name: 'Song 21', lyrics: 'Found you when your heart was broke' },
  66. { id: 'wJnBTPUQS5A', name: 'Song 22', lyrics: 'Thank you, next' },
  67. { id: 'HIza2rY23Tk', name: 'Song 23', lyrics: 'I’m gonna live like tomorrow doesn’t exist' },
  68. { id: '8vJiSSAMNWw', name: 'Song 24', lyrics: 'I want your love and I want your revenge' }
  69. ];
  70.  
  71. songs.forEach((song) => {
  72. const option = document.createElement('option');
  73. option.value = song.id;
  74. option.textContent = song.name;
  75. select.appendChild(option);
  76. });
  77.  
  78. // Control buttons
  79. const playButton = document.createElement('button');
  80. playButton.textContent = '▶️ Play';
  81. playButton.style = 'width: 48%; margin-right: 2%;';
  82. container.appendChild(playButton);
  83.  
  84. const stopButton = document.createElement('button');
  85. stopButton.textContent = '⏹️ Stop';
  86. stopButton.style = 'width: 48%;';
  87. container.appendChild(stopButton);
  88.  
  89. // Player container (hidden)
  90. const playerContainer = document.createElement('div');
  91. playerContainer.id = 'musicPlayer';
  92. playerContainer.style = 'display: none;';
  93. container.appendChild(playerContainer);
  94.  
  95. // Create subtitle container (floating at the center of the screen)
  96. const subtitlesContainer = document.createElement('div');
  97. subtitlesContainer.id = 'subtitles';
  98. subtitlesContainer.style = `
  99. position: fixed;
  100. bottom: 50px;
  101. left: 50%;
  102. transform: translateX(-50%);
  103. color: white;
  104. font-size: 20px;
  105. font-family: Arial, sans-serif;
  106. text-align: center;
  107. z-index: 10001;
  108. display: none;
  109. `;
  110. document.body.appendChild(subtitlesContainer);
  111.  
  112. // Load YouTube API
  113. const script = document.createElement('script');
  114. script.src = 'https://www.youtube.com/iframe_api';
  115. document.head.appendChild(script);
  116.  
  117. // Global variable for the player
  118. let player;
  119.  
  120. // Initialize the player when the API is ready
  121. window.onYouTubeIframeAPIReady = function () {
  122. player = new YT.Player('musicPlayer', {
  123. height: '0',
  124. width: '0',
  125. videoId: '',
  126. events: {
  127. onReady: () => console.log('YouTube Player Ready'),
  128. onStateChange: (event) => {
  129. if (event.data === YT.PlayerState.ENDED) {
  130. playButton.textContent = '▶️ Play';
  131. subtitlesContainer.style.display = 'none'; // Hide subtitles when finished
  132. }
  133. }
  134. }
  135. });
  136. };
  137.  
  138. // Play button functionality
  139. playButton.addEventListener('click', () => {
  140. const selectedSongId = select.value;
  141. const song = songs.find(song => song.id === selectedSongId);
  142.  
  143. if (player && selectedSongId) {
  144. player.loadVideoById(selectedSongId);
  145. player.playVideo();
  146. playButton.textContent = '⏸️ Pause';
  147.  
  148. // Show subtitles during playback
  149. subtitlesContainer.style.display = 'block';
  150. displayLyrics(song.lyrics);
  151. }
  152. });
  153.  
  154. // Function to display lyrics word by word
  155. function displayLyrics(lyrics) {
  156. let words = lyrics.split(' ');
  157. let index = 0;
  158.  
  159. // Clear previous subtitles
  160. subtitlesContainer.textContent = '';
  161.  
  162. // Update subtitle every 1 second
  163. let interval = setInterval(() => {
  164. if (index < words.length) {
  165. subtitlesContainer.textContent += words[index] + ' ';
  166. index++;
  167. } else {
  168. clearInterval(interval);
  169. }
  170. }, 1000);
  171. }
  172.  
  173. // Stop button functionality
  174. stopButton.addEventListener('click', () => {
  175. if (player) {
  176. player.stopVideo();
  177. playButton.textContent = '▶️ Play';
  178. subtitlesContainer.style.display = 'none'; // Hide subtitles when stopped
  179. }
  180. });