File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ <!doctype html>
2+ < html lang ="en " class ="color-scheme-auto bg-background font-vazirmatn ">
3+ < head >
4+ < meta charset ="UTF-8 " />
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6+ < title > Gecut Snack Bar</ title >
7+ < link rel ="icon " href ="/favicon.ico " sizes ="any " />
8+ < link rel ="apple-touch-icon " href ="/apple-touch-icon.png " />
9+ < link rel ="manifest " href ="/manifest.json " />
10+ < script type ="module " src ="../main/global.ts "> </ script >
11+ < script type ="module " src ="./scripts.ts "> </ script >
12+ </ head >
13+ < body class ="bg-surface max-w-screen-sm mx-auto p-4 "> </ body >
14+ </ html >
Original file line number Diff line number Diff line change 1+ import { GecutState } from '@gecut/lit-helper' ;
2+ import { render , html } from 'lit/html.js' ;
3+
4+ const str = new GecutState ( 'string' , '' ) ;
5+ const num = new GecutState ( 'number' , 0 ) ;
6+ const bool = new GecutState ( 'boolean' , false ) ;
7+
8+ render (
9+ html `
10+ < div class ="mx-auto max-w-sm flex flex-col gap-4 relative h-full w-full ">
11+ < ol class ="*:cursor-pointer *:select-none ">
12+ < li @click =${ ( ) => ( str . value += 'Hello ' ) } > String: ${ str . hydrate ( ( data ) => data ) } </ li >
13+ < li @click =${ ( ) => ( num . value = ( num . value ?? 0 ) + 1_000 ) } >
14+ Number: ${ num . hydrate ( ( data ) => data . toLocaleString ( 'Fa-Ir' ) ) }
15+ </ li >
16+ < li @click =${ ( ) => ( bool . value = ! bool . value ) } > Boolean: ${ bool . hydrate ( ( data ) => JSON . stringify ( data ) ) } </ li >
17+ </ ol >
18+ </ div >
19+ ` ,
20+ document . body ,
21+ ) ;
You can’t perform that action at this time.
0 commit comments