PageSourceSearch

https://majestic-mods.ru/js/kartinka-video.js

js majestic-mods.ru collected 2026-10-08 14:35:08 UTC 2,328 bytes, 68 lines download raw bytes

1function toggleMode() {
2 const checkbox = document.getElementById('preview_mode');
3 const cards = document.querySelectorAll('.game-layout');
4
5 localStorage.setItem("preview_mode", checkbox.checked ? "video" : "image");
6
7 if (checkbox.checked) {
8 // 🔥 ВОЗВРАЩАЮ notifyUserPopup!
9 notifyUserPopup("warn", "Для корректного отображения видео рекомендуется использовать VPN. В противном случае видео может не отображаться.");
10 console.log('Режим: Видео');
11
12 cards.forEach(card => {
13 const video = card.querySelector('.media-video');
14 const image = card.querySelector('.media-img');
15 const thumb = card.querySelector('.game-thumb');
16const preview = thumb?.querySelector('.game-preview') || thumb?.querySelector('.game-preview-inform');
17
18
19 if (video) {
20 card.classList.add('video-mode');
21
22 // Скрываем элементы и в карточках, и в информерах
23 if (preview) {
24 preview.querySelectorAll('.category-label, .info-container, .new-badge, .locked-badge, .update-badge-absolute, .favorite-badge')
25 .forEach(el => {
26 el.classList.remove("show-element");
27 el.classList.add("hide-element");
28 });
29 }
30
31 if (image) image.style.display = 'none';
32 video.style.display = 'block';
33 }
34 });
35
36 } else {
37 console.log('Режим: Картинка');
38
39 cards.forEach(card => {
40 card.classList.remove('video-mode');
41 const video = card.querySelector('.media-video');
42 const image = card.querySelector('.media-img');
43 const thumb = card.querySelector('.game-thumb');
44const preview = thumb?.querySelector('.game-preview') || thumb?.querySelector('.game-preview-inform');
45
46
47 // Возвращаем элементы
48 if (preview) {
49 preview.querySelectorAll('.category-label, .info-container, .new-badge, .locked-badge, .update-badge-absolute, .caption, .favorite-badge')
50 .forEach(el => {
51 el.classList.remove("hide-element");
52 el.classList.add("show-element");
53 });
54 }
55
56 if (image) image.style.display = 'block';
57 if (video) video.style.display = 'none';
58 });
59 }
60}
61
62document.addEventListener("DOMContentLoaded", function () {
63 const savedMode = localStorage.getItem("preview_mode");
64 const checkbox = document.getElementById('preview_mode');
65
66 checkbox.checked = (savedMode === "video");
67 toggleMode();
68});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.