fragment-tools 0.1.13 → 0.1.15

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 (184) hide show
  1. package/.prettierignore +1 -2
  2. package/.prettierrc +23 -7
  3. package/README.md +28 -9
  4. package/bin/index.js +70 -10
  5. package/package.json +14 -6
  6. package/src/cli/build.js +125 -0
  7. package/src/cli/create.js +238 -0
  8. package/src/cli/createConfig.js +82 -0
  9. package/src/cli/createFragmentFile.js +70 -0
  10. package/src/cli/getEntries.js +85 -0
  11. package/src/cli/log.js +36 -24
  12. package/src/cli/plugins/check-dependencies.js +88 -42
  13. package/src/cli/plugins/hot-shader-replacement.js +408 -0
  14. package/src/cli/plugins/hot-sketch-reload.js +21 -25
  15. package/src/cli/plugins/save.js +101 -0
  16. package/src/cli/preview.js +55 -0
  17. package/src/cli/prompts.js +260 -0
  18. package/src/cli/run.js +131 -0
  19. package/src/cli/templates/blank/index.js +33 -0
  20. package/src/cli/templates/blank/meta.json +4 -0
  21. package/src/cli/templates/default/index.js +39 -0
  22. package/src/cli/templates/default/meta.json +5 -0
  23. package/src/cli/templates/fragment-gl/index.js +37 -0
  24. package/src/cli/templates/fragment-gl/meta.json +4 -0
  25. package/src/cli/templates/p5/index.js +32 -0
  26. package/src/cli/templates/p5/meta.json +5 -0
  27. package/src/cli/templates/p5-webgl/fragment.fs +14 -0
  28. package/src/cli/templates/p5-webgl/index.js +67 -0
  29. package/src/cli/templates/p5-webgl/meta.json +5 -0
  30. package/src/cli/templates/three-fragment/fragment.fs +10 -0
  31. package/src/cli/templates/three-fragment/index.js +95 -0
  32. package/src/cli/templates/three-fragment/meta.json +5 -0
  33. package/src/cli/templates/three-orthographic/index.js +55 -0
  34. package/src/cli/templates/three-orthographic/meta.json +5 -0
  35. package/src/cli/templates/three-perspective/index.js +52 -0
  36. package/src/cli/templates/three-perspective/meta.json +5 -0
  37. package/src/cli/utils.js +70 -0
  38. package/src/cli/ws.js +87 -78
  39. package/src/client/app/App.svelte +3 -3
  40. package/src/client/app/client.js +55 -39
  41. package/src/client/app/components/IconCross.svelte +18 -18
  42. package/src/client/app/components/Init.svelte +40 -8
  43. package/src/client/app/components/KeyBinding.svelte +22 -22
  44. package/src/client/app/helpers.js +42 -0
  45. package/src/client/app/hooks.js +20 -0
  46. package/src/client/app/inputs/Input.js +9 -9
  47. package/src/client/app/inputs/Keyboard.js +13 -15
  48. package/src/client/app/inputs/MIDI.js +14 -15
  49. package/src/client/app/inputs/Mouse.js +1 -1
  50. package/src/client/app/inputs/Webcam.js +89 -88
  51. package/src/client/app/lib/canvas-recorder/CanvasRecorder.js +41 -21
  52. package/src/client/app/lib/canvas-recorder/FrameRecorder.js +7 -6
  53. package/src/client/app/lib/canvas-recorder/H264Recorder.js +45 -0
  54. package/src/client/app/lib/canvas-recorder/MP4Recorder.js +7 -9
  55. package/src/client/app/lib/canvas-recorder/WebMRecorder.js +3 -4
  56. package/src/client/app/lib/canvas-recorder/mp4.js +1649 -15
  57. package/src/client/app/lib/canvas-recorder/utils.js +33 -17
  58. package/src/client/app/lib/gl/Geometry.js +11 -8
  59. package/src/client/app/lib/gl/Program.js +38 -19
  60. package/src/client/app/lib/gl/Renderer.js +163 -156
  61. package/src/client/app/lib/gl/Texture.js +113 -85
  62. package/src/client/app/lib/gl/index.js +12 -12
  63. package/src/client/app/lib/gl/utils.js +1 -3
  64. package/src/client/app/lib/helpers/frameDebounce.js +30 -30
  65. package/src/client/app/lib/loader/index.js +10 -10
  66. package/src/client/app/lib/loader/loadImage.js +15 -15
  67. package/src/client/app/lib/loader/loadScript.js +1 -1
  68. package/src/client/app/lib/paper-sizes.js +75 -76
  69. package/src/client/app/lib/presets.js +25 -5
  70. package/src/client/app/lib/tempo/Analyser.js +18 -17
  71. package/src/client/app/lib/tempo/Range.js +15 -12
  72. package/src/client/app/lib/tempo/index.js +34 -27
  73. package/src/client/app/modules/AudioAnalyser/Range.svelte +69 -72
  74. package/src/client/app/modules/AudioAnalyser/Spectrum.svelte +20 -19
  75. package/src/client/app/modules/AudioAnalyser.svelte +52 -35
  76. package/src/client/app/modules/Console/ConsoleLine.svelte +193 -172
  77. package/src/client/app/modules/Console.svelte +76 -74
  78. package/src/client/app/modules/Exports.svelte +62 -43
  79. package/src/client/app/modules/MidiPanel.svelte +100 -101
  80. package/src/client/app/modules/Monitor.svelte +57 -57
  81. package/src/client/app/modules/Params.svelte +128 -103
  82. package/src/client/app/renderers/2DRenderer.js +3 -3
  83. package/src/client/app/renderers/FragmentRenderer.js +30 -23
  84. package/src/client/app/renderers/P5GLRenderer.js +144 -0
  85. package/src/client/app/renderers/P5Renderer.js +10 -7
  86. package/src/client/app/renderers/THREERenderer.js +136 -94
  87. package/src/client/app/stores/audioAnalysis.js +3 -4
  88. package/src/client/app/stores/console.js +9 -10
  89. package/src/client/app/stores/errors.js +1 -1
  90. package/src/client/app/stores/exports.js +36 -20
  91. package/src/client/app/stores/index.js +2 -2
  92. package/src/client/app/stores/layout.js +143 -138
  93. package/src/client/app/stores/multisampling.js +4 -4
  94. package/src/client/app/stores/props.js +76 -13
  95. package/src/client/app/stores/renderers.js +26 -15
  96. package/src/client/app/stores/rendering.js +108 -89
  97. package/src/client/app/stores/sketches.js +7 -9
  98. package/src/client/app/stores/time.js +18 -18
  99. package/src/client/app/stores/utils.js +95 -38
  100. package/src/client/app/transitions/fade.js +3 -3
  101. package/src/client/app/transitions/index.js +6 -7
  102. package/src/client/app/transitions/splitX.js +2 -2
  103. package/src/client/app/transitions/splitY.js +2 -2
  104. package/src/client/app/triggers/Keyboard.js +88 -79
  105. package/src/client/app/triggers/MIDI.js +110 -84
  106. package/src/client/app/triggers/Mouse.js +73 -65
  107. package/src/client/app/triggers/Trigger.js +59 -58
  108. package/src/client/app/triggers/index.js +7 -7
  109. package/src/client/app/triggers/shared.js +5 -5
  110. package/src/client/app/ui/Build.svelte +70 -71
  111. package/src/client/app/ui/ErrorOverlay.svelte +118 -104
  112. package/src/client/app/ui/Field.svelte +393 -258
  113. package/src/client/app/ui/FieldGroup.svelte +106 -94
  114. package/src/client/app/ui/FieldSection.svelte +127 -116
  115. package/src/client/app/ui/FieldSpace.svelte +29 -30
  116. package/src/client/app/ui/FieldTrigger.svelte +256 -244
  117. package/src/client/app/ui/FieldTriggers.svelte +46 -46
  118. package/src/client/app/ui/FloatingParams.svelte +29 -30
  119. package/src/client/app/ui/Layout.svelte +31 -32
  120. package/src/client/app/ui/LayoutColumn.svelte +4 -4
  121. package/src/client/app/ui/LayoutComponent.svelte +239 -225
  122. package/src/client/app/ui/LayoutResizer.svelte +195 -176
  123. package/src/client/app/ui/LayoutRoot.svelte +6 -6
  124. package/src/client/app/ui/LayoutRow.svelte +4 -4
  125. package/src/client/app/ui/LayoutToolbar.svelte +191 -194
  126. package/src/client/app/ui/Module.svelte +134 -135
  127. package/src/client/app/ui/ModuleHeaderAction.svelte +81 -78
  128. package/src/client/app/ui/ModuleHeaderButton.svelte +12 -12
  129. package/src/client/app/ui/ModuleHeaderSelect.svelte +47 -37
  130. package/src/client/app/ui/ModuleRenderer.svelte +26 -27
  131. package/src/client/app/ui/OutputRenderer.svelte +112 -105
  132. package/src/client/app/ui/ParamsMultisampling.svelte +96 -95
  133. package/src/client/app/ui/ParamsOutput.svelte +130 -113
  134. package/src/client/app/ui/Preview.svelte +7 -8
  135. package/src/client/app/ui/SelectChevrons.svelte +27 -15
  136. package/src/client/app/ui/SketchRenderer.svelte +780 -667
  137. package/src/client/app/ui/SketchSelect.svelte +50 -44
  138. package/src/client/app/ui/fields/ButtonInput.svelte +61 -48
  139. package/src/client/app/ui/fields/CheckboxInput.svelte +67 -61
  140. package/src/client/app/ui/fields/ColorInput.svelte +294 -238
  141. package/src/client/app/ui/fields/FieldInputRow.svelte +8 -8
  142. package/src/client/app/ui/fields/ImageInput.svelte +123 -121
  143. package/src/client/app/ui/fields/Input.svelte +100 -111
  144. package/src/client/app/ui/fields/IntervalInput.svelte +268 -0
  145. package/src/client/app/ui/fields/ListInput.svelte +96 -96
  146. package/src/client/app/ui/fields/NumberInput.svelte +120 -116
  147. package/src/client/app/ui/fields/ProgressInput.svelte +99 -73
  148. package/src/client/app/ui/fields/Select.svelte +137 -124
  149. package/src/client/app/ui/fields/TextInput.svelte +10 -11
  150. package/src/client/app/ui/fields/VectorInput.svelte +86 -82
  151. package/src/client/app/utils/canvas.utils.js +189 -208
  152. package/src/client/app/utils/color.utils.js +138 -101
  153. package/src/client/app/utils/fields.utils.js +131 -0
  154. package/src/client/app/utils/file.utils.js +209 -37
  155. package/src/client/app/utils/glsl.utils.js +2 -2
  156. package/src/client/app/utils/glslErrors.js +49 -31
  157. package/src/client/app/utils/index.js +32 -29
  158. package/src/client/app/utils/math.utils.js +14 -10
  159. package/src/client/index.html +16 -16
  160. package/src/client/main.js +4 -4
  161. package/src/client/public/css/global.css +26 -16
  162. package/src/cli/db.js +0 -17
  163. package/src/cli/index.js +0 -198
  164. package/src/cli/plugins/db.js +0 -12
  165. package/src/cli/plugins/hot-shader-reload.js +0 -86
  166. package/src/cli/plugins/screenshot.js +0 -46
  167. package/src/cli/server.js +0 -153
  168. package/src/cli/templates/2d.js +0 -15
  169. package/src/cli/templates/blank.js +0 -13
  170. package/src/cli/templates/fragment.js +0 -18
  171. package/src/cli/templates/index.js +0 -27
  172. package/src/cli/templates/p5.js +0 -13
  173. package/src/cli/templates/three-fragment.js +0 -53
  174. package/src/cli/templates/three-orthographic.js +0 -23
  175. package/src/cli/templates/three-perspective.js +0 -20
  176. package/src/client/app/lib/canvas-recorder/FFMPEGRecorder.js +0 -56
  177. package/src/client/app/utils/props.utils.js +0 -51
  178. package/src/client/public/fonts/Inter-Bold.woff2 +0 -0
  179. package/src/client/public/fonts/Inter-Italic.woff2 +0 -0
  180. package/src/client/public/fonts/Inter-Regular.woff2 +0 -0
  181. package/src/client/public/fonts/Inter-SemiBold.woff2 +0 -0
  182. package/src/client/public/js/ffmpeg.min.js +0 -2
  183. package/src/client/public/js/ffmpeg.min.js.map +0 -1
  184. /package/src/cli/templates/{fragment.fs → fragment-gl/fragment.fs} +0 -0
@@ -1,123 +1,127 @@
1
1
  <script>
2
- import { createEventDispatcher } from "svelte";
3
- import FieldInputRow from "./FieldInputRow.svelte";
4
- import Input from "./Input.svelte";
5
- import ProgressInput from "./ProgressInput.svelte";
6
- import Keyboard from "../../inputs/Keyboard.js";
7
- import { clamp } from "../../utils/math.utils.js";
8
-
9
- function round(value, step) {
10
- return Math.round(value * (1 / step)) / (1 / step);
11
- }
12
-
13
- export let value = null;
14
- export let label = "";
15
- export let step = 1;
16
- export let suffix = "";
17
- export let min = -Infinity;
18
- export let max = Infinity;
19
- export let disabled = false;
20
- export let context = null;
21
- export let key = "";
22
-
23
- $: isFocused = false;
24
- const dispatch = createEventDispatcher();
25
-
26
- function sanitize(v, suffix) {
27
- return (suffix && suffix !== "") ? Number(v.split(suffix)[0]) : Number(v);
28
- }
29
-
30
- function composeValue(v, isFocused, suffix = "") {
31
- const clampedValue = clamp(v, isFinite(min) ? min : -Infinity, isFinite(max) ? max : Infinity);
32
- const roundedValue = typeof step === "number" ? round(clampedValue, step) : v;
33
-
34
- return isFocused ? `${roundedValue}` : `${roundedValue}${suffix}`;
35
- }
36
-
37
- $: currentValue = value;
38
- $: composedValue = composeValue(currentValue, isFocused, suffix);
39
-
40
- function onFocus() {
41
- isFocused = true;
42
- }
43
-
44
- function onBlur(event) {
45
- isFocused = false;
46
-
47
- let newValue = event.currentTarget.value;
48
- let isNotValid = isNaN(Number(event.currentTarget.value));
49
-
50
- if (isNotValid) {
51
- newValue = `${value}`;
52
- }
53
-
54
- currentValue = sanitize(newValue, suffix);
55
-
56
- dispatch('change', currentValue);
57
- }
58
-
59
- function onKeyDown(event) {
60
- if ([38, 40].includes(event.keyCode)) {
61
- event.preventDefault();
62
-
63
- const diff = Keyboard.getStepFromEvent(event) * step;
64
- const direction = event.keyCode === 38 ? 1 : -1;
65
- const newValue = sanitize(composedValue, suffix) + direction * (diff);
66
-
67
- currentValue = newValue;
68
- dispatch('change', currentValue);
69
- }
70
- }
71
-
72
- $: hasProgress = isFinite(min) && isFinite(max);
73
-
74
- function handleChangeProgress(event) {
75
- currentValue = event.detail;
76
- dispatch('change', event.detail);
77
- }
78
-
2
+ import { createEventDispatcher } from 'svelte';
3
+ import FieldInputRow from './FieldInputRow.svelte';
4
+ import Input from './Input.svelte';
5
+ import ProgressInput from './ProgressInput.svelte';
6
+ import Keyboard from '../../inputs/Keyboard.js';
7
+ import { clamp, roundToStep } from '../../utils/math.utils.js';
8
+
9
+ export let value = null;
10
+ export let label = '';
11
+ export let step = 1;
12
+ export let suffix = '';
13
+ export let min = -Infinity;
14
+ export let max = Infinity;
15
+ export let disabled = false;
16
+ export let context = null;
17
+ export let key = '';
18
+ export let progress = true;
19
+
20
+ $: hasProgress = progress && isFinite(min) && isFinite(max);
21
+ $: isFocused = false;
22
+ $: precision = step.toString().split('.')[1]?.length || 0;
23
+ const dispatch = createEventDispatcher();
24
+
25
+ function sanitize(v, suffix) {
26
+ return suffix && suffix !== '' ? Number(v.split(suffix)[0]) : Number(v);
27
+ }
28
+
29
+ function composeValue(v, isFocused, suffix = '', precision) {
30
+ const clampedValue = clamp(
31
+ v,
32
+ isFinite(min) ? min : -Infinity,
33
+ isFinite(max) ? max : Infinity,
34
+ );
35
+ const roundedValue =
36
+ typeof step === 'number' ? roundToStep(clampedValue, step) : v;
37
+
38
+ const fixedValue = roundedValue.toFixed(precision);
39
+
40
+ return isFocused ? `${fixedValue}` : `${fixedValue}${suffix}`;
41
+ }
42
+
43
+ $: currentValue = value;
44
+ $: composedValue = composeValue(currentValue, isFocused, suffix, precision);
45
+
46
+ function onFocus() {
47
+ isFocused = true;
48
+ }
49
+
50
+ function onBlur(event) {
51
+ isFocused = false;
52
+
53
+ let newValue = event.currentTarget.value;
54
+ let isNotValid = isNaN(Number(event.currentTarget.value));
55
+
56
+ if (isNotValid) {
57
+ newValue = `${value}`;
58
+ }
59
+
60
+ currentValue = sanitize(newValue, suffix);
61
+
62
+ dispatch('change', currentValue);
63
+ }
64
+
65
+ function onKeyDown(event) {
66
+ if ([38, 40].includes(event.keyCode)) {
67
+ event.preventDefault();
68
+
69
+ const diff = Keyboard.getStepFromEvent(event) * step;
70
+ const direction = event.keyCode === 38 ? 1 : -1;
71
+ const newValue = sanitize(composedValue, suffix) + direction * diff;
72
+
73
+ currentValue = newValue;
74
+ dispatch('change', currentValue);
75
+ }
76
+ }
77
+
78
+ function handleChangeProgress(event) {
79
+ currentValue = event.detail;
80
+ dispatch('change', event.detail);
81
+ }
79
82
  </script>
80
83
 
81
- <div class="number-input {hasProgress ? "number-input--with-progress": ""}">
82
- {#if hasProgress}
83
- <FieldInputRow --grid-template-columns="1fr 0.5fr">
84
- <ProgressInput
85
- step={step}
86
- value={currentValue}
87
- min={min}
88
- max={max}
89
- {context}
90
- {key}
91
- on:change={handleChangeProgress}
92
- />
93
- <Input
94
- {label}
95
- {disabled}
96
- {context}
97
- {key}
98
- on:keydown={onKeyDown}
99
- on:focus={onFocus}
100
- on:blur={onBlur}
101
- bind:value={composedValue}
102
- />
103
- </FieldInputRow>
104
- {:else}
105
- <Input
106
- {label}
107
- {disabled}
108
- {context}
109
- {key}
110
- on:keydown={onKeyDown}
111
- on:focus={onFocus}
112
- on:blur={onBlur}
113
- bind:value={composedValue}
114
- />
115
- {/if}
84
+ <div class="number-input {hasProgress ? 'number-input--with-progress' : ''}">
85
+ {#if hasProgress}
86
+ <FieldInputRow --grid-template-columns="1fr 0.5fr">
87
+ <ProgressInput
88
+ {step}
89
+ value={currentValue}
90
+ {min}
91
+ {max}
92
+ {context}
93
+ {disabled}
94
+ {key}
95
+ on:change={handleChangeProgress}
96
+ />
97
+ <Input
98
+ {label}
99
+ {disabled}
100
+ {context}
101
+ {key}
102
+ on:keydown={onKeyDown}
103
+ on:focus={onFocus}
104
+ on:blur={onBlur}
105
+ bind:value={composedValue}
106
+ />
107
+ </FieldInputRow>
108
+ {:else}
109
+ <Input
110
+ {label}
111
+ {disabled}
112
+ {context}
113
+ {key}
114
+ on:keydown={onKeyDown}
115
+ on:focus={onFocus}
116
+ on:blur={onBlur}
117
+ bind:value={composedValue}
118
+ />
119
+ {/if}
116
120
  </div>
117
121
 
118
122
  <style>
119
- .number-input {
120
- position: relative;
121
- width: 100%;
122
- }
123
+ .number-input {
124
+ position: relative;
125
+ width: 100%;
126
+ }
123
127
  </style>
@@ -1,94 +1,120 @@
1
1
  <script>
2
- import { createEventDispatcher } from "svelte";
3
- import { map, clamp } from "../../utils/math.utils.js";
2
+ import { createEventDispatcher } from 'svelte';
3
+ import { map, clamp, roundToStep } from '../../utils/math.utils.js';
4
4
 
5
- export let value;
6
- export let min;
7
- export let max;
8
- export let step;
9
- export let context = null;
10
- export let key = "";
5
+ export let value;
6
+ export let min;
7
+ export let max;
8
+ export let step;
9
+ export let context = null;
10
+ export let key = '';
11
+ export let disabled = false;
11
12
 
12
- let node;
13
- let rect;
13
+ let node;
14
+ let rect;
14
15
 
15
- const dispatch = createEventDispatcher();
16
+ const dispatch = createEventDispatcher();
16
17
 
17
- let isDragging = false;
18
+ let isDragging = false;
18
19
 
19
- // handlers
20
- function handleMouseDown(event) {
21
- document.addEventListener('mousemove', handleMouseMove);
22
- document.addEventListener('mouseup', handleMouseUp);
20
+ // handlers
21
+ function handleMouseDown(event) {
22
+ document.addEventListener('mousemove', handleMouseMove);
23
+ document.addEventListener('mouseup', handleMouseUp);
23
24
 
24
- rect = node.getBoundingClientRect();
25
+ rect = node.getBoundingClientRect();
25
26
 
26
- isDragging = true;
27
+ isDragging = true;
27
28
 
28
- onDrag(event);
29
- }
29
+ onDrag(event);
30
+ }
30
31
 
31
- function handleMouseMove(event) {
32
- onDrag(event);
33
- }
32
+ function handleMouseMove(event) {
33
+ onDrag(event);
34
+ }
34
35
 
35
- function onDrag(event) {
36
- let v = clamp(map(event.clientX, rect.left, rect.right, min, max), min, max);
37
- v = Math.floor(v * (1 / step)) / (1 / step);
36
+ function onDrag(event) {
37
+ let dragValue = clamp(
38
+ map(event.clientX, rect.left, rect.right, min, max),
39
+ min,
40
+ max,
41
+ );
42
+ dragValue = roundToStep(dragValue, step);
38
43
 
39
- if (v !== value) {
40
- dispatch("change", v);
41
- }
42
- }
44
+ if (dragValue !== value) {
45
+ dispatch('change', dragValue);
46
+ }
47
+ }
43
48
 
44
- function handleMouseUp() {
45
- document.removeEventListener('mousemove', handleMouseMove);
46
- document.removeEventListener('mouseup', handleMouseUp);
49
+ function handleMouseUp() {
50
+ document.removeEventListener('mousemove', handleMouseMove);
51
+ document.removeEventListener('mouseup', handleMouseUp);
47
52
 
48
- isDragging = false;
49
- }
50
-
51
- $: scaleX = clamp(map(value, min, max, 0, 1), 0, 1);
53
+ isDragging = false;
54
+ }
52
55
 
56
+ $: progress = clamp(map(value, min, max, 0, 1), 0.0001, 1);
57
+ $: opacity = progress > 0 ? 1 : 0;
53
58
  </script>
54
59
 
55
- <div class="progress {isDragging ? "dragging": ""} " bind:this={node} on:mousedown={handleMouseDown}>
56
- <div class="fill" style="opacity: {scaleX > 0 ? 1 : 0}; transform: scaleX({scaleX})"></div>
60
+ <div
61
+ class="progress {isDragging ? 'dragging' : ''} "
62
+ bind:this={node}
63
+ on:mousedown={handleMouseDown}
64
+ class:disabled
65
+ >
66
+ <div class="fill" style="--progress: {progress}; --opacity: {opacity};" />
57
67
  </div>
58
68
 
59
69
  <style>
60
- .progress {
61
- position: relative;
62
-
63
- height: var(--height-input);
64
- border-radius: var(--border-radius-input);
65
- box-shadow: inset 0 0 0 1px var(--color-border-input);
66
-
67
- background: var(--color-background-input);
68
- cursor: ew-resize;
69
- }
70
-
71
- .progress:hover {
72
- box-shadow: inset 0 0 0 1px var(--color-active);
73
- }
74
-
75
- .progress.dragging {
76
- box-shadow: 0 0 0 2px var(--color-active);
77
- }
78
-
79
-
80
- .fill {
81
- position: absolute;
82
- left: 3px;
83
- top: 3px;
84
- bottom: 3px;
85
- right: 3px;
86
-
87
- background: grey;
88
- transform-origin: 0 50%;
89
- border-radius: calc(var(--border-radius-input) * 0.5);
90
-
91
- background-color: var(--color-active);
92
- }
93
-
70
+ .progress {
71
+ position: relative;
72
+
73
+ height: var(--height-input);
74
+ border-radius: var(--border-radius-input);
75
+ box-shadow: inset 0 0 0 1px var(--color-border-input);
76
+
77
+ background: var(--color-background-input);
78
+ cursor: ew-resize;
79
+ container-type: size;
80
+ }
81
+
82
+ .progress:hover {
83
+ box-shadow: inset 0 0 0 1px var(--color-active);
84
+ }
85
+
86
+ .progress.dragging {
87
+ box-shadow: 0 0 0 2px var(--color-active);
88
+ }
89
+
90
+ .fill {
91
+ --padding-h: 3px;
92
+ --width: 6px;
93
+ --tx-min: var(--padding-h);
94
+ --tx-max: calc(100cqw - var(--padding-h) * 1 - var(--width));
95
+
96
+ --tx: calc(
97
+ var(--progress, 0) * (var(--tx-max) - var(--tx-min)) / (1) +
98
+ var(--tx-min)
99
+ );
100
+ position: absolute;
101
+ left: 0px;
102
+ top: 3px;
103
+ bottom: 3px;
104
+ /* right: 3px; */
105
+
106
+ width: var(--width);
107
+
108
+ background: grey;
109
+ transform-origin: 0 50%;
110
+ border-radius: calc(var(--border-radius-input) * 0.5);
111
+
112
+ background-color: var(--color-active);
113
+
114
+ transform: translate3d(var(--tx), 0px, 0px);
115
+ }
116
+
117
+ .progress.disabled .fill {
118
+ background-color: var(--color-active-disabled);
119
+ }
94
120
  </style>