Compare commits
No commits in common. "8e3eb83431594aadc70f1d32be02acdad2d44aef" and "3bd6c7ca19082210cabeec3697ed74cd01c841d3" have entirely different histories.
8e3eb83431
...
3bd6c7ca19
3 changed files with 475 additions and 416 deletions
|
|
@ -79,7 +79,7 @@ input[type="number"] {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
|
||||||
label {
|
label {
|
||||||
width: 30%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-with-unit {
|
.input-with-unit {
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ input[type=number] {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
.settings-section .settings-subsection.margins .field label {
|
.settings-section .settings-subsection.margins .field label {
|
||||||
width: 30%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
.settings-section .settings-subsection.margins .field .input-with-unit input {
|
.settings-section .settings-subsection.margins .field .input-with-unit input {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
pouvez modifier ensuite les éléments indépendamment.
|
pouvez modifier ensuite les éléments indépendamment.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="settings-subsection">
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="text-font">Police</label>
|
<label for="text-font">Police</label>
|
||||||
<div class="field-with-option">
|
<div class="field-with-option">
|
||||||
|
|
@ -23,12 +22,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="settings-subsection">
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label>Graisse</label>
|
<label>Graisse</label>
|
||||||
<div class="unit-toggle">
|
<div class="weight-toggle">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
:class="{ active: weight === '200' }"
|
:class="{ active: weight === '200' }"
|
||||||
|
|
@ -80,9 +77,7 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="settings-subsection">
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="text-size-range">Taille du texte</label>
|
<label for="text-size-range">Taille du texte</label>
|
||||||
<div class="input-with-unit">
|
<div class="input-with-unit">
|
||||||
|
|
@ -127,9 +122,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="settings-subsection">
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="text-alignment">Alignement</label>
|
<label for="text-alignment">Alignement</label>
|
||||||
<select id="text-alignment" v-model="alignment">
|
<select id="text-alignment" v-model="alignment">
|
||||||
|
|
@ -139,37 +132,92 @@
|
||||||
<option value="justify">Justifié</option>
|
<option value="justify">Justifié</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="settings-subsection">
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="text-color">Couleur</label>
|
<label for="text-color">Couleur</label>
|
||||||
<div class="input-with-color">
|
<div class="field-with-color">
|
||||||
|
<input type="color" v-model="color.picker" class="color-picker" />
|
||||||
<input
|
<input
|
||||||
id="text-color"
|
id="text-color"
|
||||||
type="text"
|
type="text"
|
||||||
v-model="color.value"
|
v-model="color.value"
|
||||||
class="color-input"
|
class="color-input"
|
||||||
data-coloris
|
|
||||||
/>
|
/>
|
||||||
|
<div class="unit-toggle">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
:class="{ active: color.format === 'rgb' }"
|
||||||
|
@click="color.format = 'rgb'"
|
||||||
|
>
|
||||||
|
rgb
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
:class="{ active: color.format === 'hex' }"
|
||||||
|
@click="color.format = 'hex'"
|
||||||
|
>
|
||||||
|
hex
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="clear-btn"
|
||||||
|
@click="clearColor"
|
||||||
|
title="Réinitialiser"
|
||||||
|
>
|
||||||
|
×
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="text-background">Arrière-plan</label>
|
<label for="text-background">Arrière-plan</label>
|
||||||
<div class="input-with-color">
|
<div class="field-with-color">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="toggle-btn"
|
||||||
|
:class="{ active: background.enabled }"
|
||||||
|
@click="background.enabled = !background.enabled"
|
||||||
|
>
|
||||||
|
×
|
||||||
|
</button>
|
||||||
<input
|
<input
|
||||||
id="text-background"
|
id="text-background"
|
||||||
type="text"
|
type="text"
|
||||||
v-model="background.value"
|
v-model="background.value"
|
||||||
|
:disabled="!background.enabled"
|
||||||
class="color-input"
|
class="color-input"
|
||||||
data-coloris
|
|
||||||
/>
|
/>
|
||||||
|
<div class="unit-toggle">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
:class="{ active: background.format === 'rgb' }"
|
||||||
|
:disabled="!background.enabled"
|
||||||
|
@click="background.format = 'rgb'"
|
||||||
|
>
|
||||||
|
rgb
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
:class="{ active: background.format === 'hex' }"
|
||||||
|
:disabled="!background.enabled"
|
||||||
|
@click="background.format = 'hex'"
|
||||||
|
>
|
||||||
|
hex
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="clear-btn"
|
||||||
|
:disabled="!background.enabled"
|
||||||
|
@click="clearBackground"
|
||||||
|
title="Effacer"
|
||||||
|
>
|
||||||
|
×
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="settings-subsection">
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="margin-outer">Marges extérieures</label>
|
<label for="margin-outer">Marges extérieures</label>
|
||||||
<div class="input-with-unit">
|
<div class="input-with-unit">
|
||||||
|
|
@ -320,9 +368,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="settings-subsection">
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="margin-inner">Marges intérieures</label>
|
<label for="margin-inner">Marges intérieures</label>
|
||||||
<div class="input-with-unit">
|
<div class="input-with-unit">
|
||||||
|
|
@ -473,14 +519,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch, onMounted } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { useStylesheetStore } from '../../stores/stylesheet';
|
import { useStylesheetStore } from '../../stores/stylesheet';
|
||||||
import Coloris from '@melloware/coloris';
|
|
||||||
|
|
||||||
const stylesheetStore = useStylesheetStore();
|
const stylesheetStore = useStylesheetStore();
|
||||||
|
|
||||||
|
|
@ -514,14 +558,27 @@ const alignment = ref('left');
|
||||||
|
|
||||||
// Color
|
// Color
|
||||||
const color = ref({
|
const color = ref({
|
||||||
|
picker: '#000000',
|
||||||
value: 'rgb(250, 250, 250)',
|
value: 'rgb(250, 250, 250)',
|
||||||
|
format: 'rgb',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const clearColor = () => {
|
||||||
|
color.value.picker = '#000000';
|
||||||
|
color.value.value = '';
|
||||||
|
};
|
||||||
|
|
||||||
// Background
|
// Background
|
||||||
const background = ref({
|
const background = ref({
|
||||||
|
enabled: false,
|
||||||
value: 'transparent',
|
value: 'transparent',
|
||||||
|
format: 'hex',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const clearBackground = () => {
|
||||||
|
background.value.value = 'transparent';
|
||||||
|
};
|
||||||
|
|
||||||
// Margin outer
|
// Margin outer
|
||||||
const marginOuter = ref({
|
const marginOuter = ref({
|
||||||
value: 23,
|
value: 23,
|
||||||
|
|
@ -602,7 +659,7 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// Color - debounced for text value
|
// Color - debounced for text value, immediate for format and picker
|
||||||
watch(
|
watch(
|
||||||
() => color.value.value,
|
() => color.value.value,
|
||||||
() => {
|
() => {
|
||||||
|
|
@ -613,7 +670,17 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// Background - debounced for value
|
watch(
|
||||||
|
() => [color.value.format, color.value.picker],
|
||||||
|
() => {
|
||||||
|
if (isUpdatingFromStore) return;
|
||||||
|
immediateUpdate(() => {
|
||||||
|
// TODO: implement color update
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// Background - debounced for value, immediate for format and enabled
|
||||||
watch(
|
watch(
|
||||||
() => background.value.value,
|
() => background.value.value,
|
||||||
() => {
|
() => {
|
||||||
|
|
@ -624,6 +691,16 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => [background.value.format, background.value.enabled],
|
||||||
|
() => {
|
||||||
|
if (isUpdatingFromStore) return;
|
||||||
|
immediateUpdate(() => {
|
||||||
|
// TODO: implement background update
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// Margin outer - debounced for value, immediate for unit
|
// Margin outer - debounced for value, immediate for unit
|
||||||
watch(
|
watch(
|
||||||
() => marginOuter.value.value,
|
() => marginOuter.value.value,
|
||||||
|
|
@ -727,22 +804,4 @@ watch(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
Coloris.init();
|
|
||||||
Coloris({
|
|
||||||
themeMode: 'dark',
|
|
||||||
alpha: true,
|
|
||||||
format: 'auto',
|
|
||||||
formatToggle: true,
|
|
||||||
swatches: [
|
|
||||||
'#000000',
|
|
||||||
'#FFFFFF',
|
|
||||||
'#FF0000',
|
|
||||||
'#00FF00',
|
|
||||||
'#0000FF',
|
|
||||||
'transparent',
|
|
||||||
],
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue