File size: 7,996 Bytes
6bcb42f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@import "../../css/units.css";
@import "../../css/colors.css";
@import "../../css/z-index.css";

.page-wrapper {
    height: 100%;
}

.body-wrapper {
    height: calc(100% - $menu-bar-height);
    background-color: $ui-primary;
}
.body-wrapper-playground {
    height: 100%;
}

.body-wrapper * {
    box-sizing: border-box;
}

.flex-wrapper {
    display: flex;

    /*
        Make 2 columns:
        a) for the blocks + workspace panes, and
        b) for combined stage menu + stage + sprite/stage selectors
    */
    flex-direction: row;
    height: 100%;

    /*
        Stop scrollbar popping in and out from scratch-blocks border issue
        https://github.com/LLK/scratch-gui/issues/318
    */
    overflow: hidden;
}

.editor-wrapper {
    /*
        This is carefully balanced--  the minimum width at which the GUI will be displayed is 1024px.
        At that size, the stage pane is 408px wide, with $space of padding to each side.
        However, we must also add the border width to the stage pane. All-in-all, the stage pane's final width is
        408px + ($space + $stage-standard-border-width * 2) (one border & padding per left/right side).

        @todo This is in place to prevent "doubling up" of horizontal scrollbars in narrow windows, but there are likely
        much better ways to solve that (e.g. undo #2124, remove this flex-basis entirely). However, they run their own
        risks of breaking things, so let's just leave this as-is for the time being.
    */
    flex-basis: calc(1024px - 408px - (($space + $stage-standard-border-width) * 2));
    flex-grow: 1;
    flex-shrink: 0;
    position: relative;

    display: flex;
    flex-direction: column;
}

.tab-list {
    height: $stage-menu-height;
    width: 250px; /* Match width of the toolbox */
    display: flex;
    align-items: flex-end;
    flex-shrink: 0;

    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 500;
    font-size: 0.80rem;

    /* Overrides for react-tabs styling */
    margin: 0 !important;
    border-bottom: 0 !important;
}

.tab {
    flex-grow: 1;
    height: 80%;
    margin-bottom: 0;

    border-radius: 1rem 1rem 0 0;
    border: 1px solid $ui-black-transparent;

    padding: 0.125rem 1.25rem 0;
    font-size: 0.75rem;

    background-color: $ui-tertiary;
    color: $text-primary-transparent;

    display: flex;
    justify-content: center;
    align-items: center;

    user-select: none;
    white-space: nowrap;
}
[theme="dark"] .tab {
    color: $text-primary;
}
.tab > div {
    display: flex;
    justify-content: center;
    align-items: center;
}
.tab-disabled {
    display: none;
}

.add-tab-button {
    margin: 8px 0;
    margin-left: 4px;
    padding: 4px;
    font-size: larger;

    background: white;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 4px;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    transform: translateY(6px);
}
[dir="rtl"] .add-tab-button {
    margin-left: initial;
    margin-right: 4px;
}
[theme="dark"] .add-tab-button {
    background: none;
    border-color: rgba(255,255,255,.15);
}
[theme="dark"] .add-tab-button img {
    filter: invert(1);
}
.add-tab-button-disabled {
    cursor: not-allowed;
    opacity: 0.5;
}
.tab-addition-item {
    display: flex;
    align-items: center;
}
.tab-addition-item img {
    width: 1.375rem;
}

[dir="ltr"] .tab {
    margin-left: -0.5rem;
}

[dir="rtl"] .tab {
    margin-right: -0.5rem;
}

[dir="ltr"] .tab:nth-of-type(1) {
    margin-left: 0;
}

[dir="rtl"] .tab:nth-of-type(1) {
    margin-right: 0;
}

/* Use z-indices to force left-on-top for tabs */
.tab:nth-of-type(1) {
    z-index: 3;
}
.tab:nth-of-type(2) {
    z-index: 2;
}
.tab:nth-of-type(3) {
    z-index: 1;
}

.tab:hover {
  background-color: $ui-primary;
}
[theme="dark"] .tab:hover {
    background-color: $ui-secondary;
}

