-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustomCSSGarbo.js
419 lines (397 loc) ยท 26.3 KB
/
CustomCSSGarbo.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
(function (Scratch) {
'use strict';
// Styles
let generalTextColor = '';
let generalBorderColor = '';
let generalbackgroundColor = '';
let variableValueBoxColor = '';
let variableValueTextColor = '';
let listFooterColor = '';
let listHeaderColor = '';
let listValueTextColor = '';
let listValueBoxColor = '';
let listValueBoxCornerRadius = -1;
let variableValueBoxCornerRadius = -1;
let generalBorderRadius = -1;
let allowScrolling = true;
let borderSize = -1;
// CSS selectors
let monitorRoot;
let monitorRoot2;
let monitorValue;
let monitorListHeader;
let monitorListFooter;
let monitorRowValueOuter;
let monitorRowsInner;
let monitorRowsScroller;
let monitorRowIndex;
let monitorValueLarge;
if (typeof scaffolding !== 'undefined') {
monitorRoot = '.sc-monitor-root';
monitorRoot2 = '.sc-monitor-root[data-opcode^="data_"] .sc-monitor-value-color';
monitorValue = '.sc-monitor-value';
monitorListHeader = '.sc-monitor-list-label';
monitorListFooter = '.sc-monitor-list-footer';
monitorRowValueOuter = '.sc-monitor-row-value-outer';
monitorRowsInner = '.sc-monitor-rows-inner';
monitorRowsScroller = monitorRowsInner;
monitorRowIndex = '.sc-monitor-row-index';
monitorValueLarge = '.sc-monitor-large-value';
} else {
monitorRoot = 'div[class^="monitor_monitor-container_"]';
monitorRoot2 = 'div[class^="monitor_value_"][data-opcode^="data_"]';
monitorValue = 'div[class^="monitor_value_"]';
monitorListHeader = 'div[class^="monitor_list-header_"]';
monitorListFooter = 'div[class^="monitor_list-footer_"]';
monitorRowValueOuter = 'div[class^="monitor_list-value_"]';
monitorRowsInner = 'div[class^="monitor_list-body_"]';
monitorRowsScroller = 'div[class^="monitor_list-body_"] > .ReactVirtualized__List';
monitorRowIndex = 'div[class^="monitor_list-index_"]';
monitorValueLarge = 'div[class^="monitor_large-value_"]';
}
const ColorIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAABOCAYAAACOqiAdAAABbmlDQ1BpY2MAACiRdZE7SwNBFIW/xEfEBym0ELHYQiVFAqIglhqLNEEkKhi1ScZsIiRx2U2QYCvYWAgWoo2vwn+grWCrIAiKIGJn76sRWe8kQoIkM8zej7NzLnfPgjeaVTmneQJy+YIdi4SNhfii4XullS7ZAXwJ5ViTMzNRGq6vezy63oV0r8b36q6OlZSjwN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UYlVhvPWNaq1gC3AKVPYW5q9aww27BXCWx8xg5BqdXHgr34jAQ3WoEInNabZUFVPjPAbQEQ9cXC2wW4WiFs4UhV0nMEjakDxoAGnsodPhkgp/YyNZkDKBrzo9QfaP10PQmcBAIE/gHTdRiku9JXRgAAAABJRU5ErkJggg==';
const stylesheet = document.createElement('style');
stylesheet.className = 'shovelcss-style';
// end of <body> for higher precedence than other sheets
document.body.appendChild(stylesheet);
const applyCSS = () => {
let css = '';
// We assume all values are sanitized when they are set, so then we can just use them as-is here.
if (generalTextColor) {
css += `${monitorRoot}, ${monitorListFooter}, ${monitorListHeader}, ${monitorRowIndex} { color: ${generalTextColor}; }`;
}
if (generalbackgroundColor) {
css += `${monitorRoot}, ${monitorRowsInner} { background: ${generalbackgroundColor}; }`;
}
if (generalBorderColor) {
css += `${monitorRoot} { border-color: ${generalBorderColor}; }`;
}
if (borderSize >= 0) {
css += `${monitorRoot} { border-width: ${borderSize}px; }`;
}
if (generalBorderRadius >= 0) {
css += `${monitorRoot} { border-radius: ${generalBorderRadius}px; }`;
}
if (variableValueBoxColor) {
css += `${monitorRoot2}, ${monitorValueLarge} { background: ${variableValueBoxColor} !important; }`;
}
if (variableValueTextColor) {
css += `${monitorValue}, ${monitorValueLarge} { color: ${variableValueTextColor}; }`;
}
if (variableValueBoxCornerRadius >= 0) {
css += `${monitorValue} { border-radius: ${variableValueBoxCornerRadius}px; }`;
}
if (listHeaderColor) {
css += `${monitorListHeader} { background: ${listHeaderColor}; }`;
}
if (listFooterColor) {
css += `${monitorListFooter} { background: ${listHeaderColor}; }`;
}
if (listValueBoxColor) {
css += `${monitorRowValueOuter} { background: ${listValueBoxColor} !important; }`;
}
if (listValueTextColor) {
css += `${monitorRowValueOuter} { color: ${listValueTextColor}; }`;
}
if (listValueBoxCornerRadius) {
css += `${monitorRowValueOuter} { border-radius: ${listValueBoxCornerRadius}px; }`;
}
if (!allowScrolling) {
css += `${monitorRowsScroller} { overflow: hidden !important; }`;
}
stylesheet.textContent = css;
};
const getMonitorRoot = (id) => {
const allMonitors = document.querySelectorAll(monitorRoot);
for (const monitor of allMonitors) {
if (monitor.dataset.id === id) {
return monitor;
}
}
return null;
};
/**
* @param {string} id
* @param {number} x
* @param {number} y
*/
const setMonitorPosition = (id, x, y) => {
const root = getMonitorRoot(id);
if (root) {
root.style.transform = `translate(${x}px, ${y}px)`;
root.style.left = '0px';
root.style.top = '0px';
}
};
/**
* @param {VM.Target} target
* @param {string} name
* @param {VM.VariableType} type
* @param {number} x
* @param {number} y
*/
const setVariableMonitorPosition = (target, name, type, x, y) => {
// @ts-expect-error
const variable = target.lookupVariableByNameAndType(name, type);
if (variable) {
// @ts-expect-error
setMonitorPosition(variable.id, x, y);
}
};
// Credit to LilyMakesThings
const label = (name, hidden) => ({
blockType: Scratch.BlockType.LABEL,
text: name,
hideFromPalette: hidden
});
class CustomCSS {
getInfo() {
return {
id: 'shovelcss',
name: 'CSS',
menuIconURI: extensionIcon,
color1: '#0072d6',
blocks: [
{
func: 'help',
blockType: Scratch.BlockType.BUTTON,
text: 'How to use',
},
label('Looks blocks', false),
{
blockIconURI: ColorIcon,
opcode: 'changecss',
blockType: Scratch.BlockType.COMMAND,
text: 'Set CSS color of [COLORABLE] to [COLOR]',
arguments: {
COLORABLE: {
type: Scratch.ArgumentType.STRING,
menu: 'COLORABLE_MENU'
},
COLOR: {
type: Scratch.ArgumentType.COLOR,
defaultValue: '#ff0000'
}
}
},
{
blockIconURI: GradientIcon,
opcode: 'gradientAngle',
blockType: Scratch.BlockType.REPORTER,
text: 'Make a CSS gradient with [COLOR1] and [COLOR2] at angle [ANGLE]',
arguments: {
COLOR1: {
type: Scratch.ArgumentType.COLOR,
defaultValue: '#ff0000'
},
COLOR2: {
type: Scratch.ArgumentType.COLOR,
defaultValue: '#6ed02d'
},
ANGLE: {
type: Scratch.ArgumentType.ANGLE,
defaultValue: '90'
}
}
},
{
blockIconURI: TransparentIcon,
disableMonitor: true,
opcode: 'transparentinput',
blockType: Scratch.BlockType.REPORTER,
text: 'Transparent',
},
{
blockIconURI: BorderIcon,
opcode: 'setbordersize',
blockType: Scratch.BlockType.COMMAND,
text: 'Set CSS border size to [SIZE]',
arguments: {
SIZE: {
type: Scratch.ArgumentType.NUMBER,
defaultValue: '2'
}
}
},
{
blockIconURI: BorderIcon,
opcode: 'setborderradius',
blockType: Scratch.BlockType.COMMAND,
text: 'Set CSS roundness of [CORNER] to [SIZE]',
arguments: {
SIZE: {
type: Scratch.ArgumentType.NUMBER,
defaultValue: '4'
},
CORNER: {
type: Scratch.ArgumentType.STRING,
menu: 'BORDER_MENU'
}
}
},
label('Sensing blocks', false),
{
blockIconURI: miscIcon,
opcode: 'allowscrollrule',
blockType: Scratch.BlockType.COMMAND,
text: 'Set CSS list scroll rule to [SCROLLRULE]',
arguments: {
SCROLLRULE: {
type: Scratch.ArgumentType.STRING,
menu: 'SCROLL_MENU'
}
}
},
label('Motion blocks', false),
{
blockIconURI: miscIcon,
opcode: 'setvarpos',
blockType: Scratch.BlockType.COMMAND,
text: 'Set CSS position of variable with label [NAME] to x:[X] y:[Y]',
arguments: {
X: {
type: Scratch.ArgumentType.NUMBER,
defaultValue: '0'
},
Y: {
type: Scratch.ArgumentType.NUMBER,
defaultValue: '0'
},
NAME: {
type: Scratch.ArgumentType.STRING,
defaultValue: 'my variable'
}
}
},
{
blockIconURI: miscIcon,
opcode: 'setlistpos',
blockType: Scratch.BlockType.COMMAND,
text: 'Set CSS position of list with label [NAME] to x:[X] y:[Y]',
arguments: {
X: {
type: Scratch.ArgumentType.NUMBER,
defaultValue: '0'
},
Y: {
type: Scratch.ArgumentType.NUMBER,
defaultValue: '0'
},
NAME: {
type: Scratch.ArgumentType.STRING,
defaultValue: 'my variable'
}
}
},
],
menus: {
COLORABLE_MENU: {
acceptReporters: false,
items: [
'general text',
'general background',
'general border',
'variable value box',
'varibale value text',
'list header',
'list footer',
'list value box',
'list value text'
]
},
BORDER_MENU: {
acceptReporters: false,
items: [
'general borders ',
'variable value box borders',
'list value box borders'
]
},
SCROLL_MENU: {
acceptReporters: false,
items: [
'auto',
'hidden'
]
}
}
};
}
changecss(args) {
// TODO: we MUST sanitize this
const color = args.COLOR;
if (args.COLORABLE == 'general text') {
generalTextColor = color;
} else if (args.COLORABLE == 'general background') {
generalbackgroundColor = color;
} else if (args.COLORABLE == 'variable value box') {
variableValueBoxColor = color;
} else if (args.COLORABLE == 'varibale value text') {
variableValueTextColor = color;
} else if (args.COLORABLE == 'list header') {
listHeaderColor = color;
} else if (args.COLORABLE == 'list footer') {
listFooterColor = color;
} else if (args.COLORABLE == 'list value box') {
listValueBoxColor = color;
} else if (args.COLORABLE == 'list value text') {
listValueTextColor = color;
} else if (args.COLORABLE == 'general border') {
generalBorderColor = color;
}
applyCSS();
}
gradientAngle(args) {
return 'linear-gradient(' + args.ANGLE + 'deg,' + args.COLOR1 + ',' + args.COLOR2 + ')';
}
setbordersize(args) {
borderSize = Scratch.Cast.toNumber(args.SIZE);
applyCSS();
}
setborderradius(args) {
const size = Scratch.Cast.toNumber(args.SIZE);
if (args.CORNER == 'general borders ') {
generalBorderRadius = size;
} else if (args.CORNER == 'variable value box borders') {
variableValueBoxCornerRadius = size;
} else if (args.CORNER == 'list value box borders') {
listValueBoxCornerRadius = size;
}
applyCSS();
}
allowscrollrule(args) {
allowScrolling = args.SCROLLRULE !== 'hidden';
applyCSS();
}
setvarpos(args, util) {
setVariableMonitorPosition(
util.target,
args.NAME,
'',
Scratch.Cast.toNumber(args.X) + Scratch.vm.runtime.stageWidth / 2,
Scratch.vm.runtime.stageHeight / 2 - Scratch.Cast.toNumber(args.Y)
);
}
setlistpos(args, util) {
setVariableMonitorPosition(
util.target,
args.NAME,
'list',
Scratch.Cast.toNumber(args.X) + Scratch.vm.runtime.stageWidth / 2,
Scratch.vm.runtime.stageHeight / 2 - Scratch.Cast.toNumber(args.Y)
);
}
help() {
alert("\nThis is a short introduction to how to use the CSS extension!\n\n๐๐ผ๐ผ๐ธ๐ ๐ฏ๐น๐ผ๐ฐ๐ธ๐\nThese blocks change the appearance of the variable and list didsplays. You can use the drop-down menu to select what component you want to modify. ๐๐๐ ๐๐ค๐ก๐ค๐ง ๐๐ก๐ค๐๐ modifieas the color of a component. You can use the ๐๐ง๐๐๐๐๐ฃ๐ฉ block inside the color input, to create gradients instead of solid colors. ๐๐๐ ๐๐ง๐๐๐๐๐ฃ๐ฉ ๐ค๐ฃ๐ก๐ฎ ๐ฌ๐ค๐ง๐ ๐จ ๐ค๐ฃ ๐๐๐ง๐ฉ๐๐๐ฃ ๐๐ค๐ข๐ฅ๐ค๐ฃ๐๐ฃ๐ฉ๐จ! You can also use the ๐ฉ๐ง๐๐ฃ๐จ๐ฅ๐๐ง๐๐ฃ๐ฉ ๐๐ก๐ค๐๐ as a color input, to make components invisible. The ๐๐ค๐ง๐๐๐ง ๐๐ก๐ค๐๐ ๐จ modify the borders of certain components.\n\n๐ฆ๐ฒ๐ป๐๐ถ๐ป๐ด ๐ฏ๐น๐ผ๐ฐ๐ธ๐\nThese blocks can change the behaviour of certain components. The ๐จ๐๐ง๐ค๐ก๐ก ๐ง๐ช๐ก๐ block change the behaviour for lists. On 'auto' they will show the scroll bar, and allow you to school, but on 'hidden', they won't let you do that, and the scroll bar will be hidden.\n\n๐ ๐ผ๐๐ถ๐ผ๐ป ๐ฏ๐น๐ผ๐ฐ๐ธ๐\nThese blocks allow you to move variable and list displays around. You need to use their ๐ก๐๐๐๐ก ๐ฃ๐๐ข๐. The label name is the text that displays on the display. For example, a public variable will be like 'my variable', and a 'for this sprite only variable' will be like 'Sprite1: my variable'.");
}
transparentinput() {
return 'transparent';
}
}
Scratch.extensions.register(new CustomCSS());
})(Scratch);