This commit is contained in:
Henry Jameson 2024-10-02 16:30:07 +03:00
parent 2eb8e1e095
commit e876c98d5e
3 changed files with 41 additions and 32 deletions

View file

@ -15,14 +15,14 @@
class="btn button-default" class="btn button-default"
@click="importPalette" @click="importPalette"
> >
<FAIcon icon="file-import"/> <FAIcon icon="file-import" />
{{ $t('settings.style.themes3.palette.import') }} {{ $t('settings.style.themes3.palette.import') }}
</button> </button>
<button <button
class="btn button-default" class="btn button-default"
@click="exportPalette" @click="exportPalette"
> >
<FAIcon icon="file-export"/> <FAIcon icon="file-export" />
{{ $t('settings.style.themes3.palette.export') }} {{ $t('settings.style.themes3.palette.export') }}
</button> </button>
</div> </div>

View file

@ -1,16 +1,19 @@
<template> <template>
<div class="appearance-tab" :label="$t('settings.general')"> <div
class="appearance-tab"
:label="$t('settings.general')"
>
<div class="setting-item"> <div class="setting-item">
<h2>{{ $t('settings.theme') }}</h2> <h2>{{ $t('settings.theme') }}</h2>
<ul <ul
class="theme-list"
ref="themeList" ref="themeList"
class="theme-list"
> >
<button <button
class="button-default theme-preview" class="button-default theme-preview"
data-theme-key="stock" data-theme-key="stock"
@click="resetTheming"
:class="{ toggled: isStyleActive('stock') }" :class="{ toggled: isStyleActive('stock') }"
@click="resetTheming"
> >
<!-- eslint-disable vue/no-v-text-v-html-on-component --> <!-- eslint-disable vue/no-v-text-v-html-on-component -->
<component <component
@ -37,8 +40,8 @@
</button> </button>
<button <button
v-for="style in availableStyles" v-for="style in availableStyles"
:data-theme-key="style.key"
:key="style.key" :key="style.key"
:data-theme-key="style.key"
class="button-default theme-preview" class="button-default theme-preview"
:class="{ toggled: isThemeActive(style.key) }" :class="{ toggled: isThemeActive(style.key) }"
@click="setTheme(style.key)" @click="setTheme(style.key)"
@ -50,7 +53,7 @@
v-html="previewTheme(style.key, style.data)" v-html="previewTheme(style.key, style.data)"
/> />
<!-- eslint-enable vue/no-v-text-v-html-on-component --> <!-- eslint-enable vue/no-v-text-v-html-on-component -->
<preview :id="'theme-preview-' + style.key"/> <preview :id="'theme-preview-' + style.key" />
<h4 class="theme-name"> <h4 class="theme-name">
{{ style.name }} {{ style.name }}
<span class="alert neutral version">{{ style.version }}</span> <span class="alert neutral version">{{ style.version }}</span>
@ -61,9 +64,9 @@
<div class="palettes"> <div class="palettes">
<button <button
v-for="p in availablePalettes" v-for="p in availablePalettes"
:key="p.name"
class="btn button-default palette-entry" class="btn button-default palette-entry"
:class="{ toggled: isPaletteActive(p.key) }" :class="{ toggled: isPaletteActive(p.key) }"
:key="p.name"
@click="() => setPalette(p.key)" @click="() => setPalette(p.key)"
> >
<label> <label>
@ -104,7 +107,7 @@
<code>px</code> <code>px</code>
<code>rem</code> <code>rem</code>
</i18n-t> </i18n-t>
<br/> <br>
<i18n-t <i18n-t
scope="global" scope="global"
keypath="settings.text_size_tip2" keypath="settings.text_size_tip2"

View file

@ -58,13 +58,19 @@
{{ ' ' }} {{ ' ' }}
</label> </label>
<Select <Select
v-model="editedPalette"
id="palette-selector" id="palette-selector"
v-model="editedPalette"
>
<option
key="dark"
value="dark"
> >
<option key="dark" value="dark">
{{ $t('settings.style.themes3.palette.dark') }} {{ $t('settings.style.themes3.palette.dark') }}
</option> </option>
<option key="light" value="light"> <option
key="light"
value="light"
>
{{ $t('settings.style.themes3.palette.light') }} {{ $t('settings.style.themes3.palette.light') }}
</option> </option>
</Select> </Select>
@ -78,8 +84,8 @@
{{ ' ' }} {{ ' ' }}
</label> </label>
<Select <Select
v-model="selectedComponentKey"
id="component-selector" id="component-selector"
v-model="selectedComponentKey"
> >
<option <option
v-for="key in componentKeys" v-for="key in componentKeys"
@ -91,8 +97,8 @@
</Select> </Select>
</div> </div>
<div <div
class="variant-selector"
v-if="selectedComponentVariantsAll.length > 1" v-if="selectedComponentVariantsAll.length > 1"
class="variant-selector"
> >
<label for="variant-selector"> <label for="variant-selector">
{{ $t('settings.style.themes3.editor.variant_selector') }} {{ $t('settings.style.themes3.editor.variant_selector') }}
@ -102,16 +108,16 @@
> >
<option <option
v-for="variant in selectedComponentVariantsAll" v-for="variant in selectedComponentVariantsAll"
:value="variant"
:key="'component-variant-' + variant" :key="'component-variant-' + variant"
:value="variant"
> >
{{ fallbackI18n($t(getVariantPath(selectedComponentName, variant)), variant) }} {{ fallbackI18n($t(getVariantPath(selectedComponentName, variant)), variant) }}
</option> </option>
</Select> </Select>
</div> </div>
<div <div
class="state-selector"
v-if="selectedComponentStates.length > 0" v-if="selectedComponentStates.length > 0"
class="state-selector"
> >
<label> <label>
{{ $t('settings.style.themes3.editor.states_selector') }} {{ $t('settings.style.themes3.editor.states_selector') }}
@ -141,10 +147,10 @@
<!-- eslint-enable vue/no-v-html vue/no-v-text-v-html-on-component --> <!-- eslint-enable vue/no-v-html vue/no-v-text-v-html-on-component -->
<ComponentPreview <ComponentPreview
class="component-preview" class="component-preview"
:showText="componentHas('Text')" :show-text="componentHas('Text')"
:shadowControl="isShadowTabOpen" :shadow-control="isShadowTabOpen"
:previewClass="previewClass" :preview-class="previewClass"
:previewStyle="editorHintStyle" :preview-style="editorHintStyle"
:disabled="!editedSubShadow" :disabled="!editedSubShadow"
:shadow="editedSubShadow" :shadow="editedSubShadow"
@update:shadow="({ axis, value }) => updateSubShadow(axis, value)" @update:shadow="({ axis, value }) => updateSubShadow(axis, value)"
@ -156,9 +162,9 @@
:on-switch="onTabSwitch" :on-switch="onTabSwitch"
> >
<div <div
key="main"
class="editor-tab" class="editor-tab"
:label="$t('settings.style.themes3.editor.main_tab')" :label="$t('settings.style.themes3.editor.main_tab')"
key="main"
> >
<ColorInput <ColorInput
v-model="editedBackgroundColor" v-model="editedBackgroundColor"
@ -177,10 +183,10 @@
<Checkbox v-model="isOpacityPresent" /> <Checkbox v-model="isOpacityPresent" />
</Tooltip> </Tooltip>
<ColorInput <ColorInput
v-if="componentHas('Text')"
v-model="editedTextColor" v-model="editedTextColor"
:label="$t('settings.style.themes3.editor.text_color')" :label="$t('settings.style.themes3.editor.text_color')"
:disabled="!isTextColorPresent" :disabled="!isTextColorPresent"
v-if="componentHas('Text')"
/> />
<Tooltip <Tooltip
v-if="componentHas('Text')" v-if="componentHas('Text')"
@ -225,10 +231,10 @@
<!-- spacer for missing checkbox --> <!-- spacer for missing checkbox -->
</div> </div>
<ColorInput <ColorInput
v-if="componentHas('Link')"
v-model="editedLinkColor" v-model="editedLinkColor"
:label="$t('settings.style.themes3.editor.link_color')" :label="$t('settings.style.themes3.editor.link_color')"
:disabled="!isLinkColorPresent" :disabled="!isLinkColorPresent"
v-if="componentHas('Link')"
/> />
<Tooltip <Tooltip
v-if="componentHas('Link')" v-if="componentHas('Link')"
@ -237,10 +243,10 @@
<Checkbox v-model="isLinkColorPresent" /> <Checkbox v-model="isLinkColorPresent" />
</Tooltip> </Tooltip>
<ColorInput <ColorInput
v-if="componentHas('Icon')"
v-model="editedIconColor" v-model="editedIconColor"
:label="$t('settings.style.themes3.editor.icon_color')" :label="$t('settings.style.themes3.editor.icon_color')"
:disabled="!isIconColorPresent" :disabled="!isIconColorPresent"
v-if="componentHas('Icon')"
/> />
<Tooltip <Tooltip
v-if="componentHas('Icon')" v-if="componentHas('Icon')"
@ -250,13 +256,13 @@
</Tooltip> </Tooltip>
</div> </div>
<div <div
key="shadow"
class="editor-tab shadow-tab" class="editor-tab shadow-tab"
:label="$t('settings.style.themes3.editor.shadows_tab')" :label="$t('settings.style.themes3.editor.shadows_tab')"
key="shadow"
> >
<Checkbox <Checkbox
class="style-control"
v-model="isShadowPresent" v-model="isShadowPresent"
class="style-control"
> >
{{ $t('settings.style.themes3.editor.include_in_rule') }} {{ $t('settings.style.themes3.editor.include_in_rule') }}
</checkbox> </checkbox>