Add your favrouite music to the list

Show Excel sheet in iframe with toggle icon, to store your favrouite music.

  1. // ==UserScript==
  2. // @name Add your favrouite music to the list
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.6
  5. // @description Show Excel sheet in iframe with toggle icon, to store your favrouite music.
  6. // @author Bibek
  7. // @match https://www.youtube.com/*
  8. // @icon https://cdn-icons-png.flaticon.com/512/2995/2995101.png
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15.  
  16. // Check if the script is running in an iframe, exit if true
  17. if (window !== window.parent) {
  18. return;
  19. }
  20.  
  21. // Excel Sheet URL
  22. const excelUrl = "https://1drv.ms/x/s!AiNuwFrvg4udjrknuEOXuR5ZOHzNZg?e=TaKgg2";
  23. const iconUrl = "https://cdn-icons-png.flaticon.com/512/2995/2995101.png";
  24.  
  25. // Create a button to toggle the iframe
  26. const button = document.createElement('button');
  27. button.style.position = 'fixed';
  28. button.style.bottom = '20px';
  29. button.style.right = '20px';
  30. button.style.zIndex = '9997';
  31. button.style.background = 'rgba(0, 0, 0, 0.3)';
  32. button.style.backdropFilter = 'blur(10px)';
  33. button.style.border = '1px solid rgba(107, 107, 111, 0.61)';
  34. button.style.cursor = 'pointer';
  35. button.style.padding = '5px'; // Initial size
  36. button.style.borderRadius = '50px';
  37. button.style.transition = 'all 0.3s ease'; // Smooth transition for all changes
  38. button.style.width = '50px'; // Initial width
  39. button.style.height = '50px'; // Initial height
  40.  
  41. // Create the icon
  42. const icon = document.createElement('img');
  43. icon.src = iconUrl;
  44. icon.alt = "Show Excel";
  45. icon.style.width = '20px';
  46. icon.style.height = '20px';
  47. icon.style.position = 'absolute';
  48. icon.style.bottom = '15px';
  49. icon.style.right = '15px';
  50. button.appendChild(icon);
  51.  
  52. document.body.appendChild(button);
  53.  
  54. // Add hover effect to enlarge the button
  55. button.addEventListener('mouseenter', () => {
  56. button.style.padding = '10px'; // Larger size on hover
  57. icon.style.width = '30px';
  58. icon.style.height = '30px';
  59. });
  60.  
  61. button.addEventListener('mouseleave', () => {
  62. button.style.padding = '5px'; // Revert to original size
  63. icon.style.width = '20px';
  64. icon.style.height = '20px';
  65. });
  66.  
  67. // Create the iframe
  68. const iframe = document.createElement('iframe');
  69. iframe.src = excelUrl;
  70. iframe.style.position = 'fixed';
  71. iframe.style.bottom = '100px'; // Space for sliders
  72. iframe.style.right = '20px';
  73. iframe.style.width = '500px';
  74. iframe.style.height = '400px';
  75. iframe.style.border = '5px solid #ccc';
  76. iframe.style.borderRadius = '15px'; // Add border radius
  77. iframe.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.2)'; // Optional: Add shadow
  78. iframe.style.zIndex = '9998';
  79. iframe.style.display = 'none';
  80.  
  81. document.body.appendChild(iframe);
  82.  
  83. // Create the sliders container div
  84. const slidersContainer = document.createElement('div');
  85. slidersContainer.style.position = 'fixed';
  86. slidersContainer.style.bottom = '25px';
  87. slidersContainer.style.right = '77px';
  88. slidersContainer.style.zIndex = '9997';
  89. slidersContainer.style.display = 'none';
  90. slidersContainer.style.border = '1px solid rgba(107, 107, 111, 0.61)';
  91. slidersContainer.style.background = '#00000012';
  92. slidersContainer.style.backdropFilter = 'blur(10px)';
  93. slidersContainer.style.borderRadius = '50px';
  94. slidersContainer.style.padding = '5px 20px 5px 20px';
  95. slidersContainer.style.color = '#cff';
  96.  
  97. // Create the width slider
  98. const widthSliderContainer = document.createElement('div');
  99. widthSliderContainer.style.marginBottom = '10px';
  100.  
  101. const widthSliderLabel = document.createElement('label');
  102. widthSliderLabel.textContent = "Width: ";
  103. widthSliderLabel.style.marginRight = '10px';
  104. widthSliderLabel.style.color = '#fff';
  105.  
  106. const widthSlider = document.createElement('input');
  107. widthSlider.type = 'range';
  108. widthSlider.min = '300';
  109. widthSlider.max = '800';
  110. widthSlider.value = '500'; // Default width
  111. widthSlider.style.width = '200px';
  112.  
  113. widthSlider.addEventListener('input', () => {
  114. iframe.style.width = widthSlider.value + 'px';
  115. });
  116.  
  117. widthSliderContainer.appendChild(widthSliderLabel);
  118. widthSliderContainer.appendChild(widthSlider);
  119. slidersContainer.appendChild(widthSliderContainer);
  120.  
  121. // Create the height slider
  122. const heightSliderContainer = document.createElement('div');
  123.  
  124. const heightSliderLabel = document.createElement('label');
  125. heightSliderLabel.textContent = "Height:";
  126. heightSliderLabel.style.marginRight = '10px';
  127. heightSliderLabel.style.color = '#fff';
  128.  
  129. const heightSlider = document.createElement('input');
  130. heightSlider.type = 'range';
  131. heightSlider.min = '300';
  132. heightSlider.max = '600';
  133. heightSlider.value = '400'; // Default height
  134. heightSlider.style.width = '200px';
  135.  
  136. heightSlider.addEventListener('input', () => {
  137. iframe.style.height = heightSlider.value + 'px';
  138. });
  139.  
  140. heightSliderContainer.appendChild(heightSliderLabel);
  141. heightSliderContainer.appendChild(heightSlider);
  142. slidersContainer.appendChild(heightSliderContainer);
  143.  
  144. document.body.appendChild(slidersContainer);
  145.  
  146. // Toggle iframe visibility and sliders on button click
  147. let isOpen = false;
  148. button.addEventListener('click', () => {
  149. isOpen = !isOpen;
  150. iframe.style.display = isOpen ? 'block' : 'none';
  151. slidersContainer.style.display = isOpen ? 'block' : 'none';
  152. icon.style.positioin = isOpen ? 'absolute' : 'fixed';
  153. icon.style.bottom = isOpen ? '15px' : '15px';
  154. icon.style.right = isOpen ? '15px' : '15px';
  155. button.style.width = isOpen ? '350px' : '50px'; // Animate width
  156. button.style.height = isOpen ? '75px' : '50px'; // Animate height
  157. });
  158. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址