tgui-core 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/.editorconfig +10 -0
  2. package/.eslintrc.cjs +78 -0
  3. package/.gitattributes +4 -0
  4. package/.prettierrc.yml +1 -0
  5. package/.vscode/extensions.json +6 -0
  6. package/.vscode/settings.json +5 -0
  7. package/README.md +1 -0
  8. package/global.d.ts +173 -0
  9. package/package.json +25 -0
  10. package/src/assets.ts +43 -0
  11. package/src/backend.ts +369 -0
  12. package/src/common/collections.ts +349 -0
  13. package/src/common/color.ts +94 -0
  14. package/src/common/events.ts +45 -0
  15. package/src/common/exhaustive.ts +19 -0
  16. package/src/common/fp.ts +38 -0
  17. package/src/common/keycodes.ts +86 -0
  18. package/src/common/keys.ts +39 -0
  19. package/src/common/math.ts +98 -0
  20. package/src/common/perf.ts +72 -0
  21. package/src/common/random.ts +32 -0
  22. package/src/common/react.ts +65 -0
  23. package/src/common/redux.ts +196 -0
  24. package/src/common/storage.js +196 -0
  25. package/src/common/string.ts +173 -0
  26. package/src/common/timer.ts +68 -0
  27. package/src/common/type-utils.ts +41 -0
  28. package/src/common/types.ts +9 -0
  29. package/src/common/uuid.ts +24 -0
  30. package/src/common/vector.ts +51 -0
  31. package/src/components/AnimatedNumber.tsx +185 -0
  32. package/src/components/Autofocus.tsx +23 -0
  33. package/src/components/Blink.jsx +69 -0
  34. package/src/components/BlockQuote.tsx +15 -0
  35. package/src/components/BodyZoneSelector.tsx +149 -0
  36. package/src/components/Box.tsx +255 -0
  37. package/src/components/Button.tsx +415 -0
  38. package/src/components/ByondUi.jsx +121 -0
  39. package/src/components/Chart.tsx +160 -0
  40. package/src/components/Collapsible.tsx +45 -0
  41. package/src/components/ColorBox.tsx +30 -0
  42. package/src/components/Dialog.tsx +85 -0
  43. package/src/components/Dimmer.tsx +19 -0
  44. package/src/components/Divider.tsx +26 -0
  45. package/src/components/DmIcon.tsx +72 -0
  46. package/src/components/DraggableControl.jsx +282 -0
  47. package/src/components/Dropdown.tsx +246 -0
  48. package/src/components/FakeTerminal.jsx +52 -0
  49. package/src/components/FitText.tsx +99 -0
  50. package/src/components/Flex.tsx +105 -0
  51. package/src/components/Grid.tsx +44 -0
  52. package/src/components/Icon.tsx +91 -0
  53. package/src/components/Image.tsx +63 -0
  54. package/src/components/InfinitePlane.jsx +192 -0
  55. package/src/components/Input.tsx +181 -0
  56. package/src/components/KeyListener.tsx +40 -0
  57. package/src/components/Knob.tsx +185 -0
  58. package/src/components/LabeledControls.tsx +50 -0
  59. package/src/components/LabeledList.tsx +130 -0
  60. package/src/components/MenuBar.tsx +238 -0
  61. package/src/components/Modal.tsx +25 -0
  62. package/src/components/NoticeBox.tsx +48 -0
  63. package/src/components/NumberInput.tsx +328 -0
  64. package/src/components/Popper.tsx +100 -0
  65. package/src/components/ProgressBar.tsx +79 -0
  66. package/src/components/RestrictedInput.jsx +301 -0
  67. package/src/components/RoundGauge.tsx +189 -0
  68. package/src/components/Section.tsx +125 -0
  69. package/src/components/Slider.tsx +173 -0
  70. package/src/components/Stack.tsx +101 -0
  71. package/src/components/StyleableSection.tsx +30 -0
  72. package/src/components/Table.tsx +90 -0
  73. package/src/components/Tabs.tsx +90 -0
  74. package/src/components/TextArea.tsx +198 -0
  75. package/src/components/TimeDisplay.jsx +64 -0
  76. package/src/components/Tooltip.tsx +147 -0
  77. package/src/components/TrackOutsideClicks.tsx +35 -0
  78. package/src/components/VirtualList.tsx +69 -0
  79. package/src/constants.ts +355 -0
  80. package/src/debug/KitchenSink.jsx +56 -0
  81. package/src/debug/actions.js +11 -0
  82. package/src/debug/hooks.js +10 -0
  83. package/src/debug/index.ts +10 -0
  84. package/src/debug/middleware.js +86 -0
  85. package/src/debug/reducer.js +22 -0
  86. package/src/debug/selectors.js +7 -0
  87. package/src/drag.ts +280 -0
  88. package/src/events.ts +237 -0
  89. package/src/focus.ts +25 -0
  90. package/src/format.ts +173 -0
  91. package/src/hotkeys.ts +212 -0
  92. package/src/http.ts +16 -0
  93. package/src/layouts/Layout.tsx +75 -0
  94. package/src/layouts/NtosWindow.tsx +162 -0
  95. package/src/layouts/Pane.tsx +56 -0
  96. package/src/layouts/Window.tsx +227 -0
  97. package/src/renderer.ts +50 -0
  98. package/styles/base.scss +32 -0
  99. package/styles/colors.scss +92 -0
  100. package/styles/components/BlockQuote.scss +20 -0
  101. package/styles/components/Button.scss +175 -0
  102. package/styles/components/ColorBox.scss +12 -0
  103. package/styles/components/Dialog.scss +105 -0
  104. package/styles/components/Dimmer.scss +22 -0
  105. package/styles/components/Divider.scss +27 -0
  106. package/styles/components/Dropdown.scss +72 -0
  107. package/styles/components/Flex.scss +31 -0
  108. package/styles/components/Icon.scss +25 -0
  109. package/styles/components/Input.scss +68 -0
  110. package/styles/components/Knob.scss +131 -0
  111. package/styles/components/LabeledList.scss +49 -0
  112. package/styles/components/MenuBar.scss +75 -0
  113. package/styles/components/Modal.scss +14 -0
  114. package/styles/components/NoticeBox.scss +65 -0
  115. package/styles/components/NumberInput.scss +76 -0
  116. package/styles/components/ProgressBar.scss +63 -0
  117. package/styles/components/RoundGauge.scss +88 -0
  118. package/styles/components/Section.scss +143 -0
  119. package/styles/components/Slider.scss +54 -0
  120. package/styles/components/Stack.scss +59 -0
  121. package/styles/components/Table.scss +44 -0
  122. package/styles/components/Tabs.scss +144 -0
  123. package/styles/components/TextArea.scss +84 -0
  124. package/styles/components/Tooltip.scss +24 -0
  125. package/styles/functions.scss +79 -0
  126. package/styles/layouts/Layout.scss +57 -0
  127. package/styles/layouts/NtosHeader.scss +20 -0
  128. package/styles/layouts/NtosWindow.scss +26 -0
  129. package/styles/layouts/TitleBar.scss +111 -0
  130. package/styles/layouts/Window.scss +103 -0
  131. package/styles/main.scss +97 -0
  132. package/styles/reset.scss +68 -0
  133. package/styles/themes/abductor.scss +68 -0
  134. package/styles/themes/admin.scss +38 -0
  135. package/styles/themes/cardtable.scss +57 -0
  136. package/styles/themes/hackerman.scss +70 -0
  137. package/styles/themes/malfunction.scss +67 -0
  138. package/styles/themes/neutral.scss +50 -0
  139. package/styles/themes/ntOS95.scss +166 -0
  140. package/styles/themes/ntos.scss +44 -0
  141. package/styles/themes/ntos_cat.scss +148 -0
  142. package/styles/themes/ntos_darkmode.scss +44 -0
  143. package/styles/themes/ntos_lightmode.scss +67 -0
  144. package/styles/themes/ntos_spooky.scss +69 -0
  145. package/styles/themes/ntos_synth.scss +99 -0
  146. package/styles/themes/ntos_terminal.scss +112 -0
  147. package/styles/themes/paper.scss +184 -0
  148. package/styles/themes/retro.scss +72 -0
  149. package/styles/themes/spookyconsole.scss +73 -0
  150. package/styles/themes/syndicate.scss +67 -0
  151. package/styles/themes/wizard.scss +68 -0
  152. package/tsconfig.json +34 -0
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Copyright (c) 2020 Aleksej Komarov
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ @use 'sass:color';
7
+ @use 'sass:math';
8
+ @use '../base.scss';
9
+ @use '../colors.scss';
10
+
11
+ $color-default: color.scale(
12
+ colors.fg(colors.$primary),
13
+ $lightness: 75%
14
+ ) !default;
15
+ $text-color: rgba(255, 255, 255, 0.5) !default;
16
+ $text-color-selected: color.scale($color-default, $lightness: 25%) !default;
17
+ $tab-color: transparent !default;
18
+ $tab-color-hovered: rgba(255, 255, 255, 0.075) !default;
19
+ $tab-color-selected: rgba(255, 255, 255, 0.125) !default;
20
+ $border-radius: base.$border-radius !default;
21
+ $fg-map: colors.$fg-map !default;
22
+
23
+ .Tabs {
24
+ display: flex;
25
+ align-items: stretch;
26
+ overflow: hidden;
27
+ background-color: base.$color-bg-section;
28
+ }
29
+
30
+ .Tabs--fill {
31
+ height: 100%;
32
+ }
33
+
34
+ // Interoperability with sections
35
+ .Section .Tabs {
36
+ background-color: transparent;
37
+ }
38
+
39
+ .Section:not(.Section--fitted) .Tabs {
40
+ margin: 0 -0.5em 0.5em;
41
+
42
+ &:first-child {
43
+ margin-top: -0.5em;
44
+ }
45
+ }
46
+
47
+ .Tabs--vertical {
48
+ flex-direction: column;
49
+ padding: 0.25em 0 0.25em 0.25em;
50
+ }
51
+
52
+ .Tabs--horizontal {
53
+ margin-bottom: 0.5em;
54
+ padding: 0.25em 0.25em 0 0.25em;
55
+
56
+ &:last-child {
57
+ margin-bottom: 0;
58
+ }
59
+ }
60
+
61
+ .Tabs__Tab {
62
+ flex-grow: 0;
63
+ }
64
+
65
+ .Tabs--fluid .Tabs__Tab {
66
+ flex-grow: 1;
67
+ }
68
+
69
+ .Tab {
70
+ display: flex;
71
+ align-items: center;
72
+ justify-content: space-between;
73
+ background-color: $tab-color;
74
+ color: $text-color;
75
+ min-height: 2.25em;
76
+ min-width: 4em;
77
+ }
78
+
79
+ .Tab:not(.Tab--selected):hover {
80
+ background-color: $tab-color-hovered;
81
+ }
82
+
83
+ .Tab--selected {
84
+ background-color: $tab-color-selected;
85
+ color: $text-color-selected;
86
+ }
87
+
88
+ .Tab__text {
89
+ flex-grow: 1;
90
+ margin: 0 0.5em;
91
+ }
92
+
93
+ .Tab__left {
94
+ min-width: 1.5em;
95
+ text-align: center;
96
+ margin-left: 0.25em;
97
+ }
98
+
99
+ .Tab__right {
100
+ min-width: 1.5em;
101
+ text-align: center;
102
+ margin-right: 0.25em;
103
+ }
104
+
105
+ .Tabs--horizontal {
106
+ .Tab {
107
+ border-top: math.div(1em, 6) solid transparent;
108
+ border-bottom: math.div(1em, 6) solid transparent;
109
+ border-top-left-radius: 0.25em;
110
+ border-top-right-radius: 0.25em;
111
+ }
112
+
113
+ .Tab--selected {
114
+ border-bottom: math.div(1em, 6) solid $color-default;
115
+ }
116
+ }
117
+
118
+ .Tabs--vertical {
119
+ .Tab {
120
+ min-height: 2em;
121
+ border-left: math.div(1em, 6) solid transparent;
122
+ border-right: math.div(1em, 6) solid transparent;
123
+ border-top-left-radius: 0.25em;
124
+ border-bottom-left-radius: 0.25em;
125
+ }
126
+
127
+ .Tab--selected {
128
+ border-right: math.div(1em, 6) solid $color-default;
129
+ }
130
+ }
131
+
132
+ @each $color-name, $color-value in $fg-map {
133
+ .Tab--selected.Tab--color--#{$color-name} {
134
+ color: color.scale($color-value, $lightness: 25%);
135
+ }
136
+
137
+ .Tabs--horizontal .Tab--selected.Tab--color--#{$color-name} {
138
+ border-bottom-color: $color-value;
139
+ }
140
+
141
+ .Tabs--vertical .Tab--selected.Tab--color--#{$color-name} {
142
+ border-right-color: $color-value;
143
+ }
144
+ }
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Copyright (c) 2020 Aleksej Komarov
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ @use '../base.scss';
7
+ @use '../functions.scss' as *;
8
+ @use './Input.scss';
9
+
10
+ $text-color: Input.$text-color !default;
11
+ $background-color: Input.$background-color !default;
12
+ $border-color: Input.$border-color !default;
13
+ $border-radius: Input.$border-radius !default;
14
+
15
+ .TextArea {
16
+ position: relative;
17
+ display: inline-block;
18
+ border: base.em(1px) solid $border-color;
19
+ border: base.em(1px) solid rgba($border-color, 0.75);
20
+ border-radius: $border-radius;
21
+ background-color: $background-color;
22
+ margin-right: base.em(2px);
23
+ line-height: base.em(17px);
24
+ box-sizing: border-box;
25
+ width: 100%;
26
+ }
27
+
28
+ .TextArea--fluid {
29
+ display: block;
30
+ width: auto;
31
+ height: auto;
32
+ }
33
+
34
+ .TextArea--noborder {
35
+ border: 0px;
36
+ }
37
+
38
+ .TextArea__textarea.TextArea__textarea--scrollable {
39
+ overflow: auto;
40
+ overflow-x: hidden;
41
+ overflow-y: scroll;
42
+ }
43
+
44
+ .TextArea__textarea {
45
+ display: block;
46
+ position: absolute;
47
+ top: 0;
48
+ bottom: 0;
49
+ left: 0;
50
+ right: 0;
51
+ border: 0;
52
+ outline: 0;
53
+ width: 100%;
54
+ height: 100%;
55
+ font-size: 1em;
56
+ line-height: base.em(17px);
57
+ min-height: base.em(17px);
58
+ margin: 0;
59
+ padding: 0 0.5em;
60
+ font-family: inherit;
61
+ background-color: transparent;
62
+ color: inherit;
63
+ box-sizing: border-box;
64
+ // Make sure the div and the textarea wrap words in the same way
65
+ word-wrap: break-word;
66
+ overflow: hidden;
67
+
68
+ &:-ms-input-placeholder {
69
+ font-style: italic;
70
+ color: #777;
71
+ color: rgba(255, 255, 255, 0.45);
72
+ }
73
+ }
74
+
75
+ .TextArea__textarea_custom {
76
+ overflow: visible;
77
+ white-space: pre-wrap;
78
+ }
79
+
80
+ .TextArea__nowrap {
81
+ white-space: nowrap;
82
+ overflow-wrap: normal;
83
+ overflow-x: scroll;
84
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright (c) 2020 Aleksej Komarov
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ @use '../base.scss';
7
+ @use '../functions.scss' as *;
8
+
9
+ $color: #ffffff !default;
10
+ $background-color: #000000 !default;
11
+ $border-radius: base.$border-radius !default;
12
+
13
+ .Tooltip {
14
+ z-index: 2;
15
+ padding: 0.5em 0.75em;
16
+ pointer-events: none;
17
+ text-align: left;
18
+ transition: opacity 150ms ease-out;
19
+ background-color: $background-color;
20
+ color: $color;
21
+ box-shadow: 0.1em 0.1em 1.25em -0.1em rgba(0, 0, 0, 0.5);
22
+ border-radius: $border-radius;
23
+ max-width: base.em(250px);
24
+ }
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Copyright (c) 2020 Aleksej Komarov
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ @use "sass:color";
7
+ @use "sass:map";
8
+ @use "sass:math";
9
+ @use "sass:meta";
10
+
11
+ // Type-casting
12
+ // --------------------------------------------------------
13
+
14
+ // Get a unit-less numeric value
15
+ @function num($value) {
16
+ @if meta.type-of($value) != number {
17
+ @error 'Could not convert `#{$value}` - must be `type-of number`';
18
+ @return null;
19
+ }
20
+ @if math.unit($value) == "%" {
21
+ @return math.div($value, 100%);
22
+ }
23
+ @return math.div($value, $value * 0 + 1);
24
+ }
25
+
26
+ // Color
27
+ // --------------------------------------------------------
28
+
29
+ // Increases perceptual color lightness.
30
+ @function lighten($color, $percent) {
31
+ $scaled: hsl(
32
+ color.hue($color),
33
+ color.saturation($color),
34
+ color.lightness($color) * (1 + num($percent))
35
+ );
36
+ $mixed: color.mix(#ffffff, $color, 100% * num($percent));
37
+ @return color.mix($scaled, $mixed, 75%);
38
+ }
39
+
40
+ // Returns the NTSC luminance of `$color` as a float (between 0 and 1).
41
+ // 1 is pure white, 0 is pure black.
42
+ @function luminance($color) {
43
+ $colors: (
44
+ "red": color.red($color),
45
+ "green": color.green($color),
46
+ "blue": color.blue($color),
47
+ );
48
+
49
+ @each $name, $value in $colors {
50
+ $adjusted: 0;
51
+ $value: math.div($value, 255);
52
+ @if $value < 0.03928 {
53
+ $value: math.div($value, 12.92);
54
+ } @else {
55
+ $value: math.div($value + 0.055, 1.055);
56
+ $value: math.pow($value, 2.4);
57
+ }
58
+
59
+ $colors: map.merge(
60
+ $colors,
61
+ (
62
+ $name: $value,
63
+ )
64
+ );
65
+ }
66
+
67
+ @return (map.get($colors, "red") * 0.2126) +
68
+ (map.get($colors, "green") * 0.7152) + (map.get($colors, "blue") * 0.0722);
69
+ }
70
+
71
+ // Blends an RGBA color with a static background color based on its
72
+ // alpha channel. Returns an RGB color, which is compatible with IE8.
73
+ @function fake-alpha($color-rgba, $color-background) {
74
+ @return color.mix(
75
+ color.change($color-rgba, $alpha: 1),
76
+ $color-background,
77
+ color.alpha($color-rgba) * 100%
78
+ );
79
+ }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Copyright (c) 2020 Aleksej Komarov
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ @use 'sass:color';
7
+ @use '../base.scss';
8
+
9
+ $scrollbar-color-multiplier: 1 !default;
10
+
11
+ .Layout,
12
+ .Layout * {
13
+ // Fancy scrollbar
14
+ scrollbar-base-color: color.scale(
15
+ base.$color-bg,
16
+ $lightness: -25% * $scrollbar-color-multiplier
17
+ );
18
+ scrollbar-face-color: color.scale(
19
+ base.$color-bg,
20
+ $lightness: 10% * $scrollbar-color-multiplier
21
+ );
22
+ scrollbar-3dlight-color: color.scale(
23
+ base.$color-bg,
24
+ $lightness: 0% * $scrollbar-color-multiplier
25
+ );
26
+ scrollbar-highlight-color: color.scale(
27
+ base.$color-bg,
28
+ $lightness: 0% * $scrollbar-color-multiplier
29
+ );
30
+ scrollbar-track-color: color.scale(
31
+ base.$color-bg,
32
+ $lightness: -25% * $scrollbar-color-multiplier
33
+ );
34
+ scrollbar-arrow-color: color.scale(
35
+ base.$color-bg,
36
+ $lightness: 50% * $scrollbar-color-multiplier
37
+ );
38
+ scrollbar-shadow-color: color.scale(
39
+ base.$color-bg,
40
+ $lightness: 10% * $scrollbar-color-multiplier
41
+ );
42
+ }
43
+
44
+ .Layout__content {
45
+ position: absolute;
46
+ top: 0;
47
+ bottom: 0;
48
+ left: 0;
49
+ right: 0;
50
+ overflow-x: hidden;
51
+ overflow-y: hidden;
52
+ }
53
+
54
+ .Layout__content--scrollable {
55
+ overflow-y: scroll;
56
+ margin-bottom: 0;
57
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) 2020 Aleksej Komarov
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ .NtosHeader__left {
7
+ position: absolute;
8
+ left: 1em;
9
+ }
10
+
11
+ .NtosHeader__right {
12
+ position: absolute;
13
+ right: 1em;
14
+ }
15
+
16
+ .NtosHeader__icon {
17
+ margin-top: -0.75em;
18
+ margin-bottom: -0.5em;
19
+ vertical-align: middle;
20
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright (c) 2020 Aleksej Komarov
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ @use '../base.scss';
7
+
8
+ .NtosWindow__header {
9
+ position: absolute;
10
+ top: 0;
11
+ left: 0;
12
+ right: 0;
13
+ height: 2em;
14
+ line-height: 1.928em;
15
+ background-color: rgba(0, 0, 0, 0.5);
16
+ font-family: Consolas, monospace;
17
+ font-size: base.em(14px);
18
+ user-select: none;
19
+ -ms-user-select: none;
20
+ }
21
+
22
+ .NtosWindow__content .Layout__content {
23
+ margin-top: 2em;
24
+ font-family: Consolas, monospace;
25
+ font-size: base.em(14px);
26
+ }
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Copyright (c) 2020 Aleksej Komarov
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ @use 'sass:color';
7
+ @use '../base.scss';
8
+ @use '../colors.scss';
9
+
10
+ $text-color: rgba(255, 255, 255, 0.75) !default;
11
+ $background-color: #363636 !default;
12
+ $shadow-color-core: #161616 !default;
13
+ $shadow-color: rgba(0, 0, 0, 0.1) !default;
14
+
15
+ .TitleBar {
16
+ background-color: $background-color;
17
+ border-bottom: 1px solid $shadow-color-core;
18
+ box-shadow: 0 2px 2px $shadow-color;
19
+ box-shadow: 0 base.rem(2px) base.rem(2px) $shadow-color;
20
+ user-select: none;
21
+ -ms-user-select: none;
22
+ }
23
+
24
+ .TitleBar__clickable {
25
+ color: color.change($text-color, $alpha: 0.5);
26
+ background-color: $background-color;
27
+ transition:
28
+ color 250ms ease-out,
29
+ background-color 250ms ease-out;
30
+
31
+ &:hover {
32
+ color: rgba(255, 255, 255, 1);
33
+ background-color: #cc0000;
34
+ transition:
35
+ color 0ms,
36
+ background-color 0ms;
37
+ }
38
+ }
39
+
40
+ .TitleBar__title {
41
+ position: absolute;
42
+ display: inline-block;
43
+ top: 0;
44
+ left: 46px;
45
+ left: base.rem(46px);
46
+ color: $text-color;
47
+ font-size: 14px;
48
+ font-size: base.rem(14px);
49
+ line-height: 31px;
50
+ line-height: base.rem(31px);
51
+ white-space: nowrap;
52
+ pointer-events: none;
53
+ }
54
+
55
+ .TitleBar__buttons {
56
+ pointer-events: initial;
57
+ display: inline-block;
58
+ width: 100%;
59
+ margin-left: 10px;
60
+ }
61
+
62
+ .TitleBar__dragZone {
63
+ position: absolute;
64
+ top: 0;
65
+ left: 0;
66
+ right: 0;
67
+ height: 32px;
68
+ height: base.rem(32px);
69
+ }
70
+
71
+ .TitleBar__statusIcon {
72
+ position: absolute;
73
+ top: 0;
74
+ left: 12px;
75
+ left: base.rem(12px);
76
+ transition: color 0.5s;
77
+ font-size: 20px;
78
+ font-size: base.rem(20px);
79
+ line-height: 32px !important;
80
+ line-height: base.rem(32px) !important;
81
+ }
82
+
83
+ .TitleBar__close {
84
+ position: absolute;
85
+ top: -1px;
86
+ right: 0;
87
+ width: 45px;
88
+ width: base.rem(45px);
89
+ height: 32px;
90
+ height: base.rem(32px);
91
+ font-size: 20px;
92
+ font-size: base.rem(20px);
93
+ line-height: 31px;
94
+ line-height: base.rem(31px);
95
+ text-align: center;
96
+ }
97
+
98
+ .TitleBar__devBuildIndicator {
99
+ position: absolute;
100
+ top: 6px;
101
+ top: base.rem(6px);
102
+ right: 52px;
103
+ right: base.rem(52px);
104
+ min-width: 20px;
105
+ min-width: base.rem(20px);
106
+ padding: 2px 4px;
107
+ padding: base.rem(2px) base.rem(4px);
108
+ background-color: rgba(colors.$good, 0.75);
109
+ color: #fff;
110
+ text-align: center;
111
+ }
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Copyright (c) 2020 Aleksej Komarov
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ @use 'sass:color';
7
+ @use '../base.scss';
8
+ @use '../functions.scss' as *;
9
+
10
+ .Window {
11
+ position: fixed;
12
+ top: 0;
13
+ bottom: 0;
14
+ left: 0;
15
+ right: 0;
16
+ color: base.$color-fg;
17
+ background-color: base.$color-bg;
18
+ background-image: linear-gradient(
19
+ to bottom,
20
+ base.$color-bg-start 0%,
21
+ base.$color-bg-end 100%
22
+ );
23
+ }
24
+
25
+ .Window__titleBar {
26
+ position: fixed;
27
+ z-index: 1;
28
+ top: 0;
29
+ left: 0;
30
+ width: 100%;
31
+ height: 32px;
32
+ height: base.rem(32px);
33
+ }
34
+
35
+ // Everything after the title bar
36
+ .Window__rest {
37
+ position: fixed;
38
+ top: 32px;
39
+ top: base.rem(32px);
40
+ bottom: 0;
41
+ left: 0;
42
+ right: 0;
43
+ }
44
+
45
+ .Window__contentPadding {
46
+ margin: 0.5rem;
47
+ // IE8: Calc not supported
48
+ height: 100%;
49
+ // 0.01 is needed to make the scrollbar not appear
50
+ // due to rem rendering inaccuracies in IE11.
51
+ height: calc(100% - 1.01rem);
52
+ }
53
+
54
+ .Window__contentPadding:after {
55
+ height: 0;
56
+ }
57
+
58
+ .Layout__content--scrollable .Window__contentPadding:after {
59
+ display: block;
60
+ content: '';
61
+ height: 0.5rem;
62
+ }
63
+
64
+ .Window__dimmer {
65
+ position: fixed;
66
+ top: 0;
67
+ bottom: 0;
68
+ left: 0;
69
+ right: 0;
70
+ background-color: rgba(lighten(base.$color-bg, 30%), 0.25);
71
+ pointer-events: none;
72
+ }
73
+
74
+ .Window__resizeHandle__se {
75
+ position: fixed;
76
+ bottom: 0;
77
+ right: 0;
78
+ width: 20px;
79
+ width: base.rem(20px);
80
+ height: 20px;
81
+ height: base.rem(20px);
82
+ cursor: se-resize;
83
+ }
84
+
85
+ .Window__resizeHandle__s {
86
+ position: fixed;
87
+ bottom: 0;
88
+ left: 0;
89
+ right: 0;
90
+ height: 6px;
91
+ height: base.rem(6px);
92
+ cursor: s-resize;
93
+ }
94
+
95
+ .Window__resizeHandle__e {
96
+ position: fixed;
97
+ top: 0;
98
+ bottom: 0;
99
+ right: 0;
100
+ width: 3px;
101
+ width: base.rem(3px);
102
+ cursor: e-resize;
103
+ }