2018-11-19 12:40:25 +11:00
|
|
|
<template>
|
2019-07-05 17:17:44 +10:00
|
|
|
<div
|
|
|
|
class="shadow-control"
|
|
|
|
:class="{ disabled: !present }"
|
|
|
|
>
|
|
|
|
<div class="shadow-preview-container">
|
|
|
|
<div
|
2018-11-19 12:40:25 +11:00
|
|
|
:disabled="!present"
|
2019-07-05 17:17:44 +10:00
|
|
|
class="y-shift-control"
|
|
|
|
>
|
2018-11-19 12:40:25 +11:00
|
|
|
<input
|
|
|
|
v-model="selected.y"
|
|
|
|
:disabled="!present"
|
2019-07-05 17:17:44 +10:00
|
|
|
class="input-number"
|
|
|
|
type="number"
|
|
|
|
>
|
|
|
|
<div class="wrap">
|
|
|
|
<input
|
|
|
|
v-model="selected.y"
|
|
|
|
:disabled="!present"
|
|
|
|
class="input-range"
|
|
|
|
type="range"
|
|
|
|
max="20"
|
|
|
|
min="-20"
|
|
|
|
>
|
|
|
|
</div>
|
2018-11-19 12:40:25 +11:00
|
|
|
</div>
|
2019-07-05 17:17:44 +10:00
|
|
|
<div class="preview-window">
|
|
|
|
<div
|
|
|
|
class="preview-block"
|
|
|
|
:style="style"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div
|
2018-11-19 12:40:25 +11:00
|
|
|
:disabled="!present"
|
2019-07-05 17:17:44 +10:00
|
|
|
class="x-shift-control"
|
|
|
|
>
|
2018-11-19 12:40:25 +11:00
|
|
|
<input
|
|
|
|
v-model="selected.x"
|
|
|
|
:disabled="!present"
|
2019-07-05 17:17:44 +10:00
|
|
|
class="input-number"
|
|
|
|
type="number"
|
|
|
|
>
|
|
|
|
<div class="wrap">
|
|
|
|
<input
|
|
|
|
v-model="selected.x"
|
|
|
|
:disabled="!present"
|
|
|
|
class="input-range"
|
|
|
|
type="range"
|
|
|
|
max="20"
|
|
|
|
min="-20"
|
|
|
|
>
|
|
|
|
</div>
|
2018-11-19 12:40:25 +11:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-07-05 17:17:44 +10:00
|
|
|
<div class="shadow-tweak">
|
|
|
|
<div
|
|
|
|
:disabled="usingFallback"
|
|
|
|
class="id-control style-control"
|
|
|
|
>
|
|
|
|
<label
|
|
|
|
for="shadow-switcher"
|
|
|
|
class="select"
|
2018-11-22 12:25:15 +11:00
|
|
|
:disabled="!ready || usingFallback"
|
2019-07-05 17:17:44 +10:00
|
|
|
>
|
|
|
|
<select
|
|
|
|
id="shadow-switcher"
|
|
|
|
v-model="selectedId"
|
|
|
|
class="shadow-switcher"
|
|
|
|
:disabled="!ready || usingFallback"
|
|
|
|
>
|
|
|
|
<option
|
|
|
|
v-for="(shadow, index) in cValue"
|
2019-07-07 07:54:17 +10:00
|
|
|
:key="index"
|
2019-07-05 17:17:44 +10:00
|
|
|
:value="index"
|
|
|
|
>
|
|
|
|
{{ $t('settings.style.shadows.shadow_id', { value: index }) }}
|
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
<i class="icon-down-open" />
|
|
|
|
</label>
|
|
|
|
<button
|
|
|
|
class="btn btn-default"
|
|
|
|
:disabled="!ready || !present"
|
|
|
|
@click="del"
|
|
|
|
>
|
|
|
|
<i class="icon-cancel" />
|
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
class="btn btn-default"
|
|
|
|
:disabled="!moveUpValid"
|
|
|
|
@click="moveUp"
|
|
|
|
>
|
|
|
|
<i class="icon-up-open" />
|
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
class="btn btn-default"
|
|
|
|
:disabled="!moveDnValid"
|
|
|
|
@click="moveDn"
|
|
|
|
>
|
|
|
|
<i class="icon-down-open" />
|
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
class="btn btn-default"
|
|
|
|
:disabled="usingFallback"
|
|
|
|
@click="add"
|
|
|
|
>
|
|
|
|
<i class="icon-plus" />
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div
|
2018-11-19 12:40:25 +11:00
|
|
|
:disabled="!present"
|
2019-07-05 17:17:44 +10:00
|
|
|
class="inset-control style-control"
|
|
|
|
>
|
|
|
|
<label
|
|
|
|
for="inset"
|
|
|
|
class="label"
|
|
|
|
>
|
|
|
|
{{ $t('settings.style.shadows.inset') }}
|
|
|
|
</label>
|
|
|
|
<input
|
|
|
|
id="inset"
|
|
|
|
v-model="selected.inset"
|
|
|
|
:disabled="!present"
|
|
|
|
name="inset"
|
|
|
|
class="input-inset"
|
|
|
|
type="checkbox"
|
|
|
|
>
|
|
|
|
<label
|
|
|
|
class="checkbox-label"
|
|
|
|
for="inset"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div
|
2018-11-19 12:40:25 +11:00
|
|
|
:disabled="!present"
|
2019-07-05 17:17:44 +10:00
|
|
|
class="blur-control style-control"
|
|
|
|
>
|
|
|
|
<label
|
|
|
|
for="spread"
|
|
|
|
class="label"
|
|
|
|
>
|
|
|
|
{{ $t('settings.style.shadows.blur') }}
|
|
|
|
</label>
|
|
|
|
<input
|
|
|
|
id="blur"
|
|
|
|
v-model="selected.blur"
|
|
|
|
:disabled="!present"
|
|
|
|
name="blur"
|
|
|
|
class="input-range"
|
|
|
|
type="range"
|
|
|
|
max="20"
|
|
|
|
min="0"
|
|
|
|
>
|
|
|
|
<input
|
|
|
|
v-model="selected.blur"
|
|
|
|
:disabled="!present"
|
|
|
|
class="input-number"
|
|
|
|
type="number"
|
|
|
|
min="0"
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<div
|
2018-11-19 12:40:25 +11:00
|
|
|
:disabled="!present"
|
2019-07-05 17:17:44 +10:00
|
|
|
class="spread-control style-control"
|
|
|
|
>
|
|
|
|
<label
|
|
|
|
for="spread"
|
|
|
|
class="label"
|
|
|
|
>
|
|
|
|
{{ $t('settings.style.shadows.spread') }}
|
|
|
|
</label>
|
|
|
|
<input
|
|
|
|
id="spread"
|
|
|
|
v-model="selected.spread"
|
|
|
|
:disabled="!present"
|
|
|
|
name="spread"
|
|
|
|
class="input-range"
|
|
|
|
type="range"
|
|
|
|
max="20"
|
|
|
|
min="-20"
|
|
|
|
>
|
|
|
|
<input
|
|
|
|
v-model="selected.spread"
|
|
|
|
:disabled="!present"
|
|
|
|
class="input-number"
|
|
|
|
type="number"
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<ColorInput
|
|
|
|
v-model="selected.color"
|
2018-11-19 12:40:25 +11:00
|
|
|
:disabled="!present"
|
2019-07-05 17:17:44 +10:00
|
|
|
:label="$t('settings.style.common.color')"
|
2020-01-20 09:34:49 +11:00
|
|
|
:fallback="currentFallback.color"
|
2020-01-20 10:45:48 +11:00
|
|
|
:show-optional-tickbox="false"
|
2019-07-05 17:17:44 +10:00
|
|
|
name="shadow"
|
|
|
|
/>
|
|
|
|
<OpacityInput
|
|
|
|
v-model="selected.alpha"
|
2018-11-19 12:40:25 +11:00
|
|
|
:disabled="!present"
|
2019-07-05 17:17:44 +10:00
|
|
|
/>
|
2020-01-20 11:00:13 +11:00
|
|
|
<i18n
|
|
|
|
path="settings.style.shadows.hintV3"
|
|
|
|
tag="p"
|
|
|
|
>
|
|
|
|
<code>--variable,mod</code>
|
|
|
|
</i18n>
|
2018-11-19 12:40:25 +11:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./shadow_control.js" ></script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import '../../_variables.scss';
|
|
|
|
.shadow-control {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
justify-content: center;
|
2018-11-26 05:48:16 +11:00
|
|
|
margin-bottom: 1em;
|
2018-11-19 12:40:25 +11:00
|
|
|
|
2018-11-21 06:14:49 +11:00
|
|
|
.shadow-preview-container,
|
|
|
|
.shadow-tweak {
|
|
|
|
margin: 5px 6px 0 0;
|
|
|
|
}
|
2018-11-19 12:40:25 +11:00
|
|
|
.shadow-preview-container {
|
|
|
|
flex: 0;
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
$side: 15em;
|
|
|
|
|
|
|
|
input[type=number] {
|
|
|
|
width: 5em;
|
|
|
|
min-width: 2em;
|
|
|
|
}
|
|
|
|
.x-shift-control,
|
|
|
|
.y-shift-control {
|
|
|
|
display: flex;
|
|
|
|
flex: 0;
|
|
|
|
|
|
|
|
&[disabled=disabled] *{
|
|
|
|
opacity: .5
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.x-shift-control {
|
|
|
|
align-items: flex-start;
|
|
|
|
}
|
|
|
|
|
|
|
|
.x-shift-control .wrap,
|
|
|
|
input[type=range] {
|
|
|
|
margin: 0;
|
|
|
|
width: $side;
|
|
|
|
height: 2em;
|
|
|
|
}
|
|
|
|
.y-shift-control {
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: flex-end;
|
|
|
|
.wrap {
|
|
|
|
width: 2em;
|
|
|
|
height: $side;
|
|
|
|
}
|
|
|
|
input[type=range] {
|
|
|
|
transform-origin: 1em 1em;
|
|
|
|
transform: rotate(90deg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.preview-window {
|
|
|
|
flex: 1;
|
2018-11-20 02:15:27 +11:00
|
|
|
background-color: #999999;
|
2018-11-19 12:40:25 +11:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
background-image:
|
2018-11-20 02:15:27 +11:00
|
|
|
linear-gradient(45deg, #666666 25%, transparent 25%),
|
|
|
|
linear-gradient(-45deg, #666666 25%, transparent 25%),
|
|
|
|
linear-gradient(45deg, transparent 75%, #666666 75%),
|
|
|
|
linear-gradient(-45deg, transparent 75%, #666666 75%);
|
2018-11-19 12:40:25 +11:00
|
|
|
background-size: 20px 20px;
|
|
|
|
background-position:0 0, 0 10px, 10px -10px, -10px 0;
|
|
|
|
|
|
|
|
border-radius: $fallback--inputRadius;
|
|
|
|
border-radius: var(--inputRadius, $fallback--inputRadius);
|
|
|
|
|
|
|
|
.preview-block {
|
|
|
|
width: 33%;
|
|
|
|
height: 33%;
|
|
|
|
background-color: $fallback--bg;
|
|
|
|
background-color: var(--bg, $fallback--bg);
|
|
|
|
border-radius: $fallback--panelRadius;
|
|
|
|
border-radius: var(--panelRadius, $fallback--panelRadius);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.shadow-tweak {
|
2018-11-21 06:14:49 +11:00
|
|
|
flex: 1;
|
2018-11-26 01:21:53 +11:00
|
|
|
min-width: 280px;
|
2018-11-19 12:40:25 +11:00
|
|
|
|
2018-11-21 06:14:49 +11:00
|
|
|
.id-control {
|
|
|
|
align-items: stretch;
|
|
|
|
.select, .btn {
|
2018-11-23 19:36:36 +11:00
|
|
|
min-width: 1px;
|
2018-11-21 06:14:49 +11:00
|
|
|
margin-right: 5px;
|
2018-11-19 12:40:25 +11:00
|
|
|
}
|
2018-11-23 19:36:36 +11:00
|
|
|
.btn {
|
|
|
|
padding: 0 .4em;
|
|
|
|
margin: 0 .1em;
|
|
|
|
}
|
2018-11-21 06:14:49 +11:00
|
|
|
.select {
|
2018-11-19 12:40:25 +11:00
|
|
|
flex: 1;
|
2018-11-21 06:14:49 +11:00
|
|
|
select {
|
|
|
|
align-self: initial;
|
|
|
|
}
|
2018-11-19 12:40:25 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|