File tree Expand file tree Collapse file tree 2 files changed +35
-18
lines changed Expand file tree Collapse file tree 2 files changed +35
-18
lines changed Original file line number Diff line number Diff line change 7
7
--inactive-color : # 1e1e2e ;
8
8
--active-color : # fab387 ;
9
9
--text-color : # cdd6f4 ;
10
+ --red-color : # f38ba8 ;
11
+ --yellow-color : # f9e2af ;
12
+ --green-color : # a6e3a1 ;
13
+ --blue-color : # 89b4fa ;
10
14
}
11
15
12
16
@theme {
13
17
--color-bg : var (--bg-color );
14
18
--color-inactive : var (--inactive-color );
15
19
--color-primary : var (--active-color );
16
20
--color-text : var (--text-color );
21
+ --color-red : var (--red-color );
22
+ --color-yellow : var (--yellow-color );
23
+ --color-green : var (--green-color );
24
+ --color-blue : var (--blue-color );
17
25
}
Original file line number Diff line number Diff line change 9
9
console .log (popover);
10
10
popover .showPopover ();
11
11
}
12
+
13
+ let color = $state ()
14
+
15
+ if (dotNum < nowDots) {
16
+ color = " bg-text"
17
+ } else if (dotNum == nowDots) {
18
+ color = " bg-primary"
19
+ } else {
20
+ color = " bg-inactive"
21
+ }
22
+
12
23
</script >
13
24
14
25
{#snippet picker ()}
15
- <div popover class ="bg-inactive border-text rounded-xl border-1 p-4" bind:this ={popover }>
16
- <ColorPicker components ={ChromeVariant } sliderDirection ="horizontal" isDialog ={false } />
26
+ <div popover class ="bg-bg border-text rounded-xl border-1 p-4" bind:this ={popover }>
27
+ <div class =" flex flex-row gap-1" >
28
+ <div class ="w-3 h-6 rounded-full hover:w-6 transition-all bg-red" onclick ={() => { color = " bg-red" }}></div >
29
+ <div class ="w-3 h-6 rounded-full hover:w-6 transition-all bg-yellow" onclick ={() => { color = " bg-yellow" }}></div >
30
+ <div class ="w-3 h-6 rounded-full hover:w-6 transition-all bg-green" onclick ={() => { color = " bg-green" }}></div >
31
+ <div class ="w-3 h-6 rounded-full hover:w-6 transition-all bg-blue" onclick ={() => { color = " bg-blue" }}></div >
32
+ <div class ="w-3 h-6 rounded-full hover:w-6 transition-all bg-primary" onclick ={() => { color = " bg-primary" }}></div >
33
+ <div class ="w-3 h-6 rounded-full hover:w-6 transition-all bg-inactive" onclick ={() => { color = " bg-inactive" }}></div >
34
+ </div >
17
35
</div >
18
36
{/ snippet }
19
37
20
- {#if dotNum < nowDots }
21
- <button onclick ={openPopover } aria-label =" Open Dot Dialog" >
22
- <div class =" bg-text dot size-6 rounded-full" ></div >
23
- </button >
24
- {@render picker ()}
25
- {:else if dotNum == nowDots }
26
- <button onclick ={openPopover } aria-label =" Open Dot Dialog" >
27
- <div class =" bg-primary dot size-6 rounded-full" ></div >
28
- </button >
29
- {@render picker ()}
30
- {:else }
31
- <button onclick ={openPopover } aria-label =" Open Dot Dialog" >
32
- <div class =" bg-inactive dot size-6 rounded-full" ></div >
33
- </button >
34
- {@render picker ()}
35
- {/if }
38
+ <div id = " test" >
39
+ <button onclick ={openPopover } aria-label =" Open Dot Dialog" >
40
+ <div class ={[" dot size-6 rounded-full" , color ]}></div >
41
+ {@render picker ()}
42
+ </button >
43
+ {@render picker ()}
44
+ </div >
You can’t perform that action at this time.
0 commit comments