Custom Arka Plan Yöneticisi

Web siteleri için arka plan değiştirme [öncelikli manga-manhwa siteleri]

当前为 2025-01-28 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Custom Arka Plan Yöneticisi
  3. // @namespace http://Vebascans.net/
  4. // @version 2.1.2
  5. // @description Web siteleri için arka plan değiştirme [öncelikli manga-manhwa siteleri]
  6. // @author www.vebascans.net
  7. // @match https://*/*
  8. // @grant none
  9. // @icon https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi0QDJZNeXWcaD9lXWMN2yenYt5XGrqfPavkCFpWLe01CpSEsMn7IGpbOLqxEfjx4QUUi4wgTw0Kc7vP7FrKjPKpcaaCu1N6QRJzlZvS_Wwr2r3kA4l0-E5wl7xObsZchd8YNSxySFZATPAr2bnrkANBUrmy8Rpdexe-mxG8N6QDojEj0onaNNXF_6g-s/w800/logo.png
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // 1) SweetAlert2 kütüphanesini otomatik yükle:
  16. const script = document.createElement('script');
  17. script.src = 'https://cdn.jsdelivr.net/npm/sweetalert2@11';
  18. script.onload = main; // Kütüphane yüklendikten sonra main() fonksiyonunu çalıştır
  19. document.head.appendChild(script);
  20.  
  21. // 2) Tüm kodu main() içine alıyoruz:
  22. function main() {
  23.  
  24. /**************************************************************************
  25. * SweetAlert Tanımlaması
  26. **************************************************************************/
  27. const Toast = Swal.mixin({
  28. toast: true,
  29. position: "top",
  30. showConfirmButton: false,
  31. timer: 3000,
  32. timerProgressBar: true,
  33. didOpen: (toast) => {
  34. toast.onmouseenter = Swal.stopTimer;
  35. toast.onmouseleave = Swal.resumeTimer;
  36. }
  37. });
  38.  
  39. /**************************************************************************
  40. * 0) Sabitler
  41. **************************************************************************/
  42. const ACTIVE_KEY = 'VebaScans.net_custom_wp_active'; // Son seçilen veri (URL/Color)
  43. const HISTORY_KEY = 'VebaScans.net_custom_wp_history'; // Tüm geçmiş
  44. const SETTINGS_KEY = 'vebascans.net_custom_wp_settings'; // Arka plan ayarları (repeat/cover vs.)
  45.  
  46. /**************************************************************************
  47. * 1) Local Storage Yardımcı Fonksiyonları
  48. **************************************************************************/
  49. function getActiveData() {
  50. try {
  51. const str = localStorage.getItem(ACTIVE_KEY);
  52. return str ? JSON.parse(str) : null;
  53. } catch (e) {
  54. return null;
  55. }
  56. }
  57.  
  58. function setActiveData(obj) {
  59. localStorage.setItem(ACTIVE_KEY, JSON.stringify(obj));
  60. applyActiveDataToBody(); // Aktif veri her değiştiğinde body'yi güncelle
  61. }
  62.  
  63. function removeActiveData() {
  64. localStorage.removeItem(ACTIVE_KEY);
  65. applyActiveDataToBody();
  66. }
  67.  
  68. function getHistoryData() {
  69. try {
  70. const str = localStorage.getItem(HISTORY_KEY);
  71. return str ? JSON.parse(str) : [];
  72. } catch (e) {
  73. return [];
  74. }
  75. }
  76.  
  77. function addToHistory(obj) {
  78. let history = getHistoryData();
  79.  
  80. // 1) Eğer geçmişte aynı öğe zaten varsa ekleme yapma
  81. const exists = history.some(item => item.type === obj.type && item.value === obj.value);
  82. if (exists) {
  83. return; // Aynısı varsa, ekleme yapmadan çık
  84. }
  85.  
  86. // 2) Yeni öğeyi ekle
  87. history.push(obj);
  88.  
  89. // 3) Aynı öğelerin tekrarını önlemek için filtrele (sadece bir tane kalacak)
  90. history = history.filter((item, index, self) =>
  91. index === self.findIndex(t => t.type === item.type && t.value === item.value)
  92. );
  93.  
  94. // 4) Güncellenmiş geçmişi kaydet
  95. localStorage.setItem(HISTORY_KEY, JSON.stringify(history));
  96. }
  97.  
  98. // -- Ayarlar (Tekrarlı / Tek sefer)
  99. function getSettings() {
  100. try {
  101. const str = localStorage.getItem(SETTINGS_KEY);
  102. return str ? JSON.parse(str) : {};
  103. } catch (e) {
  104. return {};
  105. }
  106. }
  107.  
  108. function setSettings(newSettings) {
  109. localStorage.setItem(SETTINGS_KEY, JSON.stringify(newSettings));
  110. }
  111.  
  112. /**************************************************************************
  113. * 2) BODY Arkaplanını Aktif Veriye (URL/Color) ve Ayarlara Göre Uygulama
  114. **************************************************************************/
  115. function applyActiveDataToBody() {
  116. const activeData = getActiveData();
  117. if (!activeData) {
  118. // Aktif bir şey yoksa istersen varsayılan temize çek
  119. document.body.style.backgroundImage = '';
  120. document.body.style.backgroundColor = '';
  121. return;
  122. }
  123.  
  124. if (activeData.type === 'url') {
  125. // Body için arkaplan resmi
  126. document.body.style.backgroundImage = `url(${activeData.value})`;
  127. document.body.style.backgroundRepeat = 'no-repeat';
  128. document.body.style.backgroundSize = 'cover';
  129. document.body.style.backgroundColor = '';
  130.  
  131. // .body-wrap için deneme
  132.  
  133. try {
  134.  
  135. const bodyWrap = document.querySelector('body.text-ui-light .body-wrap');
  136. bodyWrap.style.backgroundImage = `url(${activeData.value})`;
  137. bodyWrap.style.backgroundRepeat = 'no-repeat';
  138. bodyWrap.style.backgroundSize = 'cover';
  139. bodyWrap.style.backgroundColor = '';
  140. } catch (error) {
  141. // .body-wrap yoksa hata görmezden gel
  142. }
  143. try {
  144. const sitecontent = document.querySelector('.site-content');
  145. sitecontent.style.backgroundImage = `url(${activeData.value})`;
  146. sitecontent.style.backgroundRepeat = 'no-repeat';
  147. sitecontent.style.backgroundSize = 'cover';
  148. sitecontent.style.backgroundColor = '';
  149. } catch (error) {
  150. // .site-content yoksa hata görmezden gel
  151. }
  152. } else if (activeData.type === 'color') {
  153. // Body için arkaplan rengi
  154. document.body.style.backgroundImage = 'none';
  155. document.body.style.backgroundColor = activeData.value;
  156.  
  157. // .body-wrap için deneme
  158. try {
  159. const bodyWrap = document.querySelector('body.text-ui-light .body-wrap');
  160. bodyWrap.style.backgroundImage = 'none';
  161. bodyWrap.style.backgroundColor = activeData.value;
  162. } catch (error) {
  163. // .body-wrap yoksa hata görmezden gel
  164. }
  165.  
  166. // .site-content için deneme
  167. try {
  168. const sitecontent = document.querySelector('.site-content');
  169. sitecontent.style.backgroundImage = 'none';
  170. sitecontent.style.backgroundColor = activeData.value;
  171. } catch (error) {
  172. // .site-content yoksa hata görmezden gel
  173. }
  174. }
  175. }
  176.  
  177. /**************************************************************************
  178. * 3) MODAL Arayüzü Oluşturma
  179. **************************************************************************/
  180. let modalOverlay, modalContent;
  181.  
  182. window.addEventListener('load', () => {
  183. createModal();
  184. createToggleShortcut(); // F7 ile aç/kapa
  185. applyActiveDataToBody(); // Sayfa açıldığında kaydedilmiş aktif veriyi uygula
  186. });
  187.  
  188. // F7 ile modal aç/kapa
  189. function createToggleShortcut() {
  190. window.addEventListener('keydown', (e) => {
  191. if (e.key === 'F7') {
  192. toggleModal();
  193. }
  194. });
  195. }
  196.  
  197. function toggleModal(forceOpen) {
  198. const isHidden = (modalOverlay.style.display === 'none');
  199. if (forceOpen === true) {
  200. showModal();
  201. } else if (forceOpen === false) {
  202. hideModal();
  203. } else {
  204. if (isHidden) showModal(); else hideModal();
  205. }
  206. }
  207.  
  208. function showModal() {
  209. modalOverlay.style.display = 'block';
  210. refreshHistoryList();
  211. refreshActiveLabel();
  212. refreshSettingsUI();
  213. }
  214.  
  215. function hideModal() {
  216. modalOverlay.style.display = 'none';
  217. }
  218.  
  219. function createModal() {
  220. // (1) Overlay
  221. modalOverlay = document.createElement('div');
  222. Object.assign(modalOverlay.style, {
  223. display: 'none',
  224. position: 'fixed',
  225. top: '0',
  226. left: '0',
  227. width: '100%',
  228. height: '100%',
  229. backgroundColor: 'rgba(0,0,0,0.5)',
  230. zIndex: '99999',
  231. color: '#000'
  232. });
  233. document.body.appendChild(modalOverlay);
  234.  
  235. // (2) İçerik
  236. modalContent = document.createElement('div');
  237. Object.assign(modalContent.style, {
  238. position: 'absolute',
  239. top: '50%',
  240. left: '50%',
  241. transform: 'translate(-50%, -50%)',
  242. width: '400px',
  243. backgroundColor: '#fff',
  244. padding: '20px',
  245. borderTopLeftRadius: '15px',
  246. borderBottomRightRadius: '15px',
  247. border: '3px solid black',
  248. minHeight: '400px',
  249. fontFamily: 'Arial, sans-serif',
  250. fontSize: '14px',
  251. fontWeight: 'normal',
  252. color: '#000',
  253. });
  254. modalOverlay.appendChild(modalContent);
  255.  
  256. // (3) Logo
  257. const img = document.createElement('img');
  258. img.src = 'https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi0QDJZNeXWcaD9lXWMN2yenYt5XGrqfPavkCFpWLe01CpSEsMn7IGpbOLqxEfjx4QUUi4wgTw0Kc7vP7FrKjPKpcaaCu1N6QRJzlZvS_Wwr2r3kA4l0-E5wl7xObsZchd8YNSxySFZATPAr2bnrkANBUrmy8Rpdexe-mxG8N6QDojEj0onaNNXF_6g-s/w800/logo.png';
  259. img.alt = 'Logo';
  260. Object.assign(img.style, {
  261. width: '130px',
  262. position: 'absolute',
  263. top: '0',
  264. right: '50%',
  265. transform: 'translate(50%, -50%)'
  266. });
  267. modalContent.appendChild(img);
  268.  
  269. // (4) Başlık
  270. const header = document.createElement('h3');
  271. header.innerHTML = '<a href=\"https://www.vebascans.net/\" style=\"color: #402870; font-weight: 500; text-decoration: none; font-family: fantasy;\">Vebascans</a> - Custom Background';
  272. header.style.margin = '0 0 10px 0';
  273. header.style.color = 'black';
  274. header.style.marginTop = '45px';
  275. modalContent.appendChild(header);
  276.  
  277. // (5) Kapat butonu
  278. const closeBtn = document.createElement('button');
  279. closeBtn.innerHTML = `
  280. <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">
  281. <g fill=\"none\" fill-rule=\"evenodd\">
  282. <path d=\"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z\"/>
  283. <path fill=\"currentColor\" d=\"m12 14.122l5.303 5.303a1.5 1.5 0 0 0 2.122-2.122L14.12 12l5.304-5.303a1.5 1.5 0 1 0-2.122-2.121L12 9.879L6.697 4.576a1.5 1.5 0 1 0-2.122 2.12L9.88 12l-5.304 5.304a1.5 1.5 0 1 0 2.122 2.12z\"/>
  284. </g>
  285. </svg>`;
  286. Object.assign(closeBtn.style, {
  287. position: 'absolute',
  288. top: '10px',
  289. right: '10px',
  290. border: 'none',
  291. background: 'transparent',
  292. cursor: 'pointer',
  293. color: 'black'
  294. });
  295. closeBtn.onclick = () => hideModal();
  296. modalContent.appendChild(closeBtn);
  297.  
  298. // (6) Seçim Menüsü (URL mi Renk mi)
  299. const selectDiv = document.createElement('div');
  300. Object.assign(selectDiv.style, {
  301. display: 'flex',
  302. flexDirection: 'row',
  303. gap: '5px',
  304. marginBottom: '10px'
  305. });
  306. modalContent.appendChild(selectDiv);
  307.  
  308. const selectLabel = document.createElement('label');
  309. selectLabel.textContent = 'Seçim: ';
  310. selectLabel.style.display = 'flex';
  311. selectLabel.style.alignItems = 'center';
  312. selectDiv.appendChild(selectLabel);
  313.  
  314. const selectInput = document.createElement('select');
  315. selectInput.id = 'typeSelect';
  316. selectInput.style.background ='white';
  317. selectInput.style.border ='2px solid black';
  318. selectInput.style.borderRadius ='3px';
  319. selectInput.style.color = 'black';
  320. const optUrl = new Option('URL', 'url');
  321. const optColor = new Option('Renk', 'color');
  322. selectInput.add(optUrl);
  323. selectInput.add(optColor);
  324. selectDiv.appendChild(selectInput);
  325.  
  326. // (7) URL input
  327. const urlInput = document.createElement('input');
  328. urlInput.type = 'text';
  329. urlInput.id = 'urlInput';
  330. urlInput.placeholder = 'Görsel URL giriniz...';
  331. urlInput.style.background ='transparent';
  332. urlInput.style.border ='2px solid black';
  333. urlInput.style.borderRadius ='3px';
  334. selectDiv.appendChild(urlInput);
  335.  
  336. // (8) Color input
  337. const colorInput = document.createElement('input');
  338. colorInput.type = 'color';
  339. colorInput.id = 'colorInput';
  340. colorInput.value = '#000000';
  341. colorInput.style.width = '50px';
  342. colorInput.style.height = '30px';
  343. colorInput.style.display = 'none';
  344. selectDiv.appendChild(colorInput);
  345.  
  346. // Seçim değişince hangi input görünsün?
  347. selectInput.addEventListener('change', () => {
  348. if (selectInput.value === 'url') {
  349. urlInput.style.display = 'inline-block';
  350. colorInput.style.display = 'none';
  351. } else {
  352. urlInput.style.display = 'none';
  353. colorInput.style.display = 'inline-block';
  354. }
  355. });
  356.  
  357. // (9) Aktar butonu
  358. const aktarBtn = document.createElement('button');
  359. aktarBtn.textContent = 'Aktar';
  360. aktarBtn.style.marginLeft = '5px';
  361. aktarBtn.style.padding = '5px 10px';
  362. aktarBtn.style.cursor = 'pointer';
  363. aktarBtn.style.color = 'black';
  364. aktarBtn.style.border ='2px solid black';
  365. aktarBtn.style.borderRadius ='3px';
  366. aktarBtn.style.background = 'transparent';
  367. selectDiv.appendChild(aktarBtn);
  368.  
  369. aktarBtn.onclick = () => {
  370. const currentType = selectInput.value; // 'url' | 'color'
  371. let currentValue = '';
  372. if (currentType === 'url') {
  373. currentValue = urlInput.value.trim();
  374. if (!currentValue) {
  375. Toast.fire({ icon: 'error', title: 'Lütfen bir URL girin.' });
  376. return;
  377. }
  378. } else {
  379. currentValue = colorInput.value; // #rrggbb
  380. if (!currentValue) {
  381. Toast.fire({ icon: 'error', title: 'Lütfen bir renk seçin.' });
  382. return;
  383. }
  384. }
  385.  
  386. // Yeni aktif obje
  387. const newActiveObj = { type: currentType, value: currentValue };
  388. setActiveData(newActiveObj);
  389. addToHistory(newActiveObj);
  390.  
  391. refreshHistoryList();
  392. refreshActiveLabel();
  393.  
  394. // URL tipini kullandıysa inputu temizleyelim
  395. if (currentType === 'url') {
  396. urlInput.value = '';
  397. }
  398. Toast.fire({ icon: 'success', title: 'Yeni aktif değer atandı ve body arkaplanı güncellendi!' });
  399. };
  400.  
  401. // (10) Tekrar / Tek Sefer AYARI
  402. const repeatDiv = document.createElement('div');
  403. repeatDiv.style.margin = '10px 0';
  404. repeatDiv.style.display = 'flex';
  405. repeatDiv.style.flexDirection = 'row';
  406. repeatDiv.style.gap = '10px';
  407. modalContent.appendChild(repeatDiv);
  408.  
  409. const repeatLabel = document.createElement('span');
  410. repeatLabel.textContent = 'Arkaplan Tekrarı:';
  411. repeatLabel.style.alignSelf = 'center';
  412. repeatDiv.appendChild(repeatLabel);
  413.  
  414. const labelRepeat = document.createElement('label');
  415. const radioRepeat = document.createElement('input');
  416. radioRepeat.type = 'radio';
  417. radioRepeat.name = 'bgRepeat';
  418. radioRepeat.value = 'repeat';
  419. radioRepeat.style.marginRight = '5px';
  420. labelRepeat.appendChild(radioRepeat);
  421. labelRepeat.appendChild(document.createTextNode('Tekrarlı'));
  422. repeatDiv.appendChild(labelRepeat);
  423.  
  424. const labelNoRepeat = document.createElement('label');
  425. const radioNoRepeat = document.createElement('input');
  426. radioNoRepeat.type = 'radio';
  427. radioNoRepeat.name = 'bgRepeat';
  428. radioNoRepeat.value = 'no-repeat';
  429. radioNoRepeat.style.marginRight = '5px';
  430. labelNoRepeat.appendChild(radioNoRepeat);
  431. labelNoRepeat.appendChild(document.createTextNode('Tek Sefer'));
  432. repeatDiv.appendChild(labelNoRepeat);
  433.  
  434. [radioRepeat, radioNoRepeat].forEach(radio => {
  435. radio.addEventListener('change', () => {
  436. const newVal = radio.value; // 'repeat' | 'no-repeat'
  437. const s = getSettings();
  438. s.bgRepeat = newVal;
  439. setSettings(s);
  440. applyActiveDataToBody();
  441. });
  442. });
  443.  
  444. // (11) Aktif Veriyi Sil
  445. const removeActiveBtn = document.createElement('button');
  446. removeActiveBtn.textContent = 'Aktif Veriyi Sil';
  447. removeActiveBtn.style.marginBottom = '10px';
  448. removeActiveBtn.style.padding = '5px 10px';
  449. removeActiveBtn.style.cursor = 'pointer';
  450. removeActiveBtn.style.color = 'black';
  451. removeActiveBtn.style.background = 'transparent';
  452. removeActiveBtn.style.border ='2px solid black';
  453. removeActiveBtn.style.borderRadius ='3px';
  454. modalContent.appendChild(removeActiveBtn);
  455.  
  456. removeActiveBtn.onclick = () => {
  457. removeActiveData();
  458. refreshHistoryList();
  459. refreshActiveLabel();
  460. Toast.fire({ icon: 'info', title: 'Aktif veri silindi. Arkaplan temizlendi.' });
  461. };
  462.  
  463. // (12) Şu anda aktif veriyi gösteren label
  464. const activeDiv = document.createElement('div');
  465. activeDiv.id = 'activeDiv';
  466. activeDiv.style.marginTop = '10px';
  467. modalContent.appendChild(activeDiv);
  468.  
  469. // (13) Geçmiş Başlık
  470. const historyTitle = document.createElement('h4');
  471. historyTitle.textContent = 'Geçmiş';
  472. historyTitle.style.margin = '10px 0 5px 0';
  473. modalContent.appendChild(historyTitle);
  474.  
  475. // (14) Geçmiş Container
  476. const historyContainer = document.createElement('div');
  477. historyContainer.id = 'historyContainer';
  478. historyContainer.style.maxHeight = '200px';
  479. historyContainer.style.overflowY = 'auto';
  480. historyContainer.style.border = '1px solid #ccc';
  481. historyContainer.style.padding = '5px';
  482. modalContent.appendChild(historyContainer);
  483. }
  484.  
  485. /**************************************************************************
  486. * 4) Geçmiş & Aktif Listeyi Güncelleme
  487. **************************************************************************/
  488. function refreshHistoryList() {
  489. const historyContainer = document.getElementById('historyContainer');
  490. if (!historyContainer) return;
  491.  
  492. historyContainer.innerHTML = '';
  493.  
  494. const historyData = getHistoryData();
  495. const activeData = getActiveData(); // {type:'...', value:'...'}
  496.  
  497. historyData.forEach((item) => {
  498. const row = document.createElement('div');
  499. row.style.display = 'flex';
  500. row.style.alignItems = 'center';
  501. row.style.marginBottom = '8px';
  502. row.style.cursor = 'pointer';
  503.  
  504. // URL ise küçük görsel
  505. if (item.type === 'url') {
  506. const imgThumb = document.createElement('img');
  507. imgThumb.src = item.value;
  508. imgThumb.alt = 'Görsel';
  509. imgThumb.style.width = '30px';
  510. imgThumb.style.height = '30px';
  511. imgThumb.style.objectFit = 'cover';
  512. imgThumb.style.marginRight = '8px';
  513. row.appendChild(imgThumb);
  514.  
  515. const label = document.createElement('span');
  516. label.textContent = 'URL';
  517. row.appendChild(label);
  518. }
  519. // Renk ise kutu
  520. else if (item.type === 'color') {
  521. const colorBox = document.createElement('span');
  522. colorBox.style.display = 'inline-block';
  523. colorBox.style.width = '30px';
  524. colorBox.style.height = '30px';
  525. colorBox.style.backgroundColor = item.value;
  526. colorBox.style.marginRight = '8px';
  527. colorBox.style.border = '1px solid #000';
  528. row.appendChild(colorBox);
  529.  
  530. const label = document.createElement('span');
  531. label.textContent = item.value;
  532. row.appendChild(label);
  533. }
  534.  
  535. // Aktif mi?
  536. if (activeData && activeData.type === item.type && activeData.value === item.value) {
  537. const activeSpan = document.createElement('span');
  538. activeSpan.textContent = ' (Şu anda aktif)';
  539. activeSpan.style.color = 'green';
  540. activeSpan.style.marginLeft = '5px';
  541. row.appendChild(activeSpan);
  542. }
  543.  
  544. // Tıklayınca bu itemi aktif yap
  545. row.addEventListener('click', () => {
  546. setActiveData(item);
  547. refreshHistoryList();
  548. refreshActiveLabel();
  549. Toast.fire({ icon: 'success', title: 'Aktif değer güncellendi!' });
  550. });
  551.  
  552. historyContainer.appendChild(row);
  553. });
  554. }
  555.  
  556. function refreshActiveLabel() {
  557. const activeDiv = document.getElementById('activeDiv');
  558. if (!activeDiv) return;
  559.  
  560. const activeData = getActiveData();
  561. if (!activeData) {
  562. activeDiv.textContent = 'Şu anda aktif bir değer yok.';
  563. } else {
  564. if (activeData.type === 'url') {
  565. activeDiv.innerHTML = `
  566. Aktif: URL
  567. <img src=\"${activeData.value}\"
  568. alt=\"Aktif Görsel\"
  569. style=\"width: 100px; height: auto; object-fit: cover; margin-left:5px;\"/>
  570. `;
  571. } else {
  572. activeDiv.innerHTML = `
  573. Aktif: Renk
  574. <span style=\"display:inline-block; width:20px; height:20px;
  575. background-color:${activeData.value};
  576. border:1px solid #000; vertical-align:middle;\">
  577. </span>
  578. ${activeData.value}
  579. `;
  580. }
  581. }
  582. }
  583.  
  584. /**************************************************************************
  585. * 5) Arkaplan Ayarı (Tekrar / Tek Sefer) Radyo Butonlarını Güncelleme
  586. **************************************************************************/
  587. function refreshSettingsUI() {
  588. const settings = getSettings();
  589. const bgRepeat = settings.bgRepeat || 'no-repeat'; // Varsayılan no-repeat
  590. const radios = document.getElementsByName('bgRepeat');
  591. radios.forEach(radio => {
  592. radio.checked = (radio.value === bgRepeat);
  593. });
  594. }
  595.  
  596. } // main() sonu
  597.  
  598. })(); // IIFE sonu