-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod.js
168 lines (152 loc) · 5.71 KB
/
mod.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
// css styles for each option, overrides mspaThemes.scss
const dayGradient = `
#app > *, .tabFrame > div {
--system-skycolor: #35bfff;
--system-background:
url(assets://archive/collection/homebg_right.png) left top repeat-y fixed,
url(assets://archive/collection/homebg_left.png) right top repeat-y fixed,
linear-gradient(180deg, #35bfff 50%, #0c86e9 100%) fixed;
}`
const sunset = `
#app > *, .tabFrame > div {
--system-skycolor: #ff953f;
--system-background:
url(assets://archive/collection/sunset_homebg_right.png) left top repeat-y fixed,
url(assets://archive/collection/sunset_homebg_left.png) right top repeat-y fixed;
}`
const sunsetGradient = `
#app > *, .tabFrame > div {
--system-skycolor: #ff953f;
--system-background:
url(assets://archive/collection/sunset_homebg_right.png) left top repeat-y fixed,
url(assets://archive/collection/sunset_homebg_left.png) right top repeat-y fixed,
linear-gradient(180deg, #ff953f 50%, #D34C1B 100%) fixed;
}`
const night = `
#app > *, .tabFrame > div {
--system-skycolor: #1e1e1e;
--system-background:
url(assets://archive/collection/night_homebg_right.png) left top repeat-y fixed,
url(assets://archive/collection/night_homebg_left.png) right top repeat-y fixed;
}`
const nightGradient = `
#app > *, .tabFrame > div {
--system-skycolor: #1e1e1e;
--system-background:
url(assets://archive/collection/night_homebg_right.png) left top repeat-y fixed,
url(assets://archive/collection/night_homebg_left.png) right top repeat-y fixed,
linear-gradient(180deg, #2c3030 30%, #1e1e1e 100%) fixed;
}`
// dynamic: overrides to night when in dark theme
const nightDynamic = `
.pageBody.customStyles.dark {
--system-skycolor: #1e1e1e;
--system-background:
url(assets://archive/collection/night_homebg_right.png) left top repeat-y fixed,
url(assets://archive/collection/night_homebg_left.png) right top repeat-y fixed;
}`
// honestly I don't know what controls priority between the two css overrides here but it works out to the way I need it to so yeah
const nightDynamicGradient = `
#app > *, .tabFrame > div {
--system-skycolor: #35bfff;
--system-background:
url(assets://archive/collection/homebg_right.png) left top repeat-y fixed,
url(assets://archive/collection/homebg_left.png) right top repeat-y fixed,
linear-gradient(180deg, #35bfff 50%, #0c86e9 100%) fixed;
}
.pageBody.customStyles.dark {
--system-skycolor: #1e1e1e;
--system-background:
url(assets://archive/collection/night_homebg_right.png) left top repeat-y fixed,
url(assets://archive/collection/night_homebg_left.png) right top repeat-y fixed,
linear-gradient(180deg, #2c3030 30%, #1e1e1e 100%) fixed;
}`
module.exports = {
title: "Cloud BG Changer",
summary: "Alternatives for the default cloud background",
author: "Niklink",
modVersion: "1",
description: "Change those clouds to fit your mood! • <a href=\"https://github.com/Niklink/cloudBGchanger\">Source code / updates</a><br><b>Previews (w/gradients):</b> <a href=\"assets://archive/collection/daypreview.png\">Day</a> • <a href=\"assets://archive/collection/sunsetpreview.png\">Sunset</a> • <a href=\"assets://archive/collection/nightpreview.png\">Night</a>",
styles: [],
computed(api){
store = api.store
// sets default on first run (pretty sure this works)
store.set("option", store.get("option", "nightDynamicGradient"))
computed = {
styles: []
}
switch (store.get("option")) {
case 'dayGradient':
computed.styles.push(
{body: dayGradient}
)
break;
case 'sunset':
computed.styles.push(
{body: sunset}
)
break;
case 'sunsetGradient':
computed.styles.push(
{body: sunsetGradient}
)
break;
case 'night':
computed.styles.push(
{body: night}
)
break;
case 'nightGradient':
computed.styles.push(
{body: nightGradient}
)
break;
case 'nightDynamic':
computed.styles.push(
{body: nightDynamic}
)
break;
case 'nightDynamicGradient':
computed.styles.push(
{body: nightDynamicGradient}
)
break;
}
return computed
},
trees: {
"./": "assets://archive/collection/"
},
settings: {
radio: [{
model: "option",
label: "Cloud style",
desc: "Dynamic: Changes from day to night clouds when Dark Mode is active",
options: [{
value: "nightDynamicGradient",
label: "Dynamic (Gradient)",
},{
value: "dayGradient",
label: "Day (Gradient)"
},{
value: "sunsetGradient",
label: "Sunset (Gradient)"
},{
value: "nightGradient",
label: "Night (Gradient)"
},{
value: "nightDynamic",
label: "Dynamic"
},{
value: "default",
label: "Day"
},{
value: "sunset",
label: "Sunset"
},{
value: "night",
label: "Night"
}]
}]
}
}