1+ <script setup lang="ts">
2+ const props = defineProps <{
3+ exclusiveTo: string
4+ }>();
5+
6+ enum Icons {
7+ Kistan
8+ }
9+
10+ const exclusivityTypes: {
11+ [key : string ]: {
12+ header: string ,
13+ description: string ,
14+ icon: Icons
15+ }
16+ } = {
17+ KistanGeneric: {
18+ header: " Kistan exclusive!" ,
19+ description: " This content only applies to Kistan" ,
20+ icon: Icons .Kistan
21+ },
22+ LMixer: {
23+ header: " Kistan's LMixer exclusive" ,
24+ description: " This content only applies to kistan's instance of LMixer. It is likely the case that the code is contained in setup scripts." ,
25+ icon: Icons .Kistan
26+ }
27+ }
28+
29+ const exclusivityInfo = exclusivityTypes [props .exclusiveTo ] ?? {
30+ header: " Invalid exclusivity type" ,
31+ description: " The exclusiveTo property has a value of " + props .exclusiveTo + " which is not valid" ,
32+ icon: Icons .Kistan
33+ };
34+
35+ </script >
36+ <template >
37+ <div class =" kistan-exclusive" >
38+ <div class =" kistan-exclusive-top" >
39+ <p class =" kistan-exclusive-header" >
40+ <template v-if =" exclusivityInfo .icon == Icons .Kistan " >
41+ <!-- Treasure Chest SVG from MDI-->
42+ <svg class =" kistan-treasure-chest-icon" xmlns =" http://www.w3.org/2000/svg" viewBox =" 0 0 24 24" >
43+ <path fill =" currentColor"
44+ d =" M5,4H19A3,3 0 0,1 22,7V11H15V10H9V11H2V7A3,3 0 0,1 5,4M11,11H13V13H11V11M2,12H9V13L11,15H13L15,13V12H22V20H2V12Z" />
45+ </svg >
46+ </template >
47+ {{ exclusivityInfo.header }}
48+ </p >
49+ <p class =" kistan-exclusive-description" >
50+ {{ exclusivityInfo.description }}
51+ </p >
52+ </div >
53+ <div class =" kistan-exclusive-content" >
54+ <slot >
55+
56+ </slot >
57+ </div >
58+ </div >
59+ </template >
60+
61+ <style >
62+ :root {
63+ --exclusive-accent : rgb (101 , 83 , 202 );
64+ --exclusive-border : hsl (252 , 79% , 87% );
65+ --exclusive-background : rgb (237 , 235 , 255 );
66+ --exclusive-bg-alt : rgb (217 , 204 , 241 );
67+ }
68+
69+ [data-theme = dark ] {
70+ --exclusive-accent : #aeb5f5 ;
71+ --exclusive-border : rgb (34 , 39 , 68 );
72+ --exclusive-background : rgb (23 , 27 , 43 );
73+ --exclusive-bg-alt : rgb (17 , 21 , 37 );
74+ }
75+
76+ .kistan-exclusive {
77+ --vp-c-bg-alt : var (--exclusive-bg-alt );
78+
79+ border : solid 0.3em var (--exclusive-border );
80+ border-radius : 0.5em ;
81+ margin-block : 0.75em ;
82+ margin-top : 2em ;
83+ margin-inline : -0.5em ;
84+ background-color : var (--exclusive-border );
85+ }
86+
87+ .kistan-exclusive-top {
88+ padding : 0.25em 1em ;
89+ }
90+
91+ .kistan-exclusive-content {
92+ padding : 0.25em 1em ;
93+ background-color : var (--exclusive-background );
94+ border-radius : 0.5em ;
95+ }
96+
97+ .kistan-exclusive-header {
98+ color : var (--exclusive-accent );
99+ display : block ;
100+ margin-block : 0.75em ;
101+ font-weight : 600 ;
102+ line-height : 1.5 ;
103+ font-size : var (--hint-font-size );
104+ }
105+
106+ .kistan-exclusive-description {
107+ line-height : 1.5 ;
108+ font-size : var (--hint-font-size );
109+ }
110+
111+ .kistan-treasure-chest-icon {
112+ width : 1.5rem ;
113+ vertical-align : text-top ;
114+ padding-right : 1ch ;
115+ }
116+ </style >
0 commit comments