Add wiz theme

This commit is contained in:
natsoni
2024-04-09 16:15:05 +09:00
parent 69c3c3162c
commit 7f6ab0b854
6 changed files with 110 additions and 6 deletions

View File

@@ -69,7 +69,7 @@ export default class BlockScene {
}
setColorFunction(colorFunction: ((tx: TxView) => Color) | null): void {
this.theme.theme !== 'default' ? this.getColor = colorFunction || contrastColorFunction : this.getColor = colorFunction || defaultColorFunction;
this.theme.theme === 'contrast' ? this.getColor = colorFunction || contrastColorFunction : this.getColor = colorFunction || defaultColorFunction;
this.updateAllColors();
}
@@ -246,7 +246,7 @@ export default class BlockScene {
this.flip = flip;
this.vertexArray = vertexArray;
this.highlightingEnabled = highlighting;
theme.theme !== 'default' ? this.getColor = colorFunction || contrastColorFunction : this.getColor = colorFunction || defaultColorFunction;
theme.theme === 'contrast' ? this.getColor = colorFunction || contrastColorFunction : this.getColor = colorFunction || defaultColorFunction;
this.theme = theme;
this.scene = {

View File

@@ -2,5 +2,6 @@
<select formControlName="theme" class="custom-select custom-select-sm form-control-secondary form-control mx-auto" (change)="changeTheme()">
<option value="default" i18n="mempool-goggles.classic">Classic</option>
<option value="contrast">BlueMatt</option>
<option value="wiz">Wiz</option>
</select>
</div>

View File

@@ -10,7 +10,7 @@ import { ThemeService } from '../../services/theme.service';
})
export class ThemeSelectorComponent implements OnInit {
themeForm: UntypedFormGroup;
themes = ['default', 'contrast'];
themes = ['default', 'contrast', 'wiz'];
constructor(
private formBuilder: UntypedFormBuilder,

View File

@@ -22,9 +22,7 @@ export class ThemeService {
apply(theme) {
this.theme = theme;
if (theme !== 'default') {
if (theme === 'contrast') {
this.mempoolFeeColors = contrastMempoolFeeColors;
}
theme === 'contrast' ? this.mempoolFeeColors = contrastMempoolFeeColors : this.mempoolFeeColors = defaultMempoolFeeColors;
try {
if (!this.style) {
this.style = document.createElement('link');