.tab.is-selected {
    height: 90%;
    color: $motion-primary;
    background-color: $ui-white;
    z-index: 4; /* Make sure selected is always above */
}
[theme="dark"] .tab.is-selected {
    background-color: $ui-secondary;
}

.tab img {
    width: 1.375rem;
    filter: grayscale(100%);
}

[dir="ltr"] .tab img {
    margin-right: 0.125rem;
}

[dir="rtl"] .tab img {
    margin-left: 0.125rem;
}

/* mirror blocks and sound tab icons */
[dir="rtl"] .tab:nth-of-type(1) img {
    transform: scaleX(-1);
}

[dir="rtl"] .tab:nth-of-type(3) img {
    transform: scaleX(-1);
}

.tab.is-selected img {
    filter: none;
}

/* Tab style overrides from react-tabs */
.tab.is-selected:after {
    display: none;
}

.tab.is-selected:focus {
    outline: none;
    box-shadow: none;
    border-color: $ui-black-transparent;
}

.tab.is-selected:focus:after {
    display: none;
}

/* Body of the tabs */
.tabs {
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.tab-panel {
    position: relative;
    flex-grow: 1;
    display: none;
}

.tab-panel.is-selected {
    display: flex;
}

.blocks-wrapper {
    flex-grow: 1;
    position: relative;
}

.stage-and-target-wrapper {
    /*
        Makes rows for children:
          1) stage menu
          2) stage
          3) sprite/stage selectors
        Only reason we need this, is so .targetWrapper, which holds the selectors,
        goes to full vertical height of the window
    */
    display: flex;
    flex-direction: column;
    /* pad entire wrapper to the left and right; allow children to fill width */
    padding-left: $space;
    padding-right: $space;

    /* this will only ever be as wide as the stage */
    flex-basis: 0;
}

.target-wrapper {
    display: flex;
    flex-grow: 1;
    flex-basis: 0;

    padding-top: $space;
    min-height: 0; /* this makes it work in Firefox */

    /*
        For making the sprite-selector a scrollable pane
        @todo: Not working in Safari
    */
    /* TODO this also breaks the thermometer menu */
    /* overflow: hidden; */
}

.extension-button-container {
    width: 3.75rem;
    height: 3.25rem;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: $z-index-extension-button;
    background: $motion-primary;

    border: 1px solid $motion-primary;
    box-sizing: content-box; /* To match scratch-block vertical toolbox borders */
}

$fade-out-distance: 15px;

.extension-button-container:before {
    content: "";
    position: absolute;
    top: calc(calc(-1 * $fade-out-distance) - 1px);
    left: -1px;
    background: linear-gradient(rgba(0, 0, 0, 0),rgba(0, 0, 0, 0.15));
    height: $fade-out-distance;
    width: calc(100% + 0.5px);
}


.extension-button {
    background: none;
    border: none;
    outline: none;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.extension-button-icon {
    width: 1.75rem;
    height: 1.75rem;
}

[dir="rtl"] .extension-button-icon {
    transform: scaleX(-1);
}

.extension-button > div {
    margin-top: 0;
}

/* Sprite Selection Watermark */
.watermark {
    position: absolute;
    top: 1.25rem;
    pointer-events: none;
}

[dir="ltr"] .watermark {
    right: 1.25rem;
}

[dir="rtl"] .watermark {
    left: 1.25rem;
}

/* Menu */

.menu-bar-position {
    position: relative;
    z-index: $z-index-menu-bar;
}
/* Alerts */

.alerts-container {
    display: flex;
    justify-content: center;
    width: 100%;
    z-index: $z-index-alerts;
    position: absolute;
    margin-top: 53px;
    pointer-events: none;
}

/*
    Make the (background) page not scrollable when modals are open
    This CSS class is automatically added to the body when react-modal is open
*/
:global(.ReactModal__Body--open) {
    overflow: hidden;
}

/* tw: tw: when window is fullscreen, put a solid white background behind the stage */
.fullscreen-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* if the user-specified background color can't be understood by the browser, default to white */
    background-color: white;
}