Skip to content
This repository was archived by the owner on May 9, 2025. It is now read-only.

Commit bfce072

Browse files
Update script.ts
1 parent 7db3999 commit bfce072

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

layout/script.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,8 @@ const layout_main: Function = () => {
433433
"/layout/image/background/monochrome/light.svg";
434434
const monochrome_center: string =
435435
"/layout/image/background/monochrome/center.svg";
436+
const wallpaper_infinite_url: string =
437+
"/wallpaper/content/Infinite/?embed";
436438
const gradient_bg: string = "/layout/image/background/gradient/bg.jpeg";
437439
const result: HTMLDivElement = document.createElement("div");
438440
result.id = "BackGround";
@@ -469,6 +471,13 @@ const layout_main: Function = () => {
469471
src="${gradient_bg}"
470472
/>
471473
</div>
474+
<div data-background-name="wallpaper-infinite">
475+
<iframe
476+
class="background fill"
477+
style="border:none;"
478+
src="${wallpaper_infinite_url}"
479+
/>
480+
</div>
472481
<div data-background-name="rainbow">
473482
<canvas class="background fill rainbow"></canvas>
474483
</div>
@@ -690,6 +699,9 @@ const layout_main: Function = () => {
690699
raindrop: Function;
691700
fluffycat: Function;
692701
space: Function;
702+
wallpaper: {
703+
infinite: Function;
704+
};
693705
rainbow: {
694706
run: Function;
695707
rectangle: Function;
@@ -883,6 +895,19 @@ const layout_main: Function = () => {
883895
return 0;
884896
}
885897
},
898+
wallpaper:{
899+
infinite: (): number => {
900+
const wallpaper_infinite: HTMLElement | null = document.querySelector(
901+
'#BackGround>div[data-background-name="wallpaper-infinite"]'
902+
);
903+
if (wallpaper_infinite == null) {
904+
return 1;
905+
} else {
906+
wallpaper_infinite.style.display = "contents";
907+
return 0;
908+
}
909+
}
910+
},
886911
rainbow: {
887912
run: (pattern: bg_pattern, fill: boolean = true): number => {
888913
const rainbow: HTMLElement | null = document.querySelector(
@@ -1121,7 +1146,7 @@ const layout_main: Function = () => {
11211146
};
11221147
const randInt: Function = (min: number, max: number): number =>
11231148
Math.floor(Math.random() * (max + 1 - min)) + min;
1124-
const bg_num: number = 11; //randInt(1, 12);
1149+
const bg_num: number = 13; //randInt(1, 13);
11251150
switch (bg_num) {
11261151
case 1:
11271152
bg_func.monochrome();
@@ -1159,6 +1184,9 @@ const layout_main: Function = () => {
11591184
case 12:
11601185
bg_func.rainbow.halloween();
11611186
break;
1187+
case 13:
1188+
bg_func.wallpaper.infinite();
1189+
break;
11621190
default:
11631191
console.error("Error bg_func out of Index");
11641192
break;

0 commit comments

Comments
 (0)