2022-12-01 05:57:57 +00:00
import { _ as s , c as a , o as n , d as e } from "./app.f001dff6.js" ; const u = JSON . parse ( '{"title":"Bars","description":"","frontmatter":{},"headers":[],"relativePath":"public/kronos/docs/bars.md","lastUpdated":null}' ) , o = { name : "public/kronos/docs/bars.md" } , t = e ( ` <h1 id="bars" tabindex="-1">Bars <a class="header-anchor" href="#bars" aria-hidden="true">#</a></h1><p>Bars let you display information in a more direct way. It can be a progress bar, health bar, capacity gauge, or anything else.</p><p>Bars are defined like other Big Features:</p><div class="language-js"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki"><code><span class="line"><span style="color:#FFCB6B;">bars</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
2022-10-05 00:48:27 +00:00
< span class = "line" > < span style = "color:#F07178;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F F C B 6 B ; " > b i g B a r < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > { < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#F07178;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F F C B 6 B ; " > d i r e c t i o n < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > R I G H T < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#F07178;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F F C B 6 B ; " > w i d t h < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # F 7 8 C 6 C ; " > 2 0 0 < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#F07178;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F F C B 6 B ; " > h e i g h t < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # F 7 8 C 6 C ; " > 5 0 < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#F07178;" > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > p r o g r e s s < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > ( ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > { < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > r e t u r n < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # F 7 8 C 6 C ; " > 0 < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > } , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#F07178;" > < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > e t c < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#F07178;" > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > } , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#F07178;" > < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > e t c < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#89DDFF;" > } < / s p a n > < / s p a n >
< span class = "line" > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > F e a t u r e s : < / p > < u l > < l i > < p > d i r e c t i o n : U P , D O W N , L E F T , o r R I G H T ( n o t s t r i n g s ) . D e t e r m i n e s t h e d i r e c t i o n t h a t t h e b a r i s f i l l e d a s i t p r o g r e s s e s . R I G H T m e a n s f r o m l e f t t o r i g h t . < / p > < / l i > < l i > < p > w i d t h , h e i g h t : T h e s i z e i n p i x e l s o f t h e b a r , b u t a s n u m b e r s ( n o & q u o t ; p x & q u o t ; a t t h e e n d ) . < / p > < / l i > < l i > < p > p r o g r e s s ( ) : A f u n c t i o n t h a t r e t u r n s t h e p o r t i o n o f t h e b a r t h a t i s f i l l e d , f r o m & q u o t ; e m p t y & q u o t ; a t 0 t o & q u o t ; f u l l & q u o t ; a t 1 , u p d a t i n g a u t o m a t i c a l l y . ( N o t h i n g b a d h a p p e n s i f t h e v a l u e g o e s o u t o f t h e s e b o u n d s , a n d i t c a n b e a n u m b e r o r < c o d e > D e c i m a l < / c o d e > ) < / p > < / l i > < l i > < p > d i s p l a y ( ) : < s t r o n g > o p t i o n a l < / s t r o n g > . A f u n c t i o n t h a t r e t u r n s t e x t t o b e d i s p l a y e d o n t o p o f t h e b a r , c a n u s e H T M L . < / p > < / l i > < l i > < p > u n l o c k e d ( ) : < s t r o n g > o p t i o n a l < / s t r o n g > . A f u n c t i o n r e t u r n i n g a b o o l t o d e t e r m i n e i f t h e b a r i s v i s i b l e o r n o t . D e f a u l t i s u n l o c k e d . < / p > < / l i > < l i > < p > b a s e S t y l e , f i l l S t y l e , b o r d e r S t y l e , t e x t S t y l e : < s t r o n g > O p t i o n a l < / s t r o n g > , A p p l y C S S t o t h e u n f i l l e d p o r t i o n , f i l l e d p o r t i o n , b o r d e r , a n d d i s p l a y t e x t o n t h e b a r , i n t h e f o r m o f a n o b j e c t w h e r e t h e k e y s a r e C S S a t t r i b u t e s , a n d t h e v a l u e s a r e t h e v a l u e s f o r t h o s e a t t r i b u t e s ( b o t h a s s t r i n g s ) . < / p > < / l i > < l i > < p > l a y e r : < s t r o n g > a s s i g n e d a u t o m a g i c a l l y < / s t r o n g > . I t & # 3 9 ; s t h e s a m e v a l u e a s t h e n a m e o f t h i s l a y e r , s o y o u c a n d o < c o d e > p l a y e r [ t h i s . l a y e r ] . p o i n t s < / c o d e > o r s i m i l a r . < / p > < / l i > < l i > < p > i d : < s t r o n g > a s s i g n e d a u t o m a g i c a l l y < / s t r o n g > . I t & # 3 9 ; s t h e & q u o t ; k e y & q u o t ; w h i c h t h e b a r w a s s t o r e d u n d e r , f o r c o n v e n i e n t a c c e s s . T h e b a r i n t h e e x a m p l e & # 3 9 ; s i d i s & q u o t ; b i g B a r & q u o t ; . < / p > < / l i > < / u l > ` , 6 ) , l = [ t ] ; f u n c t i o n p ( r , i , c , y , d , F ) { r e t u r n n ( ) , a ( " d i v " , n u l l , l ) } c o n s t b = s ( o , [ [ " r e n d e r " , p ] ] ) ; e x p o r t { u a s _ _ p a g e D a t a , b a s d e f a u l t } ;