srr14221

sCRIPT ( USE TAMPERMONKEY EXTENSION ALSO PRESS ALWAYS ALLOW FOR THE WALLPAPER ) UPDATED

Feb 3rd, 2026 (edited)
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.54 KB | None | 0 0
  1. // ==UserScript==
  2. // @name iready hack (only displays on your screen, not the teachers screen. use it only for substitutes)
  3. // @namespace http://tampermonkey.net/
  4. // @version 6.1
  5. // @description Menu to change minutes and update circular progress ring accurately + prevent iReady from resetting it
  6. // @match *://*.i-ready.com/*
  7. // @grant GM_xmlhttpRequest
  8. // @icon https://login.i-ready.com/favicon.ico
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. /* ---------------- MENU CREATION ---------------- */
  15. const menu = document.createElement("div");
  16. menu.style.position = "fixed";
  17. menu.style.top = "20px";
  18. menu.style.left = "20px";
  19. menu.style.padding = "15px 20px";
  20. menu.style.background = "rgba(20, 20, 30, 0.85)";
  21. menu.style.border = "1px solid #0ff";
  22. menu.style.borderRadius = "12px";
  23. menu.style.boxShadow = "0 0 15px #0ff, inset 0 0 10px #0ff";
  24. menu.style.backdropFilter = "blur(6px)";
  25. menu.style.zIndex = "999999";
  26. menu.style.fontFamily = "Arial";
  27. menu.style.cursor = "move";
  28. menu.style.color = "#0ff";
  29. menu.style.userSelect = "none";
  30. menu.style.transition = "0.2s ease-out";
  31. menu.classList.add("menu-animate");
  32.  
  33. menu.innerHTML = `
  34. <div style="
  35. font-size: 16px;
  36. font-weight: bold;
  37. color: #0ff;
  38. text-shadow: 0 0 8px #0ff;
  39. margin-bottom: 10px;
  40. text-align: center;
  41. ">
  42. Made by Justalilbro
  43. </div>
  44.  
  45. <button id="setMinsBtn"
  46. style="
  47. padding: 10px 18px;
  48. background: linear-gradient(135deg, #0ff, #09f);
  49. border: none;
  50. border-radius: 8px;
  51. color: black;
  52. font-weight: bold;
  53. cursor: pointer;
  54. box-shadow: 0 0 var(--glow) #0ff;
  55. "
  56. >Set Minutes</button>
  57.  
  58. <button id="setPfpBtn"
  59. style="
  60. margin-top: 10px;
  61. padding: 10px 18px;
  62. background: linear-gradient(135deg, #0ff, #0af);
  63. border: none;
  64. border-radius: 8px;
  65. color: black;
  66. font-weight: bold;
  67. cursor: pointer;
  68. box-shadow: 0 0 var(--glow) #0ff;
  69. "
  70. >change Neon color of dashboard</button>
  71.  
  72. <button id="openSiteBtn"
  73. style="
  74. margin-top: 10px;
  75. padding: 10px 18px;
  76. background: linear-gradient(135deg, #0ff, #0af);
  77. border: none;
  78. border-radius: 8px;
  79. color: black;
  80. font-weight: bold;
  81. cursor: pointer;
  82. box-shadow: 0 0 var(--glow) #0ff;
  83. "
  84. >Games</button>
  85.  
  86. <button id="rainbowBtn"
  87. style="
  88. margin-top: 10px;
  89. padding: 10px 18px;
  90. background: linear-gradient(135deg, #0ff, #0af);
  91. border: none;
  92. border-radius: 8px;
  93. color: black;
  94. font-weight: bold;
  95. cursor: pointer;
  96. box-shadow: 0 0 var(--glow) #0ff;
  97. "
  98. >Rainbow Pulse</button>
  99.  
  100. <button id="launcherBtn"
  101. style="
  102. margin-top: 10px;
  103. padding: 10px 18px;
  104. background: linear-gradient(135deg, #0ff, #0af);
  105. border: none;
  106. border-radius: 8px;
  107. color: black;
  108. font-weight: bold;
  109. cursor: pointer;
  110. box-shadow: 0 0 var(--glow) #0ff;
  111. "
  112. >Link Launcher</button>
  113.  
  114. <label style="color:white; margin-top:10px;">Glow Intensity</label>
  115. <input id="glowSlider" type="range" min="0" max="30" value="10" style="width:100%;">
  116.  
  117. <div id="launcherPopup" style="display:none;">
  118. <div id="launcherTopBar">
  119. <input id="launcherInput" placeholder="Enter URL" style="flex:1;">
  120. <button id="launchOpenBtn" class="neonBtn">Open</button>
  121. <button id="closeLauncherBtn" class="neonBtn">Close</button>
  122. </div>
  123.  
  124. <iframe id="launcherFrame"></iframe>
  125. </div>
  126. <button id="bgBtn"
  127. style="
  128. margin-top: 10px;
  129. padding: 10px 18px;
  130. background: linear-gradient(135deg, #0ff, #0af);
  131. border: none;
  132. border-radius: 8px;
  133. color: black;
  134. font-weight: bold;
  135. cursor: pointer;
  136. box-shadow: 0 0 var(--glow) #0ff;
  137. "
  138. >Change Background</button>
  139. `;
  140.  
  141. document.body.appendChild(menu);
  142.  
  143. /* ---------------- LINK LAUNCHER (FIXED SITE + FULLSCREEN) ---------------- */
  144. document.getElementById("launcherBtn").onclick = () => {
  145. const fixedURL = "https://onehtmlpagechallenge.com/entries/tic-tac-toe.html"; // ← CHANGE THIS TO ANY SITE YOU WANT
  146.  
  147. GM_xmlhttpRequest({
  148. method: "GET",
  149. url: fixedURL,
  150. onload: function(res) {
  151. const blob = new Blob([res.responseText], { type: "text/html" });
  152. const blobURL = URL.createObjectURL(blob);
  153.  
  154. document.getElementById("launcherFrame").src = blobURL;
  155. document.getElementById("launcherPopup").style.display = "block";
  156. },
  157. onerror: function() {
  158. alert("Failed to load site.");
  159. }
  160. });
  161. };
  162.  
  163. document.getElementById("closeLauncherBtn").onclick = () => {
  164. document.getElementById("launcherPopup").style.display = "none";
  165. };
  166.  
  167. /* ---------------- GLOW SLIDER ---------------- */
  168. document.documentElement.style.setProperty("--glow", "10px");
  169.  
  170. document.getElementById("glowSlider").oninput = (e) => {
  171. const value = e.target.value + "px";
  172. document.documentElement.style.setProperty("--glow", value);
  173. };
  174.  
  175. /* ---------------- RAINBOW PULSE MODE ---------------- */
  176.  
  177. let rainbowActive = false;
  178. let rainbowInterval = null;
  179.  
  180. document.getElementById("rainbowBtn").onclick = () => {
  181. rainbowActive = !rainbowActive;
  182.  
  183. if (rainbowActive) {
  184. let hue = 0;
  185. rainbowInterval = setInterval(() => {
  186. hue = (hue + 2) % 360;
  187. const color = `hsl(${hue}, 100%, 50%)`;
  188.  
  189. document.querySelectorAll(`
  190. div.sc-lgpSej,
  191. div.kDLWDE,
  192. button[aria-label='Dashboard Navigation'],
  193. button[aria-label='Tour'],
  194. button[aria-label='Bookshelf'],
  195. button[aria-label='Math Tools'],
  196. button[aria-label='Learning Games'],
  197. div.sc-fNmvep,
  198. span.select-selected-text
  199. `).forEach(el => {
  200. el.style.background = color;
  201. el.style.border = `2px solid ${color}`;
  202. el.style.boxShadow = `0 0 15px ${color}`;
  203. });
  204.  
  205. }, 50);
  206. } else {
  207. clearInterval(rainbowInterval);
  208. alert("Rainbow Mode OFF");
  209. }
  210. };
  211.  
  212. // Trigger initial animation
  213. setTimeout(() => menu.classList.add("menu-visible"), 20);
  214.  
  215. // --- THEME SWITCHER + RESET BUTTON ---
  216. const themeControls = document.createElement("div");
  217. themeControls.style.marginTop = "12px";
  218. themeControls.innerHTML = `
  219. <label style="font-size:14px;">Theme:</label>
  220. <select id="themeSelect" style="
  221. margin-left:6px;
  222. padding:4px;
  223. border-radius:6px;
  224. background:#111;
  225. color:#0ff;
  226. border:1px solid #0ff;
  227. ">
  228. <option value="neon">Neon</option>
  229. <option value="dark">Dark</option>
  230. <option value="light">Light</option>
  231. </select>
  232.  
  233. <button id="resetBtn"
  234. style="
  235. margin-top:10px;
  236. width:100%;
  237. padding:8px;
  238. background:linear-gradient(135deg, #f00, #a00);
  239. border:none;
  240. border-radius:8px;
  241. color:white;
  242. font-weight:bold;
  243. cursor:pointer;
  244. box-shadow: 0 0 var(--glow) #0ff;
  245.  
  246. "
  247. >Reset to Default</button>
  248.  
  249. `;
  250. menu.appendChild(themeControls);
  251.  
  252. // Top bar theming
  253. const topBar = document.querySelector(".sc-fNmvep.fgctbz");
  254.  
  255. function applyTopBarTheme(theme) {
  256. if (!topBar) return;
  257. topBar.classList.remove("tb-neon", "tb-dark", "tb-light");
  258. topBar.classList.add(`tb-${theme}`);
  259. }
  260.  
  261. // Apply theme
  262. const applyTheme = (theme) => {
  263. menu.classList.remove("theme-neon", "theme-dark", "theme-light");
  264. menu.classList.add(`theme-${theme}`);
  265. applyTopBarTheme(theme);
  266. localStorage.setItem("ireadyMenuTheme", theme);
  267. };
  268.  
  269. // Load saved theme
  270. const savedTheme = localStorage.getItem("ireadyMenuTheme") || "neon";
  271. applyTheme(savedTheme);
  272. document.getElementById("themeSelect").value = savedTheme;
  273.  
  274. // Theme change event
  275. document.getElementById("themeSelect").addEventListener("change", (e) => {
  276. applyTheme(e.target.value);
  277. });
  278.  
  279. // Reset button logic
  280. document.getElementById("resetBtn").onclick = () => {
  281. applyTheme("neon");
  282. document.getElementById("themeSelect").value = "neon";
  283.  
  284. window._ireadyForcedMins = null;
  285. updateMinutes(0);
  286. updateProgressRing(0);
  287.  
  288. const pfpSpan = document.querySelector("button[aria-label='Profile'] span.sc-bmWQkG");
  289. if (pfpSpan) {
  290. pfpSpan.style.backgroundImage = "";
  291. pfpSpan.style.backgroundSize = "";
  292. pfpSpan.style.backgroundPosition = "";
  293. }
  294.  
  295. menu.style.top = "20px";
  296. menu.style.left = "20px";
  297.  
  298. alert("Menu reset to default.");
  299. };
  300.  
  301. // --- Toggle menu visibility with "P" key (with animation) ---
  302. let menuVisible = true;
  303. document.addEventListener("keydown", (e) => {
  304. if (e.key.toLowerCase() === "p") {
  305. menuVisible = !menuVisible;
  306.  
  307. if (menuVisible) {
  308. menu.style.display = "block";
  309. setTimeout(() => menu.classList.add("menu-visible"), 10);
  310. } else {
  311. menu.classList.remove("menu-visible");
  312. setTimeout(() => {
  313. if (!menuVisible) menu.style.display = "none";
  314. }, 250);
  315. }
  316. }
  317. });
  318.  
  319. // --- Change profile picture from any PNG link ---
  320. document.getElementById("setPfpBtn").onclick = () => {
  321. let color = prompt("Enter a neon color (hex, rgb, or name):", "#00ffff");
  322. if (!color) return;
  323.  
  324. // 1. Purple lesson card
  325. document.querySelectorAll("div.sc-lgpSej, div.kDLWDE").forEach(card => {
  326. card.style.background = color;
  327. card.style.border = `2px solid ${color}`;
  328. card.style.boxShadow = `0 0 15px ${color}`;
  329. card.style.transition = "0.25s ease-out";
  330. });
  331.  
  332. // 2. Hamburger nav button
  333. const navBtn = document.querySelector("button[aria-label='Dashboard Navigation']");
  334. if (navBtn) {
  335. navBtn.style.background = color;
  336. navBtn.style.border = `2px solid ${color}`;
  337. navBtn.style.boxShadow = `0 0 12px ${color}`;
  338. navBtn.style.borderRadius = "10px";
  339. navBtn.style.transition = "0.25s ease-out";
  340. }
  341.  
  342. // 3. Top bar
  343. const topBar = document.querySelector("div.sc-fNmvep, div.fgctbz");
  344. if (topBar) {
  345. topBar.style.background = color;
  346. topBar.style.borderBottom = `2px solid ${color}`;
  347. topBar.style.boxShadow = `0 0 12px ${color}`;
  348. topBar.style.transition = "0.25s ease-out";
  349. }
  350.  
  351. // 4. Tour button
  352. const tourBtn = document.querySelector("button[aria-label='Tour']");
  353. if (tourBtn) {
  354. tourBtn.style.background = color;
  355. tourBtn.style.border = `2px solid ${color}`;
  356. tourBtn.style.boxShadow = `0 0 12px ${color}`;
  357. tourBtn.style.borderRadius = "10px";
  358. tourBtn.style.transition = "0.25s ease-out";
  359. }
  360.  
  361. // 5. Bookshelf button
  362. const bookshelfBtn = document.querySelector("button[aria-label='Bookshelf']");
  363. if (bookshelfBtn) {
  364. bookshelfBtn.style.background = color;
  365. bookshelfBtn.style.border = `2px solid ${color}`;
  366. bookshelfBtn.style.boxShadow = `0 0 12px ${color}`;
  367. bookshelfBtn.style.borderRadius = "10px";
  368. bookshelfBtn.style.transition = "0.25s ease-out";
  369. }
  370.  
  371. // 6. Math Tools button
  372. const mathToolsBtn = document.querySelector("button[aria-label='Math Tools']");
  373. if (mathToolsBtn) {
  374. mathToolsBtn.style.background = color;
  375. mathToolsBtn.style.border = `2px solid ${color}`;
  376. mathToolsBtn.style.boxShadow = `0 0 12px ${color}`;
  377. mathToolsBtn.style.borderRadius = "10px";
  378. mathToolsBtn.style.transition = "0.25s ease-out";
  379. }
  380.  
  381. // 7. Learning Games button
  382. const learningGamesBtn = document.querySelector("button[aria-label='Learning Games']");
  383. if (learningGamesBtn) {
  384. learningGamesBtn.style.background = color;
  385. learningGamesBtn.style.border = `2px solid ${color}`;
  386. learningGamesBtn.style.boxShadow = `0 0 12px ${color}`;
  387. learningGamesBtn.style.borderRadius = "10px";
  388. learningGamesBtn.style.transition = "0.25s ease-out";
  389. }
  390.  
  391. // 8. MATH span (custom cursor text)
  392. const mathSpan = document.querySelector("span.select-selected-text.sweezy-custom-cursor-hover");
  393. if (mathSpan) {
  394. mathSpan.style.color = color;
  395. mathSpan.style.textShadow = `0 0 10px ${color}`;
  396. mathSpan.style.transition = "0.25s ease-out";
  397. }
  398. };
  399.  
  400. // --- Open Website button ---
  401. document.getElementById("openSiteBtn").onclick = () => {
  402. window.open("https://clever.pbseducation1914.org/", "_blank");
  403. };
  404. document.getElementById("bgBtn").onclick = () => {
  405. changeBackground();
  406. };
  407.  
  408. // --- Make menu draggable ---
  409. let offsetX, offsetY, isDown = false;
  410. menu.addEventListener("mousedown", e => {
  411. isDown = true;
  412. offsetX = e.clientX - menu.offsetLeft;
  413. offsetY = e.clientY - menu.offsetTop;
  414. });
  415. document.addEventListener("mouseup", () => isDown = false);
  416. document.addEventListener("mousemove", e => {
  417. if (isDown) {
  418. menu.style.left = (e.clientX - offsetX) + "px";
  419. menu.style.top = (e.clientY - offsetY) + "px";
  420. }
  421. });
  422.  
  423. // --- Button click handler ---
  424. document.getElementById("setMinsBtn").onclick = () => {
  425. let mins = prompt("How many mins? (both on math and reading)");
  426. if (mins === null) return;
  427. mins = mins.trim();
  428.  
  429. if (!/^\d+$/.test(mins)) {
  430. alert("Please enter a valid number.");
  431. return;
  432. }
  433.  
  434. mins = Number(mins);
  435. window._ireadyForcedMins = mins;
  436.  
  437. updateMinutes(mins);
  438. updateProgressRing(mins);
  439. watchCircle(); // start locking the ring
  440. };
  441.  
  442. // --- Replace minutes text ---
  443. function updateMinutes(value) {
  444. document.querySelectorAll("span.sc-eJoXEY.jyZGpj").forEach(span => {
  445. if (!isNaN(span.textContent.trim())) {
  446. span.textContent = value;
  447. }
  448. });
  449.  
  450. document.querySelectorAll("span.sc-erPUmh.kLeQTe").forEach(span => {
  451. const match = span.textContent.trim().match(/^(\d+)\s*Minutes$/i);
  452. if (match) {
  453. span.textContent = `${value} Minutes`;
  454. }
  455. });
  456. }
  457.  
  458. // --- Accurate SVG ring update ---
  459. function updateProgressRing(mins) {
  460. const clamped = Math.min(mins, 60);
  461. const progress = clamped / 60;
  462.  
  463. // --- MATH RING ---
  464. const mathCircle = document.querySelector("#progress-circle");
  465. if (mathCircle) {
  466. const r = mathCircle.r.baseVal.value;
  467. const C = 2 * Math.PI * r;
  468.  
  469. mathCircle.style.strokeDasharray = C;
  470. mathCircle.style.strokeDashoffset = C * (1 - progress);
  471. mathCircle.style.transition = "stroke-dashoffset 0.2s linear";
  472. }
  473.  
  474. // --- READING RING ---
  475. const readingCircle = document.querySelector('svg#donut-chart circle.sc-hdBJTi.cgAQTl');
  476. if (readingCircle) {
  477. const r = readingCircle.r.baseVal.value;
  478. const C = 2 * Math.PI * r;
  479.  
  480. readingCircle.style.strokeDasharray = C;
  481. readingCircle.style.strokeDashoffset = C * (1 - progress);
  482. readingCircle.style.transition = "stroke-dashoffset 0.2s linear";
  483. }
  484. }
  485.  
  486. // --- MutationObserver to LOCK the ring so iReady can't reset it ---
  487. let circleObserver = null;
  488.  
  489. function watchCircle() {
  490. const circle = document.querySelector("#progress-circle");
  491. if (!circle) return;
  492.  
  493. if (circleObserver) circleObserver.disconnect();
  494.  
  495. circleObserver = new MutationObserver(() => {
  496. if (window._ireadyForcedMins != null) {
  497. updateProgressRing(window._ireadyForcedMins);
  498. }
  499. });
  500.  
  501. circleObserver.observe(circle, {
  502. attributes: true,
  503. attributeFilter: ["style"]
  504. });
  505. }
  506.  
  507. // --- Debounced global observer for text updates ---
  508. let debounceTimer = null;
  509. const observer = new MutationObserver(() => {
  510. if (!window._ireadyForcedMins) return;
  511.  
  512. clearTimeout(debounceTimer);
  513. debounceTimer = setTimeout(() => {
  514. updateMinutes(window._ireadyForcedMins);
  515. updateProgressRing(window._ireadyForcedMins);
  516. }, 50);
  517. });
  518.  
  519. observer.observe(document.body, { childList: true, subtree: true });
  520.  
  521. const style = document.createElement("style");
  522. style.textContent = `
  523.  
  524. /* --- MENU THEMES --- */
  525. .theme-neon {
  526. background: rgba(20, 20, 30, 0.85) !important;
  527. border: 1px solid #0ff !important;
  528. color: #0ff !important;
  529. box-shadow: 0 0 15px #0ff, inset 0 0 10px #0ff !important;
  530. }
  531.  
  532. .theme-dark {
  533. background: rgba(10, 10, 10, 0.9) !important;
  534. border: 1px solid #444 !important;
  535. color: #ddd !important;
  536. box-shadow: 0 0 10px #444 !important;
  537. }
  538.  
  539. .theme-light {
  540. background: rgba(255, 255, 255, 0.9) !important;
  541. border: 1px solid #ccc !important;
  542. color: #222 !important;
  543. box-shadow: 0 0 10px #ccc !important;
  544. }
  545.  
  546. /* --- TOP BAR THEMES --- */
  547. .tb-neon {
  548. background: rgba(0, 255, 255, 0.12) !important;
  549. border-bottom: 1px solid #0ff !important;
  550. box-shadow: 0 0 12px #0ff !important;
  551. }
  552.  
  553. .tb-dark {
  554. background: rgba(10, 10, 10, 0.85) !important;
  555. border-bottom: 1px solid #444 !important;
  556. box-shadow: 0 0 8px #333 !important;
  557. }
  558.  
  559. .tb-light {
  560. background: rgba(255, 255, 255, 0.9) !important;
  561. border-bottom: 1px solid #ccc !important;
  562. box-shadow: 0 0 8px #ccc !important;
  563. }
  564.  
  565. /* Buttons inside the top bar */
  566. .tb-neon button,
  567. .tb-dark button,
  568. .tb-light button {
  569. transition: 0.2s ease-out !important;
  570. }
  571.  
  572. /* Neon button glow */
  573. .tb-neon button {
  574. background: rgba(0, 255, 255, 0.15) !important;
  575. border-radius: 8px !important;
  576. box-shadow: 0 0 10px #0ff !important;
  577. }
  578.  
  579. /* Dark mode buttons */
  580. .tb-dark button {
  581. background: rgba(40, 40, 40, 0.8) !important;
  582. border-radius: 8px !important;
  583. box-shadow: 0 0 6px #222 !important;
  584. }
  585.  
  586. /* Light mode buttons */
  587. .tb-light button {
  588. background: rgba(240, 240, 240, 0.9) !important;
  589. border-radius: 8px !important;
  590. box-shadow: 0 0 6px #aaa !important;
  591. }
  592.  
  593. /* Profile icon circle */
  594. .tb-neon .sc-bmWQkG {
  595. box-shadow: 0 0 10px #0ff !important;
  596. }
  597.  
  598. .tb-dark .sc-bmWQkG {
  599. box-shadow: 0 0 6px #222 !important;
  600. }
  601.  
  602. .tb-light .sc-bmWQkG {
  603. box-shadow: 0 0 6px #aaa !important;
  604. }
  605.  
  606. /* --- MENU ANIMATION --- */
  607. .menu-animate {
  608. opacity: 0;
  609. transform: translateY(-10px);
  610. transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  611. }
  612.  
  613. .menu-visible {
  614. opacity: 1 !important;
  615. transform: translateY(0px) !important;
  616. }
  617.  
  618. /* Neon card base style */
  619. .neon-card {
  620. border-radius: 14px !important;
  621. transition: 0.25s ease-out !important;
  622. }
  623.  
  624. /* ---------------- FULLSCREEN LAUNCHER ---------------- */
  625. #launcherPopup {
  626. position: fixed !important;
  627. top: 0 !important;
  628. left: 0 !important;
  629. width: 100vw !important;
  630. height: 100vh !important;
  631. background: rgba(0, 0, 0, 0.85) !important;
  632. backdrop-filter: blur(6px);
  633. z-index: 999999 !important;
  634. padding: 0 !important;
  635. margin: 0 !important;
  636. display: none;
  637. }
  638.  
  639. #launcherTopBar {
  640. width: 100%;
  641. height: 60px;
  642. background: rgba(0, 255, 255, 0.15);
  643. display: flex;
  644. align-items: center;
  645. gap: 10px;
  646. padding: 10px;
  647. box-sizing: border-box;
  648. border-bottom: 1px solid #0ff;
  649. }
  650.  
  651. #launcherFrame {
  652. width: 100vw !important;
  653. height: calc(100vh - 60px) !important;
  654. border: none !important;
  655. outline: none !important;
  656. }
  657.  
  658. `;
  659. document.head.appendChild(style);
  660. /* ---------------- CHANGE BACKGROUND (BLOB + TARGETED REMOVAL) ---------------- */
  661. function changeBackground() {
  662. const url = prompt("Enter wallpaper link (PNG/JPG/WebP):");
  663. if (!url) return;
  664.  
  665. GM_xmlhttpRequest({
  666. method: "GET",
  667. url: url,
  668. responseType: "blob",
  669. onload: function(res) {
  670. const blobURL = URL.createObjectURL(res.response);
  671.  
  672. // Apply your wallpaper ONLY to html/body
  673. const css = `
  674. html, body {
  675. background-image: url("${blobURL}") !important;
  676. background-size: cover !important;
  677. background-position: center !important;
  678. background-repeat: no-repeat !important;
  679. }
  680. `;
  681.  
  682. const style = document.createElement("style");
  683. style.innerHTML = css;
  684. document.head.appendChild(style);
  685.  
  686. // Remove ONLY the JoustBlue background
  687. const targetFragment = "Theme_JoustBlue_Background.svg";
  688.  
  689. document.querySelectorAll("*").forEach(el => {
  690. const bg = getComputedStyle(el).backgroundImage;
  691. if (bg && bg.includes(targetFragment)) {
  692. el.style.backgroundImage = "none";
  693. el.style.background = "transparent";
  694. }
  695. });
  696.  
  697. console.log("Wallpaper applied via blob:", blobURL);
  698. },
  699.  
  700. onerror: function() {
  701. alert("Failed to load image. Try a different link.");
  702. }
  703. });
  704. }
  705.  
  706. })();
  707.  
Advertisement
Add Comment
Please, Sign In to add comment