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 77 --inactive-color : # 1e1e2e ;
88 --active-color : # fab387 ;
99 --text-color : # cdd6f4 ;
10+ --red-color : # f38ba8 ;
11+ --yellow-color : # f9e2af ;
12+ --green-color : # a6e3a1 ;
13+ --blue-color : # 89b4fa ;
1014}
1115
1216@theme {
1317 --color-bg : var (--bg-color );
1418 --color-inactive : var (--inactive-color );
1519 --color-primary : var (--active-color );
1620 --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 );
1725}
Original file line number Diff line number Diff line change 99 console .log (popover);
1010 popover .showPopover ();
1111 }
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+
1223 </script >
1324
1425{#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 >
1735 </div >
1836{/ snippet }
1937
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