-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #263 from openzim/configure-ui-colors
Add support for color CLI arguments in new UI
- Loading branch information
Showing
10 changed files
with
94 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,47 @@ | ||
import 'vuetify/styles' | ||
import '@mdi/font/css/materialdesignicons.css' | ||
import { createVuetify } from 'vuetify' | ||
import type { Config } from '@/types/Channel' | ||
|
||
export default createVuetify() | ||
async function loadVuetify() { | ||
let primaryColor = '#000000' | ||
let secondaryColor = '#FFFFFF' | ||
|
||
// Load primary and secondary colors from config.json | ||
try { | ||
const response = await fetch('./config.json') | ||
if (response.ok) { | ||
const config: Config = await response.json() | ||
primaryColor = config.mainColor || primaryColor | ||
secondaryColor = config.secondaryColor || secondaryColor | ||
} else { | ||
console.error('Failed to fetch config.json') | ||
} | ||
} catch (error) { | ||
console.error('Error loading config:', error) | ||
} | ||
|
||
const zimuiTheme = { | ||
colors: { | ||
background: secondaryColor, | ||
surface: secondaryColor, | ||
primary: primaryColor | ||
} | ||
} | ||
|
||
return createVuetify({ | ||
theme: { | ||
defaultTheme: 'zimuiTheme', | ||
variations: { | ||
colors: ['background', 'primary'], | ||
lighten: 2, | ||
darken: 2 | ||
}, | ||
themes: { | ||
zimuiTheme | ||
} | ||
} | ||
}) | ||
} | ||
|
||
export default loadVuetify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters