4 var time_node = document.getElementById("time");
5 var time = Math.floor(Date.now() / 1000);
6 var seconds = 60 - (time % 900) % 60;
7 var minutes = 14 - Math.floor((time % 900) / 60);
13 time_node.textContent = "" + (minutes + ":0" + seconds);
15 time_node.textContent = "" + (minutes + ":" + seconds);
18 function setCatalog(){
19 document.cookie = "display=catalog"
20 var threads = document.getElementsByClassName("thread-container-list");
21 var item_len = threads.length ;
22 for (var thread = item_len - 1 ; thread >= 0; thread--){
23 threads[thread].className = "thread-container";
25 var rows = document.getElementsByClassName("row-container-list");
26 var item_len = rows.length ;
27 for (var row = item_len - 1 ; row >= 0; row--){
28 rows[row].className = "row-container";
30 var contents = document.getElementsByClassName("thread-contents-list");
31 var item_len = contents.length ;
32 for (var content = item_len - 1 ; content >= 0; content--){
33 contents[content].className = "thread-contents";
35 var lists = document.getElementsByClassName("interaction-item-list");
36 var item_len = lists.length ;
37 for (var list = item_len - 1 ; list >= 0; list--){
38 lists[list].className = "interaction-item";
40 var details = document.getElementsByClassName("details-list");
41 var item_len = details.length ;
42 for (var detail = item_len - 1 ; detail >= 0; detail--){
43 details[detail].className = "details";
45 var images = document.getElementsByClassName("thread-image-list");
46 var item_len = images.length ;
47 for (var image = item_len - 1 ; image >= 0; image--){
48 images[image].className = "thread-image";
51 var texts = document.getElementsByClassName("thread-text-list");
52 var item_len = texts.length ;
53 for (var text = item_len - 1 ; text >= 0; text--){
54 texts[text].className = "thread-text";
56 console.log(embed_check);
58 var embeded = document.getElementsByClassName("thread-container");
59 var item_len = embeded.length ;
61 for (var embed = item_len - 1 ; embed >= 0; embed--){
62 embeded[embed].className += " embeded ";
67 document.cookie = "display=list"
68 var threads = document.getElementsByClassName("thread-container");
69 var item_len = threads.length ;
70 for (var thread = item_len - 1 ; thread >= 0 ; thread--){
71 threads[thread].className = "thread-container-list";
73 var rows = document.getElementsByClassName("row-container");
74 var item_len = rows.length ;
75 for (var row = item_len - 1 ; row >= 0; row--){
76 rows[row].className = "row-container-list";
78 var contents = document.getElementsByClassName("thread-contents");
79 var item_len = contents.length ;
80 for (var content = item_len - 1 ; content >= 0; content--){
81 contents[content].className = "thread-contents-list";
83 var lists = document.getElementsByClassName("interaction-item");
84 var item_len = lists.length ;
85 for (var list = item_len - 1 ; list >= 0; list--){
86 lists[list].className = "interaction-item-list";
88 var details = document.getElementsByClassName("details");
89 var item_len = details.length ;
90 for (var detail = item_len - 1 ; detail >= 0; detail--){
91 details[detail].className = "details-list";
93 var images = document.getElementsByClassName("thread-image");
94 var item_len = images.length ;
95 for (var image = item_len - 1 ; image >= 0; image--){
96 images[image].className = "thread-image-list";
98 var texts = document.getElementsByClassName("thread-text");
99 var item_len = texts.length ;
100 for (var text = item_len - 1 ; text >= 0; text--){
101 texts[text].className = "thread-text-list";
103 var embeded = document.getElementsByClassName("embeded");
104 var embed = embeded.length ;
105 for (var embed = item_len - 1 ; embed >= 0; embed--){
106 embeded[embed].className = "embed-list";
108 console.log(embed_check);
110 var embeded = document.getElementsByClassName("thread-container-list");
111 var item_len = embeded.length ;
112 console.log(embeded);
113 for (var embed = item_len - 1 ; embed >= 0; embed--){
114 embeded[embed].className += " embeded max";
119 //https://www.w3schools.com/js/js_cookies.asp
120 function getCookie(cname) {
121 var name = cname + "=";
122 var decodedCookie = decodeURIComponent(document.cookie);
123 var ca = decodedCookie.split(';');
124 for(var i = 0; i <ca.length; i++) {
126 while (c.charAt(0) == ' ') {
129 if (c.indexOf(name) == 0) {
130 return c.substring(name.length, c.length);
137 setInterval(moveTimer, 1000);
139 document.getElementById("list-link").addEventListener("click", setList);
140 document.getElementById("catalog-link").addEventListener("click", setCatalog);
141 embed_check = getCookie("page-style") != "native";
142 console.log(embed_check);