rebuild style for settings section
This commit is contained in:
parent
8bf7afddd2
commit
bd828e697c
11 changed files with 562 additions and 418 deletions
|
|
@ -21,9 +21,8 @@
|
|||
|
||||
<div class="setting__section" data-setting="font" :class="{ 'setting-disabled': !settingEnabled.font }" @click="onSubsectionClick('font')">
|
||||
<div class="setting__header">
|
||||
<input type="checkbox" class="toggle-setting" :checked="settingEnabled.font" @change="onToggleSetting('font', $event.target.checked)" />
|
||||
<input type="checkbox" id="toggle-font" class="toggle-setting" :checked="settingEnabled.font" @change="onToggleSetting('font', $event.target.checked)" /><label for="toggle-font" aria-label="Activer le réglage de police" @click.stop></label>
|
||||
<label class="label-with-tooltip" data-css="font-family">Police</label>
|
||||
<p class="info-default">Valeur par défaut : {{ textDefaults.fontFamily === 'sans-serif' ? 'Police système (sans-serif)' : textDefaults.fontFamily }}</p>
|
||||
</div>
|
||||
<div class="setting__body">
|
||||
<select v-model="fontFamily">
|
||||
|
|
@ -31,23 +30,23 @@
|
|||
<option v-for="f in projectFonts" :key="f.name" :value="f.name" :style="{ fontFamily: `'${f.name}', ${f.category}` }">{{ f.name }}</option>
|
||||
</select>
|
||||
<div class="field-checkbox">
|
||||
<input type="checkbox" v-model="italic" />
|
||||
<label class="label-with-tooltip" data-css="font-style">Italique</label>
|
||||
<input type="checkbox" id="field-italic" v-model="italic" />
|
||||
<label for="field-italic" class="label-with-tooltip" data-css="font-style: italic">Italique</label>
|
||||
</div>
|
||||
<div class="field-checkbox">
|
||||
<input type="checkbox" v-model="bold" />
|
||||
<label class="label-with-tooltip" data-css="font-weight">Gras</label>
|
||||
<input type="checkbox" id="field-bold" v-model="bold" />
|
||||
<label for="field-bold" class="label-with-tooltip" data-css="font-weight: bold">Gras</label>
|
||||
</div>
|
||||
</div>
|
||||
<p class="info-default">Valeur par défaut : {{ textDefaults.fontFamily === 'sans-serif' ? 'Police système (sans-serif)' : textDefaults.fontFamily }}</p>
|
||||
</div>
|
||||
|
||||
<!-- Font Size -->
|
||||
|
||||
<div class="setting__section" data-setting="fontSize" :class="{ 'setting-disabled': !settingEnabled.fontSize }" @click="onSubsectionClick('fontSize')">
|
||||
<div class="setting__header">
|
||||
<input type="checkbox" class="toggle-setting" :checked="settingEnabled.fontSize" @change="onToggleSetting('fontSize', $event.target.checked)" />
|
||||
<input type="checkbox" id="toggle-fontSize" class="toggle-setting" :checked="settingEnabled.fontSize" @change="onToggleSetting('fontSize', $event.target.checked)" /><label for="toggle-fontSize" aria-label="Activer le réglage de taille du texte" @click.stop></label>
|
||||
<label class="label-with-tooltip" data-css="font-size">Taille du texte</label>
|
||||
<p class="info-default">Valeur par défaut : {{ textDefaults.fontSize.value }}{{ textDefaults.fontSize.unit }}</p>
|
||||
</div>
|
||||
<div class="setting__body">
|
||||
<InputWithUnit
|
||||
|
|
@ -58,15 +57,15 @@
|
|||
showRange
|
||||
/>
|
||||
</div>
|
||||
<p class="info-default">Valeur par défaut : {{ textDefaults.fontSize.value }}{{ textDefaults.fontSize.unit }}</p>
|
||||
</div>
|
||||
|
||||
<!-- LineHeight -->
|
||||
|
||||
<div class="setting__section" data-setting="lineHeight" :class="{ 'setting-disabled': !settingEnabled.lineHeight }" @click="onSubsectionClick('lineHeight')">
|
||||
<div class="setting__header">
|
||||
<input type="checkbox" class="toggle-setting" :checked="settingEnabled.lineHeight" @change="onToggleSetting('lineHeight', $event.target.checked)" />
|
||||
<input type="checkbox" id="toggle-lineHeight" class="toggle-setting" :checked="settingEnabled.lineHeight" @change="onToggleSetting('lineHeight', $event.target.checked)" /><label for="toggle-lineHeight" aria-label="Activer le réglage d'interlignage" @click.stop></label>
|
||||
<label class="label-with-tooltip" data-css="line-height">Interlignage</label>
|
||||
<p class="info-default">Valeur par défaut : {{ textDefaults.lineHeight.value }}{{ textDefaults.lineHeight.unit }}</p>
|
||||
</div>
|
||||
<div class="setting__body">
|
||||
<InputWithUnit
|
||||
|
|
@ -77,13 +76,14 @@
|
|||
showRange
|
||||
/>
|
||||
</div>
|
||||
<p class="info-default">Valeur par défaut : {{ textDefaults.lineHeight.value }}{{ textDefaults.lineHeight.unit }}</p>
|
||||
</div>
|
||||
|
||||
<!-- Text Alignment -->
|
||||
|
||||
<div class="setting__section" data-setting="textAlign" :class="{ 'setting-disabled': !settingEnabled.textAlign }" @click="onSubsectionClick('textAlign')">
|
||||
<div class="setting__header">
|
||||
<input type="checkbox" class="toggle-setting" :checked="settingEnabled.textAlign" @change="onToggleSetting('textAlign', $event.target.checked)" />
|
||||
<input type="checkbox" id="toggle-textAlign" class="toggle-setting" :checked="settingEnabled.textAlign" @change="onToggleSetting('textAlign', $event.target.checked)" /><label for="toggle-textAlign" aria-label="Activer le réglage d'alignement" @click.stop></label>
|
||||
<label class="label-with-tooltip" data-css="text-align">Alignement</label>
|
||||
</div>
|
||||
<div class="setting__body">
|
||||
|
|
@ -100,9 +100,8 @@
|
|||
|
||||
<div class="setting__section" data-setting="color" :class="{ 'setting-disabled': !settingEnabled.color }" @click="onSubsectionClick('color')">
|
||||
<div class="setting__header">
|
||||
<input type="checkbox" class="toggle-setting" :checked="settingEnabled.color" @change="onToggleSetting('color', $event.target.checked)" />
|
||||
<input type="checkbox" id="toggle-color" class="toggle-setting" :checked="settingEnabled.color" @change="onToggleSetting('color', $event.target.checked)" /><label for="toggle-color" aria-label="Activer le réglage de couleur du texte" @click.stop></label>
|
||||
<label class="label-with-tooltip" data-css="color">Couleur du texte</label>
|
||||
<p class="info-default">Valeur par défaut : {{ textDefaults.color }}</p>
|
||||
</div>
|
||||
<div class="setting__body">
|
||||
<div class="input-with-color">
|
||||
|
|
@ -114,13 +113,15 @@
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<p class="info-default">Valeur par défaut : {{ textDefaults.color }}</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Background -->
|
||||
|
||||
<div class="setting__section" data-setting="background" :class="{ 'setting-disabled': !settingEnabled.background }" @click="onSubsectionClick('background')">
|
||||
<div class="setting__header">
|
||||
<input type="checkbox" class="toggle-setting" :checked="settingEnabled.background" @change="onToggleSetting('background', $event.target.checked)" />
|
||||
<input type="checkbox" id="toggle-background" class="toggle-setting" :checked="settingEnabled.background" @change="onToggleSetting('background', $event.target.checked)" /><label for="toggle-background" aria-label="Activer le réglage d'arrière-plan" @click.stop></label>
|
||||
<label class="label-with-tooltip" data-css="background">Arrière-plan</label>
|
||||
</div>
|
||||
<div class="setting__body">
|
||||
|
|
@ -139,7 +140,7 @@
|
|||
|
||||
<div class="setting__section" data-setting="border" :class="{ 'setting-disabled': !settingEnabled.border }" @click="onSubsectionClick('border')">
|
||||
<div class="setting__header">
|
||||
<input type="checkbox" class="toggle-setting" :checked="settingEnabled.border" @change="onToggleSetting('border', $event.target.checked)" />
|
||||
<input type="checkbox" id="toggle-border" class="toggle-setting" :checked="settingEnabled.border" @change="onToggleSetting('border', $event.target.checked)" /><label for="toggle-border" aria-label="Activer le réglage de bordure" @click.stop></label>
|
||||
<label class="label-with-tooltip" data-css="border">Bordure</label>
|
||||
</div>
|
||||
<div class="setting__body">
|
||||
|
|
@ -185,7 +186,7 @@
|
|||
|
||||
<div class="setting__section" data-setting="margin" :class="{ 'setting-disabled': !settingEnabled.margin }" @click="onSubsectionClick('margin')">
|
||||
<div class="setting__header">
|
||||
<input type="checkbox" class="toggle-setting" :checked="settingEnabled.margin" @change="onToggleSetting('margin', $event.target.checked)" />
|
||||
<input type="checkbox" id="toggle-margin" class="toggle-setting" :checked="settingEnabled.margin" @change="onToggleSetting('margin', $event.target.checked)" /><label for="toggle-margin" aria-label="Activer le réglage de marges extérieures" @click.stop></label>
|
||||
<label class="label-with-tooltip" data-css="margin">Marges extérieures</label>
|
||||
<button
|
||||
type="button"
|
||||
|
|
@ -239,7 +240,7 @@
|
|||
|
||||
<div class="setting__section" data-setting="padding" :class="{ 'setting-disabled': !settingEnabled.padding }" @click="onSubsectionClick('padding')">
|
||||
<div class="setting__header">
|
||||
<input type="checkbox" class="toggle-setting" :checked="settingEnabled.padding" @change="onToggleSetting('padding', $event.target.checked)" />
|
||||
<input type="checkbox" id="toggle-padding" class="toggle-setting" :checked="settingEnabled.padding" @change="onToggleSetting('padding', $event.target.checked)" /><label for="toggle-padding" aria-label="Activer le réglage de marges intérieures" @click.stop></label>
|
||||
<label class="label-with-tooltip" data-css="padding">Marges intérieures</label>
|
||||
<button
|
||||
type="button"
|
||||
|
|
@ -412,27 +413,18 @@ defineExpose({ handleIframeClick, close: handleClose, visible });
|
|||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
/* Setting section structure */
|
||||
.setting__header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
}
|
||||
|
||||
.setting__body {
|
||||
padding-left: 1.25rem;
|
||||
}
|
||||
|
||||
/* Toggle setting checkbox */
|
||||
.toggle-setting {
|
||||
/* .toggle-setting {
|
||||
cursor: pointer;
|
||||
accent-color: var(--color-purple, #7c3aed);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
} */
|
||||
|
||||
/* Disabled state: grey out body but keep header interactive */
|
||||
/* Clicking anywhere on the section enables it */
|
||||
.setting-disabled {
|
||||
/* .setting-disabled {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
|
@ -466,5 +458,5 @@ defineExpose({ handleIframeClick, close: handleClose, visible });
|
|||
.lock-toggle:disabled {
|
||||
opacity: 0.4;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
} */
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
<template>
|
||||
|
||||
<div class="input-with-unit">
|
||||
<input
|
||||
<input
|
||||
v-if="showRange"
|
||||
type="range"
|
||||
:value="modelValue.value"
|
||||
:min="min"
|
||||
:max="max"
|
||||
:step="step"
|
||||
:style="{ '--progress': rangeProgress + '%' }"
|
||||
@input="updateValue(Number($event.target.value))"
|
||||
/>
|
||||
|
||||
<NumberInput
|
||||
:modelValue="modelValue.value"
|
||||
:min="min"
|
||||
|
|
@ -27,6 +30,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import NumberInput from './NumberInput.vue';
|
||||
import UnitToggle from './UnitToggle.vue';
|
||||
import { convertUnit } from '../../utils/unit-conversion';
|
||||
|
|
@ -61,6 +65,10 @@ const props = defineProps({
|
|||
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
|
||||
const rangeProgress = computed(() => {
|
||||
return ((props.modelValue.value - props.min) / (props.max - props.min)) * 100;
|
||||
});
|
||||
|
||||
const updateValue = (value) => {
|
||||
emit('update:modelValue', { ...props.modelValue, value });
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue