Upload folder using huggingface_hub
Browse files
6.6.0/colorpicker/shared/Colorpicker.svelte
CHANGED
|
@@ -164,25 +164,22 @@
|
|
| 164 |
class="dialog-button"
|
| 165 |
style:background={value}
|
| 166 |
{disabled}
|
| 167 |
-
|
|
|
|
|
|
|
| 168 |
update_mouse_from_color(value);
|
| 169 |
dialog_open = !dialog_open;
|
| 170 |
}}
|
| 171 |
/>
|
| 172 |
|
| 173 |
-
<svelte:window
|
| 174 |
|
| 175 |
{#if dialog_open}
|
| 176 |
-
<div
|
| 177 |
-
class="color-picker"
|
| 178 |
-
on:focus
|
| 179 |
-
on:blur
|
| 180 |
-
use:click_outside={handle_click_outside}
|
| 181 |
-
>
|
| 182 |
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
| 183 |
<div
|
| 184 |
class="color-gradient"
|
| 185 |
-
|
| 186 |
style="--hue:{hue}"
|
| 187 |
bind:this={sl_wrap}
|
| 188 |
>
|
|
@@ -193,7 +190,7 @@
|
|
| 193 |
/>
|
| 194 |
</div>
|
| 195 |
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
| 196 |
-
<div class="hue-slider"
|
| 197 |
<div
|
| 198 |
class="marker"
|
| 199 |
style:background={"hsl(" + hue + ", 100%, 50%)"}
|
|
@@ -208,11 +205,16 @@
|
|
| 208 |
<input
|
| 209 |
type="text"
|
| 210 |
bind:value={color_string}
|
| 211 |
-
|
| 212 |
value = e.currentTarget.value;
|
| 213 |
}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
/>
|
| 215 |
-
<button class="eyedropper"
|
| 216 |
{#if eyedropper_supported}
|
| 217 |
<Eyedropper />
|
| 218 |
{/if}
|
|
@@ -224,7 +226,7 @@
|
|
| 224 |
<button
|
| 225 |
class="button"
|
| 226 |
class:active={current_mode === value}
|
| 227 |
-
|
| 228 |
current_mode = value;
|
| 229 |
}}>{label}</button
|
| 230 |
>
|
|
|
|
| 164 |
class="dialog-button"
|
| 165 |
style:background={value}
|
| 166 |
{disabled}
|
| 167 |
+
onfocus={on_focus}
|
| 168 |
+
onblur={on_blur}
|
| 169 |
+
onclick={() => {
|
| 170 |
update_mouse_from_color(value);
|
| 171 |
dialog_open = !dialog_open;
|
| 172 |
}}
|
| 173 |
/>
|
| 174 |
|
| 175 |
+
<svelte:window onmousemove={handle_move} onmouseup={handle_end} />
|
| 176 |
|
| 177 |
{#if dialog_open}
|
| 178 |
+
<div class="color-picker" use:click_outside={handle_click_outside}>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
| 180 |
<div
|
| 181 |
class="color-gradient"
|
| 182 |
+
onmousedown={handle_sl_down}
|
| 183 |
style="--hue:{hue}"
|
| 184 |
bind:this={sl_wrap}
|
| 185 |
>
|
|
|
|
| 190 |
/>
|
| 191 |
</div>
|
| 192 |
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
| 193 |
+
<div class="hue-slider" onmousedown={handle_hue_down} bind:this={hue_wrap}>
|
| 194 |
<div
|
| 195 |
class="marker"
|
| 196 |
style:background={"hsl(" + hue + ", 100%, 50%)"}
|
|
|
|
| 205 |
<input
|
| 206 |
type="text"
|
| 207 |
bind:value={color_string}
|
| 208 |
+
onchange={(e) => {
|
| 209 |
value = e.currentTarget.value;
|
| 210 |
}}
|
| 211 |
+
onkeydown={(e) => {
|
| 212 |
+
if (e.key === "Enter") {
|
| 213 |
+
on_submit();
|
| 214 |
+
}
|
| 215 |
+
}}
|
| 216 |
/>
|
| 217 |
+
<button class="eyedropper" onclick={request_eyedropper}>
|
| 218 |
{#if eyedropper_supported}
|
| 219 |
<Eyedropper />
|
| 220 |
{/if}
|
|
|
|
| 226 |
<button
|
| 227 |
class="button"
|
| 228 |
class:active={current_mode === value}
|
| 229 |
+
onclick={() => {
|
| 230 |
current_mode = value;
|
| 231 |
}}>{label}</button
|
| 232 |
>
|