PageSourceSearch

https://qianxun7747.github.io/js/day.js

js qianxun7747.github.io collected 2026-10-03 09:48:15 UTC 7,739 bytes, 174 lines download raw bytes

1var d = new Date();
2m = d.getMonth() + 1;
3dd = d.getDate();
4y = d.getFullYear();
5
6// 公祭日
7if (m == 9 && dd == 18) {
8    document.getElementsByTagName("html")[0].setAttribute("style", "filter: grayscale(60%);");
9    if (sessionStorage.getItem("isPopupWindow") != "1") {
10        Swal.fire("今天是九一八事变" + (y - 1931).toString() + "周年纪念日\n🪔勿忘国耻,振兴中华🪔");
11        sessionStorage.setItem("isPopupWindow", "1");
12    }
13}
14if (m == 7 && dd == 7) {
15    document.getElementsByTagName("html")[0].setAttribute("style", "filter: grayscale(60%);");
16    if (sessionStorage.getItem("isPopupWindow") != "1") {
17        Swal.fire("今天是卢沟桥事变" + (y - 1937).toString() + "周年纪念日\n🪔勿忘国耻,振兴中华🪔");
18        sessionStorage.setItem("isPopupWindow", "1");
19    }
20}
21if (m == 12 && dd == 13) {
22    document.getElementsByTagName("html")[0].setAttribute("style", "filter: grayscale(60%);");
23    if (sessionStorage.getItem("isPopupWindow") != "1") {
24        Swal.fire("今天是南京大屠杀" + (y - 1937).toString() + "周年纪念日\n🪔勿忘国耻,振兴中华🪔");
25        sessionStorage.setItem("isPopupWindow", "1");
26    }
27}
28if (m == 8 && dd == 14) {
29    document.getElementsByTagName("html")[0].setAttribute("style", "filter: grayscale(60%);");
30    if (sessionStorage.getItem("isPopupWindow") != "1") {
31        Swal.fire("今天是世界慰安妇纪念日\n🪔勿忘国耻,振兴中华🪔");
32        sessionStorage.setItem("isPopupWindow", "1");
33    }
34}
35
36
37// 节假日
38if (m == 10 && dd <= 3) {//国庆节
39    if (sessionStorage.getItem("isPopupWindow") != "1") {
40        Swal.fire("祝祖国" + (y - 1949).toString() + "岁生日快乐!");
41        sessionStorage.setItem("isPopupWindow", "1");
42    }
43}
44if (m == 8 && dd == 15) {//搞来玩的,小日子投降
45    if (sessionStorage.getItem("isPopupWindow") != "1") {
46        Swal.fire("小日子已经投降" + (y - 1945).toString() + "年了😃");
47        sessionStorage.setItem("isPopupWindow", "1");
48    }
49}
50if (m == 1 && dd == 1) {//元旦节
51    if (sessionStorage.getItem("isPopupWindow") != "1") {
52        Swal.fire(y.toString() + "年元旦快乐!🎉");
53        sessionStorage.setItem("isPopupWindow", "1");
54    }
55}
56if (m == 3 && dd == 8) {//妇女节
57    if (sessionStorage.getItem("isPopupWindow") != "1") {
58        Swal.fire("各位女神们,妇女节快乐!👩");
59        sessionStorage.setItem("isPopupWindow", "1");
60    }
61}
62l = ["非常抱歉,因为不可控原因,博客将于明天停止运营!", "好消息,日本没了!", "美国垮了,原因竟然是川普!", "微软垮了!", "你的电脑已经过载,建议立即关机!", "你知道吗?站长很喜欢你哦!", "一分钟有61秒哦", "你喜欢的人跟别人跑了!"]
63if (m == 4 && dd == 1) {//愚人节,随机谎话
64    if (sessionStorage.getItem("isPopupWindow") != "1") {
65        Swal.fire(l[Math.floor(Math.random() * l.length)]);
66        sessionStorage.setItem("isPopupWindow", "1");
67    }
68}
69if (m == 5 && dd == 1) {//劳动节
70    if (sessionStorage.getItem("isPopupWindow") != "1") {
71        Swal.fire("劳动节快乐\n为各行各业辛勤工作的人们致敬!");
72        sessionStorage.setItem("isPopupWindow", "1");
73    }
74}
75if (m == 5 && dd == 4) {//青年节
76    if (sessionStorage.getItem("isPopupWindow") != "1") {
77        Swal.fire("青年节快乐\n青春不是回忆逝去,而是把握现在!");
78        sessionStorage.setItem("isPopupWindow", "1");
79    }
80}
81if (m == 5 && dd == 20) {//520
82    if (sessionStorage.getItem("isPopupWindow") != "1") {
83        Swal.fire("今年是520情人节\n快和你喜欢的人一起过吧!💑");
84        sessionStorage.setItem("isPopupWindow", "1");
85    }
86}
87if (m == 7 && dd == 1) {//建党节
88    if (sessionStorage.getItem("isPopupWindow") != "1") {
89        Swal.fire("祝中国共产党" + (y - 1921).toString() + "岁生日快乐!");
90        sessionStorage.setItem("isPopupWindow", "1");
91    }
92}
93if (m == 9 && dd == 10) {//教师节
94    if (sessionStorage.getItem("isPopupWindow") != "1") {
95        Swal.fire("各位老师们教师节快乐!👩‍🏫");
96        sessionStorage.setItem("isPopupWindow", "1");
97    }
98}
99if (m == 12 && dd == 25) {//圣诞节
100    if (sessionStorage.getItem("isPopupWindow") != "1") {
101        Swal.fire("圣诞节快乐!🎄");
102        sessionStorage.setItem("isPopupWindow", "1");
103    }
104}
105
106//传统节日部分
107
108if ((y == 2023 && m == 4 && dd == 5) || (y == 2024 && m == 4 && dd == 4) || (y == 2025 && m == 4 && dd == 4)) {//清明节
109    if (sessionStorage.getItem("isPopupWindow") != "1") {
110        Swal.fire("清明时节雨纷纷,一束鲜花祭故人💐");
111        sessionStorage.setItem("isPopupWindow", "1");
112    }
113}
114if ((y == 2023 && m == 12 && dd == 22) || (y == 2024 && m == 12 && dd == 21) || (y == 2025 && m == 12 && dd == 21)) {//冬至
115    if (sessionStorage.getItem("isPopupWindow") != "1") {
116        Swal.fire("冬至快乐\n快吃上一碗热热的汤圆和饺子吧🧆");
117        sessionStorage.setItem("isPopupWindow", "1");
118    }
119}
120
121var lunar = calendarFormatter.solar2lunar();
122
123//农历采用汉字计算,防止出现闰月导致问题
124
125if ((lunar["IMonthCn"] == "正月" && lunar["IDayCn"] == "初六") || (lunar["IMonthCn"] == "正月" && lunar["IDayCn"] == "初五") || (lunar["IMonthCn"] == "正月" && lunar["IDayCn"] == "初四") || (lunar["IMonthCn"] == "正月" && lunar["IDayCn"] == "初三") || (lunar["IMonthCn"] == "正月" && lunar["IDayCn"] == "初二") || (lunar["IMonthCn"] == "正月" && lunar["IDayCn"] == "初一") || (lunar["IMonthCn"] == "腊月" && lunar["IDayCn"] == "三十") || (lunar["IMonthCn"] == "腊月" && lunar["IDayCn"] == "廿九")) {
126    //春节,本来只有大年三十到初六,但是有时候除夕是大年二十九,所以也加上了
127    if (sessionStorage.getItem("isPopupWindow") != "1") {
128        Swal.fire(y.toString() + "年新年快乐\n🎊祝你心想事成,诸事顺利🎊");
129        sessionStorage.setItem("isPopupWindow", "1");
130    }
131}
132if ((lunar["IMonthCn"] == "正月" && lunar["IDayCn"] == "十五")) {
133    //元宵节
134    if (sessionStorage.getItem("isPopupWindow") != "1") {
135        Swal.fire("元宵节快乐\n送你一个大大的灯笼🧅");
136        sessionStorage.setItem("isPopupWindow", "1");
137    }
138}
139if ((lunar["IMonthCn"] == "五月" && lunar["IDayCn"] == "初五")) {
140    //端午节
141    if (sessionStorage.getItem("isPopupWindow") != "1") {
142        Swal.fire("端午节快乐\n请你吃一条粽子🍙");
143        sessionStorage.setItem("isPopupWindow", "1");
144    }
145}
146if ((lunar["IMonthCn"] == "七月" && lunar["IDayCn"] == "初七")) {
147    //七夕节
148    if (sessionStorage.getItem("isPopupWindow") != "1") {
149        Swal.fire("七夕节快乐\n黄昏后,柳梢头,牛郎织女来碰头");
150        sessionStorage.setItem("isPopupWindow", "1");
151    }
152}
153if ((lunar["IMonthCn"] == "八月" && lunar["IDayCn"] == "十五")) {
154    //中秋节
155    if (sessionStorage.getItem("isPopupWindow") != "1") {
156        Swal.fire("中秋节快乐\n请你吃一块月饼🍪");
157        sessionStorage.setItem("isPopupWindow", "1");
158    }
159}
160if ((lunar["IMonthCn"] == "九月" && lunar["IDayCn"] == "初九")) {
161    //重阳节
162    if (sessionStorage.getItem("isPopupWindow") != "1") {
163        Swal.fire("重阳节快乐\n独在异乡为异客,每逢佳节倍思亲");
164        sessionStorage.setItem("isPopupWindow", "1");
165    }
166}
167
168// 切换主题提醒
169// if (y == 2022 && m == 12 && (dd >= 18 && dd <= 20)) {
170//     if (sessionStorage.getItem("isPopupWindow") != "1") {
171//         Swal.fire("网站换成冬日限定主题啦⛄");
172//         sessionStorage.setItem("isPopupWindow", "1");
173//     }
174// }

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.