7575 `)}
7676 </ div >
7777 </ div >
78+
79+ < div class ="block-title block-title-medium "> Material Color Scheme</ div >
80+ < div class ="list list-strong inset ">
81+ < ul >
82+ < li >
83+ < label class ="item-content ">
84+ < div class ="item-inner ">
85+ < div class ="item-title "> Monochrome</ div >
86+ < div class ="item-after ">
87+ < div class ="toggle toggle-init ">
88+ < input type ="checkbox " checked =${monochrome} @change =${(e) =>
89+ setMdColorSchemeMonochrome(e.target.checked)} />
90+ < span class ="toggle-icon "> </ span >
91+ </ div >
92+ </ div >
93+ </ div >
94+ </ label >
95+ </ li >
96+ < li >
97+ < label class ="item-content ">
98+ < div class ="item-inner ">
99+ < div class ="item-title "> Vibrant</ div >
100+ < div class ="item-after ">
101+ < div class ="toggle toggle-init ">
102+ < input type ="checkbox " checked =${vibrant} @change =${(e) => setMdColorSchemeVibrant(e.target.checked)}
103+ />
104+ < span class ="toggle-icon "> </ span >
105+ </ div >
106+ </ div >
107+ </ div >
108+ </ label >
109+ </ li >
110+ </ ul >
111+ </ div >
112+
78113 < div class ="block-title block-title-medium "> Custom Color Theme</ div >
79114 < div class ="list list-strong-ios list-outline-ios ">
80115 < ul >
104139 const colors = Object . keys ( $f7 . colors ) . filter ( ( c ) => c !== 'primary' && c !== 'white' && c !== 'black' ) ;
105140
106141 let colorPicker ;
142+ let monochrome = false ;
143+ let vibrant = false ;
107144
108145 const setScheme = ( newTheme ) => {
109146 $f7 . setDarkMode ( newTheme === 'dark' ) ;
126163 $update ( ) ;
127164 }
128165
166+ const setMdColorScheme = ( ) => {
167+ if ( ! vibrant && ! monochrome ) {
168+ $f7 . setMdColorScheme ( 'default' ) ;
169+ } else if ( vibrant && ! monochrome ) {
170+ $f7 . setMdColorScheme ( 'vibrant' ) ;
171+ } else if ( ! vibrant && monochrome ) {
172+ $f7 . setMdColorScheme ( 'monochrome' ) ;
173+ } else if ( vibrant && monochrome ) {
174+ $f7 . setMdColorScheme ( 'vibrant-monochrome' ) ;
175+ }
176+ $update ( ) ;
177+ }
178+
179+ const setMdColorSchemeMonochrome = ( value ) => {
180+ monochrome = value ;
181+ setMdColorScheme ( ) ;
182+ }
183+ const setMdColorSchemeVibrant = ( value ) => {
184+ vibrant = value ;
185+ setMdColorScheme ( ) ;
186+ }
187+
129188 $on ( 'pageInit' , ( ) => {
130189 let timeout ;
131190 colorPicker = $f7 . colorPicker . create ( {
152211 return $render ;
153212 } ;
154213
155- </ script >
214+ </ script >
0 commit comments