pleroma-fe/src/components/component_preview/component_preview.vue

115 lines
2.9 KiB
Vue
Raw Normal View History

<template>
<div
2025-07-03 00:20:48 +03:00
:id="'component-preview-' + randomSeed"
2024-10-02 16:31:30 +03:00
class="ComponentPreview"
:class="{ '-shadow-controls': shadowControl }"
>
2024-10-02 16:31:30 +03:00
<label
v-show="shadowControl"
role="heading"
2024-10-02 16:31:30 +03:00
class="header"
:class="{ faint: disabled }"
>
{{ $t('settings.style.shadows.offset') }}
</label>
<label
v-show="shadowControl && !hideControls"
class="x-shift-number"
>
{{ $t('settings.style.shadows.offset-x') }}
<input
:value="shadow?.x"
:disabled="disabled"
:class="{ disabled }"
class="input input-number"
type="number"
@input="e => updateProperty('x', e.target.value)"
>
</label>
<label
v-show="shadowControl && !hideControls"
2024-12-22 15:08:42 +02:00
class="y-shift-number"
>
{{ $t('settings.style.shadows.offset-y') }}
<input
:value="shadow?.y"
:disabled="disabled"
:class="{ disabled }"
class="input input-number"
type="number"
@input="e => updateProperty('y', e.target.value)"
>
</label>
2024-10-02 16:31:30 +03:00
<input
v-show="shadowControl && !hideControls"
:value="shadow?.x"
2024-10-02 16:31:30 +03:00
:disabled="disabled"
:class="{ disabled }"
class="input input-range x-shift-slider"
type="range"
max="20"
min="-20"
@input="e => updateProperty('x', e.target.value)"
2024-10-02 16:31:30 +03:00
>
<input
v-show="shadowControl && !hideControls"
2024-10-02 16:31:30 +03:00
:value="shadow?.y"
:disabled="disabled"
:class="{ disabled }"
class="input input-range y-shift-slider"
type="range"
max="20"
min="-20"
@input="e => updateProperty('y', e.target.value)"
>
<div
2024-10-02 16:31:30 +03:00
class="preview-window"
:class="{ '-light-grid': lightGrid }"
>
2024-10-02 16:31:30 +03:00
<div
class="preview-block"
:class="previewClass"
>
2024-10-08 19:55:26 +03:00
{{ $t('settings.style.themes3.editor.test_string') }}
2024-10-02 16:31:30 +03:00
</div>
2024-12-22 15:08:42 +02:00
<div
v-if="invalid"
class="invalid-container"
>
<div class="alert error invalid-label">
{{ $t('settings.style.themes3.editor.invalid') }}
</div>
</div>
</div>
<div class="assists">
<Checkbox
v-model="lightGrid"
name="lightGrid"
class="input-light-grid"
>
{{ $t('settings.style.shadows.light_grid') }}
</Checkbox>
<div class="style-control">
<label class="label">
{{ $t('settings.style.shadows.zoom') }}
</label>
<input
v-model="zoom"
class="input input-number y-shift-number"
type="number"
>
</div>
<ColorInput
2024-10-26 19:48:48 +03:00
v-if="!noColorControl"
v-model="colorOverride"
2024-12-22 15:08:42 +02:00
class="input-color-input"
fallback="#606060"
2025-11-25 23:07:02 +02:00
:compact="true"
:label="$t('settings.style.shadows.color_override')"
/>
</div>
</div>
</template>
2025-07-02 00:36:37 +03:00
<script src="./component_preview.js" />
<style src="./component_preview.scss" lang="scss" />