feat(ui-config): add button golden gradient and shadow toggle switch
This commit is contained in:
@@ -80,6 +80,7 @@ export function createDefaultKhanegiUiConfig() {
|
|||||||
light: { ...navyGoldLight },
|
light: { ...navyGoldLight },
|
||||||
},
|
},
|
||||||
borderRadius: { sm: 8, md: 12, lg: 16 },
|
borderRadius: { sm: 8, md: 12, lg: 16 },
|
||||||
|
buttonGradient: true,
|
||||||
},
|
},
|
||||||
navigation: {
|
navigation: {
|
||||||
type: 'both',
|
type: 'both',
|
||||||
|
|||||||
@@ -179,6 +179,21 @@ function onSidebarDragEnd() {
|
|||||||
const hasDefaultSnapshot = computed(() => Boolean(config.defaultSnapshot))
|
const hasDefaultSnapshot = computed(() => Boolean(config.defaultSnapshot))
|
||||||
const isCustom = computed(() => selectedPreset.value === 'custom')
|
const isCustom = computed(() => selectedPreset.value === 'custom')
|
||||||
|
|
||||||
|
const buttonGradientEnabled = computed({
|
||||||
|
get: () => (config.app?.theme as any)?.buttonGradient !== false,
|
||||||
|
set: (val: boolean) => {
|
||||||
|
if (!config.app.theme) return
|
||||||
|
;(config.app.theme as any).buttonGradient = val
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
function onButtonGradientChange(val: boolean) {
|
||||||
|
selectedPreset.value = 'custom'
|
||||||
|
config.app.theme.presetId = 'custom'
|
||||||
|
;(config.app.theme as any).buttonGradient = val
|
||||||
|
syncAdvancedJson()
|
||||||
|
}
|
||||||
|
|
||||||
/** رنگهای همان حالتی که در پیشنمایش دیده میشود (dark/light) */
|
/** رنگهای همان حالتی که در پیشنمایش دیده میشود (dark/light) */
|
||||||
const activePreviewColors = computed(() => {
|
const activePreviewColors = computed(() => {
|
||||||
const schemes = config.app.theme.schemes
|
const schemes = config.app.theme.schemes
|
||||||
@@ -576,6 +591,24 @@ onMounted(load)
|
|||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section class="form-section">
|
||||||
|
<div style="display: flex; align-items: center; justify-content: space-between; max-width: 520px">
|
||||||
|
<div>
|
||||||
|
<h3 style="margin: 0">سایه و گرادیانت طلایی دکمهها</h3>
|
||||||
|
<p class="page-sub" style="margin: 4px 0 0 0">
|
||||||
|
نمایش هاله و گرادیانت طلایی زیر دکمههای اصلی و فرمها در اپلیکیشن
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<a-switch
|
||||||
|
v-model:checked="buttonGradientEnabled"
|
||||||
|
:disabled="!isCustom"
|
||||||
|
checked-children="فعال"
|
||||||
|
un-checked-children="غیرفعال"
|
||||||
|
@change="onButtonGradientChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section class="form-section">
|
<section class="form-section">
|
||||||
<h3>رنگها {{ isCustom ? '(سفارشی)' : '(فقطخواندنی تا انتخاب سفارشی)' }}</h3>
|
<h3>رنگها {{ isCustom ? '(سفارشی)' : '(فقطخواندنی تا انتخاب سفارشی)' }}</h3>
|
||||||
<p v-if="isCustom" class="page-sub" style="margin-bottom: 12px">
|
<p v-if="isCustom" class="page-sub" style="margin-bottom: 12px">
|
||||||
|
|||||||
Reference in New Issue
Block a user