2017-01-16 09:57:03 -08:00
|
|
|
<template>
|
2018-08-28 05:38:07 -07:00
|
|
|
<div>
|
|
|
|
<div class="presets-container">
|
|
|
|
<div>
|
|
|
|
{{$t('settings.presets')}}
|
2018-04-07 11:58:29 -07:00
|
|
|
<label for="style-switcher" class='select'>
|
|
|
|
<select id="style-switcher" v-model="selected" class="style-switcher">
|
2018-08-28 05:38:07 -07:00
|
|
|
<option v-for="style in availableStyles"
|
|
|
|
:value="style"
|
|
|
|
:style="{
|
|
|
|
backgroundColor: style[1],
|
|
|
|
color: style[3]
|
|
|
|
}">
|
|
|
|
{{style[0]}}
|
|
|
|
</option>
|
2018-04-07 11:58:29 -07:00
|
|
|
</select>
|
|
|
|
<i class="icon-down-open"/>
|
|
|
|
</label>
|
|
|
|
</div>
|
2018-08-28 05:38:07 -07:00
|
|
|
<div class="import-export">
|
2018-06-27 16:08:06 -07:00
|
|
|
<button class="btn" @click="exportCurrentTheme">{{ $t('settings.export_theme') }}</button>
|
2018-06-27 17:59:57 -07:00
|
|
|
<button class="btn" @click="importTheme">{{ $t('settings.import_theme') }}</button>
|
2018-07-04 05:25:40 -07:00
|
|
|
<p v-if="invalidThemeImported" class="import-warning">{{ $t('settings.invalid_theme_imported') }}</p>
|
2018-06-27 16:08:06 -07:00
|
|
|
</div>
|
2018-08-28 05:38:07 -07:00
|
|
|
</div>
|
|
|
|
|
2018-10-02 11:43:58 -07:00
|
|
|
<div class="preview-container" :style="previewRules">
|
|
|
|
<div class="panel dummy">
|
|
|
|
<div class="panel-heading">Preview</div>
|
|
|
|
<div class="panel-body theme-preview-content">
|
|
|
|
<div class="avatar">
|
|
|
|
( ͡° ͜ʖ ͡°)
|
2017-11-17 07:24:42 -08:00
|
|
|
</div>
|
2018-10-02 11:43:58 -07:00
|
|
|
<h4>Content</h4>
|
|
|
|
<br>
|
|
|
|
A bunch of more content and
|
|
|
|
<a style="color: var(--link)">a nice lil' link</a>
|
|
|
|
<i style="color: var(--cBlue)" class="icon-reply"/>
|
|
|
|
<i style="color: var(--cGreen)" class="icon-retweet"/>
|
|
|
|
<i style="color: var(--cRed)" class="icon-cancel"/>
|
|
|
|
<i style="color: var(--cOrange)" class="icon-star"/>
|
|
|
|
<br>
|
|
|
|
<button class="btn">Button</button>
|
2017-11-17 07:24:42 -08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-08-28 05:38:07 -07:00
|
|
|
|
|
|
|
<div class="color-container">
|
|
|
|
<p>{{$t('settings.theme_help')}}</p>
|
2018-10-02 11:43:58 -07:00
|
|
|
<h3>Basic colors!!</h3>
|
|
|
|
<div>
|
|
|
|
<div class="color-item">
|
|
|
|
<ColorInput name="bgColor" v-model="bgColorLocal" :label="$t('settings.background')"/>
|
2018-10-07 12:03:34 -07:00
|
|
|
<OpacityInput name="bgOpacity" v-model="bgOpacityLocal" :fallback="previewTheme.opacity.bg || 1"/>
|
2018-10-03 11:21:48 -07:00
|
|
|
<ColorInput name="textColor" v-model="textColorLocal" :label="$t('settings.text')"/>
|
2018-10-09 14:07:28 -07:00
|
|
|
<ContrastRatio :contrast="previewContrast.bgText"/>
|
2018-10-03 11:21:48 -07:00
|
|
|
<ColorInput name="linkColor" v-model="linkColorLocal" :label="$t('settings.links')"/>
|
2018-10-09 14:07:28 -07:00
|
|
|
<ContrastRatio :contrast="previewContrast.bgLink"/>
|
2018-10-02 11:43:58 -07:00
|
|
|
</div>
|
|
|
|
<div class="color-item">
|
2018-10-04 08:16:14 -07:00
|
|
|
<ColorInput name="fgColor" v-model="fgColorLocal" :label="$t('settings.foreground')"/>
|
2018-10-07 09:59:22 -07:00
|
|
|
<ColorInput name="fgTextColor" v-model="fgTextColorLocal" :label="$t('settings.text')" :fallback="previewTheme.colors.fgText"/>
|
|
|
|
<ColorInput name="fgLinkColor" v-model="fgLinkColorLocal" :label="$t('settings.links')" :fallback="previewTheme.colors.fgLink"/>
|
2018-10-02 11:43:58 -07:00
|
|
|
</div>
|
|
|
|
<div class="color-item">
|
2018-10-07 09:59:22 -07:00
|
|
|
<ColorInput name="cRedColor" v-model="cRedColorLocal" :label="$t('settings.cRed')"/>
|
2018-10-21 05:25:21 -07:00
|
|
|
<ContrastRatio :contrast="previewContrast.bgRed"/>
|
2018-10-07 09:59:22 -07:00
|
|
|
<ColorInput name="cBlueColor" v-model="cBlueColorLocal" :label="$t('settings.cBlue')"/>
|
2018-10-21 05:25:21 -07:00
|
|
|
<ContrastRatio :contrast="previewContrast.bgBlue"/>
|
2018-10-02 11:43:58 -07:00
|
|
|
</div>
|
|
|
|
<div class="color-item">
|
2018-10-07 09:59:22 -07:00
|
|
|
<ColorInput name="cGreenColor" v-model="cGreenColorLocal" :label="$t('settings.cGreen')"/>
|
2018-10-21 05:25:21 -07:00
|
|
|
<ContrastRatio :contrast="previewContrast.bgGreen"/>
|
2018-10-07 09:59:22 -07:00
|
|
|
<ColorInput name="cOrangeColor" v-model="cOrangeColorLocal" :label="$t('settings.cOrange')"/>
|
2018-10-21 05:25:21 -07:00
|
|
|
<ContrastRatio :contrast="previewContrast.bgOrange"/>
|
2018-10-03 11:21:48 -07:00
|
|
|
</div>
|
2018-08-28 05:38:07 -07:00
|
|
|
</div>
|
2018-10-02 11:43:58 -07:00
|
|
|
|
|
|
|
<h3>More customs!</h3>
|
|
|
|
<div>
|
2018-11-13 05:30:01 -08:00
|
|
|
<div class="color-item">
|
|
|
|
<h4>Alerts</h4>
|
|
|
|
<ColorInput name="alertError" v-model="alertErrorColorLocal" :label="$t('settings.error')" :fallback="previewTheme.colors.alertError"/>
|
|
|
|
<OpacityInput name="alertOpacity" v-model="alertOpacityLocal" :fallback="previewTheme.opacity.alert || 1"/>
|
|
|
|
</div>
|
|
|
|
<div class="color-item">
|
|
|
|
<h4>Alerts</h4>
|
|
|
|
<ColorInput name="badgeNotification" v-model="badgeNotificationColorLocal" :label="$t('settings.notification')" :fallback="previewTheme.colors.badgeNotification"/>
|
|
|
|
<ContrastRatio :contrast="previewContrast.badgeNotification"/>
|
|
|
|
<OpacityInput name="badgeOpacity" v-model="badgeOpacityLocal" :fallback="previewTheme.opacity.badge || 1"/>
|
|
|
|
</div>
|
2018-10-02 11:43:58 -07:00
|
|
|
<div class="color-item">
|
2018-10-03 11:21:48 -07:00
|
|
|
<h4>Panel header</h4>
|
2018-10-07 09:59:22 -07:00
|
|
|
<ColorInput name="panelColor" v-model="panelColorLocal" :fallback="fgColorLocal" :label="$t('settings.background')"/>
|
2018-10-07 12:03:34 -07:00
|
|
|
<OpacityInput name="panelOpacity" v-model="panelOpacityLocal" :fallback="previewTheme.opacity.panel || 1"/>
|
2018-10-07 09:59:22 -07:00
|
|
|
<ColorInput name="panelTextColor" v-model="panelTextColorLocal" :fallback="previewTheme.colors.panelText" :label="$t('settings.links')"/>
|
2018-10-09 14:07:28 -07:00
|
|
|
<ContrastRatio :contrast="previewContrast.panelText" large="1"/>
|
2018-10-02 11:43:58 -07:00
|
|
|
</div>
|
|
|
|
<div class="color-item">
|
2018-10-03 11:21:48 -07:00
|
|
|
<h4>Top bar</h4>
|
2018-10-07 09:59:22 -07:00
|
|
|
<ColorInput name="topBarColor" v-model="topBarColorLocal" :fallback="fgColorLocal" :label="$t('settings.background')"/>
|
|
|
|
<ColorInput name="topBarTextColor" v-model="topBarTextColorLocal" :fallback="previewTheme.colors.topBarText" :label="$t('settings.text')"/>
|
2018-10-09 14:07:28 -07:00
|
|
|
<ContrastRatio :contrast="previewContrast.topBarText"/>
|
2018-10-07 09:59:22 -07:00
|
|
|
<ColorInput name="topBarLinkColor" v-model="topBarLinkColorLocal" :fallback="previewTheme.colors.topBarLink" :label="$t('settings.links')"/>
|
2018-10-09 14:07:28 -07:00
|
|
|
<ContrastRatio :contrast="previewContrast.topBarLink"/>
|
2018-10-02 11:43:58 -07:00
|
|
|
</div>
|
|
|
|
<div class="color-item">
|
2018-11-13 05:30:01 -08:00
|
|
|
<h4>Text fields</h4>
|
2018-10-07 09:59:22 -07:00
|
|
|
<ColorInput name="inputColor" v-model="inputColorLocal" :fallback="fgColorLocal" :label="$t('settings.background')"/>
|
2018-10-07 12:03:34 -07:00
|
|
|
<OpacityInput name="inputOpacity" v-model="inputOpacityLocal" :fallback="previewTheme.opacity.input || 1"/>
|
2018-10-07 09:59:22 -07:00
|
|
|
<ColorInput name="inputTextColor" v-model="inputTextColorLocal" :fallback="previewTheme.colors.inputText" :label="$t('settings.text')"/>
|
2018-11-13 05:30:01 -08:00
|
|
|
<ContrastRatio :contrast="previewContrast.inputText"/>
|
2018-10-02 11:43:58 -07:00
|
|
|
</div>
|
|
|
|
<div class="color-item">
|
2018-10-03 11:21:48 -07:00
|
|
|
<h4>Buttons</h4>
|
2018-10-07 09:59:22 -07:00
|
|
|
<ColorInput name="btnColor" v-model="btnColorLocal" :fallback="fgColorLocal" :label="$t('settings.background')"/>
|
2018-10-07 12:03:34 -07:00
|
|
|
<OpacityInput name="btnOpacity" v-model="btnOpacityLocal" :fallback="previewTheme.opacity.btn || 1"/>
|
2018-10-07 09:59:22 -07:00
|
|
|
<ColorInput name="btnTextColor" v-model="btnTextColorLocal" :fallback="previewTheme.colors.btnText" :label="$t('settings.text')"/>
|
2018-10-09 14:07:28 -07:00
|
|
|
<ContrastRatio :contrast="previewContrast.btnText"/>
|
2018-10-02 11:43:58 -07:00
|
|
|
</div>
|
|
|
|
<div class="color-item">
|
2018-10-03 11:21:48 -07:00
|
|
|
<h4>Borders</h4>
|
2018-10-07 09:59:22 -07:00
|
|
|
<ColorInput name="borderColor" v-model="borderColorLocal" :fallback="previewTheme.colors.border" label="Color"/>
|
2018-10-07 12:03:34 -07:00
|
|
|
<OpacityInput name="borderOpacity" v-model="borderOpacityLocal" :fallback="previewTheme.opacity.border || 1"/>
|
2018-10-02 11:43:58 -07:00
|
|
|
</div>
|
|
|
|
<div class="color-item">
|
2018-10-03 11:21:48 -07:00
|
|
|
<h4>Faint text</h4>
|
2018-10-07 12:03:34 -07:00
|
|
|
<ColorInput name="faintColor" v-model="faintColorLocal" :fallback="previewTheme.colors.faint || 1" :label="$t('settings.text')"/>
|
|
|
|
<ColorInput name="faintLinkColor" v-model="faintLinkColorLocal" :fallback="previewTheme.colors.faintLink" :label="$t('settings.links')"/>
|
2018-11-13 05:30:01 -08:00
|
|
|
<ColorInput name="panelFaintColor" v-model="panelFaintColorLocal" :fallback="previewTheme.colors.panelFaint" :label="$t('settings.panel')"/>
|
|
|
|
<OpacityInput name="faintOpacity" v-model="faintOpacityLocal" :fallback="previewTheme.opacity.faint || 0.5"/>
|
2018-10-02 11:43:58 -07:00
|
|
|
</div>
|
2018-08-28 05:38:07 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="radius-container">
|
|
|
|
<p>{{$t('settings.radii_help')}}</p>
|
|
|
|
<div class="radius-item">
|
|
|
|
<label for="btnradius" class="theme-radius-lb">{{$t('settings.btnRadius')}}</label>
|
|
|
|
<input id="btnradius" class="theme-radius-rn" type="range" v-model="btnRadiusLocal" max="16">
|
|
|
|
<input id="btnradius-t" class="theme-radius-in" type="text" v-model="btnRadiusLocal">
|
|
|
|
</div>
|
|
|
|
<div class="radius-item">
|
|
|
|
<label for="inputradius" class="theme-radius-lb">{{$t('settings.inputRadius')}}</label>
|
|
|
|
<input id="inputradius" class="theme-radius-rn" type="range" v-model="inputRadiusLocal" max="16">
|
|
|
|
<input id="inputradius-t" class="theme-radius-in" type="text" v-model="inputRadiusLocal">
|
|
|
|
</div>
|
|
|
|
<div class="radius-item">
|
|
|
|
<label for="panelradius" class="theme-radius-lb">{{$t('settings.panelRadius')}}</label>
|
|
|
|
<input id="panelradius" class="theme-radius-rn" type="range" v-model="panelRadiusLocal" max="50">
|
|
|
|
<input id="panelradius-t" class="theme-radius-in" type="text" v-model="panelRadiusLocal">
|
|
|
|
</div>
|
|
|
|
<div class="radius-item">
|
|
|
|
<label for="avatarradius" class="theme-radius-lb">{{$t('settings.avatarRadius')}}</label>
|
|
|
|
<input id="avatarradius" class="theme-radius-rn" type="range" v-model="avatarRadiusLocal" max="28">
|
|
|
|
<input id="avatarradius-t" class="theme-radius-in" type="green" v-model="avatarRadiusLocal">
|
|
|
|
</div>
|
|
|
|
<div class="radius-item">
|
|
|
|
<label for="avataraltradius" class="theme-radius-lb">{{$t('settings.avatarAltRadius')}}</label>
|
|
|
|
<input id="avataraltradius" class="theme-radius-rn" type="range" v-model="avatarAltRadiusLocal" max="28">
|
|
|
|
<input id="avataraltradius-t" class="theme-radius-in" type="text" v-model="avatarAltRadiusLocal">
|
|
|
|
</div>
|
|
|
|
<div class="radius-item">
|
|
|
|
<label for="attachmentradius" class="theme-radius-lb">{{$t('settings.attachmentRadius')}}</label>
|
|
|
|
<input id="attachmentrradius" class="theme-radius-rn" type="range" v-model="attachmentRadiusLocal" max="50">
|
|
|
|
<input id="attachmentradius-t" class="theme-radius-in" type="text" v-model="attachmentRadiusLocal">
|
|
|
|
</div>
|
|
|
|
<div class="radius-item">
|
|
|
|
<label for="tooltipradius" class="theme-radius-lb">{{$t('settings.tooltipRadius')}}</label>
|
|
|
|
<input id="tooltipradius" class="theme-radius-rn" type="range" v-model="tooltipRadiusLocal" max="20">
|
|
|
|
<input id="tooltipradius-t" class="theme-radius-in" type="text" v-model="tooltipRadiusLocal">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="apply-container">
|
|
|
|
<button class="btn submit" @click="setCustomTheme">{{$t('general.apply')}}</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-01-16 09:57:03 -08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./style_switcher.js"></script>
|
2017-01-17 05:41:13 -08:00
|
|
|
|
|
|
|
<style lang="scss">
|
2018-03-31 19:28:20 -07:00
|
|
|
@import '../../_variables.scss';
|
2018-02-03 11:23:38 -08:00
|
|
|
.style-switcher {
|
2018-04-07 09:30:27 -07:00
|
|
|
margin-right: 1em;
|
2018-02-03 11:23:38 -08:00
|
|
|
}
|
2017-11-17 07:24:42 -08:00
|
|
|
|
2018-07-04 05:25:40 -07:00
|
|
|
.import-warning {
|
|
|
|
color: $fallback--cRed;
|
|
|
|
color: var(--cRed, $fallback--cRed);
|
|
|
|
}
|
|
|
|
|
2018-08-28 05:38:07 -07:00
|
|
|
.apply-container,
|
2018-04-07 16:52:15 -07:00
|
|
|
.radius-container,
|
2018-10-02 11:43:58 -07:00
|
|
|
.color-container > div,
|
2018-08-28 05:38:07 -07:00
|
|
|
.presets-container {
|
2018-04-07 09:30:27 -07:00
|
|
|
display: flex;
|
2018-04-07 16:52:15 -07:00
|
|
|
|
|
|
|
p {
|
2018-08-28 05:38:07 -07:00
|
|
|
flex: 2 0 100%;
|
2018-04-07 16:52:15 -07:00
|
|
|
margin-top: 2em;
|
|
|
|
margin-bottom: .5em;
|
|
|
|
}
|
|
|
|
}
|
2018-08-28 05:38:07 -07:00
|
|
|
|
2018-04-07 16:52:15 -07:00
|
|
|
.radius-container {
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
2018-10-02 11:43:58 -07:00
|
|
|
.color-container > div{
|
2018-04-07 09:30:27 -07:00
|
|
|
flex-wrap: wrap;
|
|
|
|
justify-content: space-between;
|
2018-02-03 11:23:38 -08:00
|
|
|
}
|
2017-11-17 07:24:42 -08:00
|
|
|
|
2018-08-28 05:38:07 -07:00
|
|
|
.presets-container {
|
|
|
|
justify-content: center;
|
|
|
|
.import-export {
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
margin-left: .5em;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.preview-container {
|
|
|
|
border-top: 1px dashed;
|
|
|
|
border-bottom: 1px dashed;
|
|
|
|
border-color: $fallback--border;
|
|
|
|
border-color: var(--border, $fallback--border);
|
|
|
|
margin: 1em -1em 0;
|
|
|
|
padding: 1em;
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
margin-top: 1em;
|
|
|
|
min-height: 30px;
|
|
|
|
width: 10em;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.apply-container {
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
|
2018-04-07 16:39:39 -07:00
|
|
|
.radius-item,
|
2018-02-03 11:23:38 -08:00
|
|
|
.color-item {
|
2018-04-07 09:30:27 -07:00
|
|
|
min-width: 20em;
|
2018-10-02 11:43:58 -07:00
|
|
|
margin: 5px 6px 0 0;
|
2018-04-07 09:30:27 -07:00
|
|
|
display:flex;
|
2018-10-02 11:43:58 -07:00
|
|
|
flex-direction: column;
|
2018-04-07 09:30:27 -07:00
|
|
|
flex: 1 1 0;
|
2018-10-02 11:43:58 -07:00
|
|
|
|
2018-10-03 11:21:48 -07:00
|
|
|
&.wide {
|
|
|
|
min-width: 60%
|
|
|
|
}
|
|
|
|
&:not(.wide):nth-child(2n+1) {
|
2018-10-02 11:43:58 -07:00
|
|
|
margin-right: 7px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.color, .opacity {
|
|
|
|
display:flex;
|
|
|
|
align-items: baseline;
|
|
|
|
}
|
2018-03-31 11:14:36 -07:00
|
|
|
|
2018-10-03 11:21:48 -07:00
|
|
|
h4 {
|
|
|
|
margin-top: 1em;
|
|
|
|
}
|
2018-02-03 11:23:38 -08:00
|
|
|
}
|
2018-03-31 19:28:20 -07:00
|
|
|
|
2018-04-07 17:22:03 -07:00
|
|
|
.radius-item {
|
|
|
|
flex-basis: auto;
|
|
|
|
}
|
|
|
|
|
2018-04-07 16:39:39 -07:00
|
|
|
.theme-radius-rn,
|
2018-03-31 19:28:20 -07:00
|
|
|
.theme-color-cl {
|
2018-04-07 09:30:27 -07:00
|
|
|
border: 0;
|
|
|
|
box-shadow: none;
|
|
|
|
background: transparent;
|
2018-04-07 16:39:39 -07:00
|
|
|
color: var(--faint, $fallback--faint);
|
2018-04-07 17:43:07 -07:00
|
|
|
align-self: stretch;
|
2018-03-31 19:28:20 -07:00
|
|
|
}
|
|
|
|
|
2018-02-03 11:23:38 -08:00
|
|
|
.theme-color-cl,
|
2018-04-07 16:39:39 -07:00
|
|
|
.theme-radius-in,
|
2018-02-03 11:23:38 -08:00
|
|
|
.theme-color-in {
|
2018-04-07 09:30:27 -07:00
|
|
|
margin-left: 4px;
|
2018-02-03 11:23:38 -08:00
|
|
|
}
|
|
|
|
|
2018-04-07 16:39:39 -07:00
|
|
|
.theme-radius-in {
|
|
|
|
min-width: 1em;
|
|
|
|
}
|
|
|
|
|
2018-10-02 11:43:58 -07:00
|
|
|
.theme-radius-in {
|
2018-04-07 09:30:27 -07:00
|
|
|
max-width: 7em;
|
|
|
|
flex: 1;
|
2018-02-03 11:23:38 -08:00
|
|
|
}
|
2018-04-07 16:39:39 -07:00
|
|
|
|
|
|
|
.theme-radius-lb{
|
|
|
|
max-width: 50em;
|
|
|
|
}
|
|
|
|
|
2018-04-07 09:30:27 -07:00
|
|
|
.theme-preview-content {
|
|
|
|
padding: 20px;
|
|
|
|
}
|
2018-04-07 17:22:03 -07:00
|
|
|
|
|
|
|
.dummy {
|
|
|
|
.avatar {
|
|
|
|
background: linear-gradient(135deg, #b8e1fc 0%,#a9d2f3 10%,#90bae4 25%,#90bcea 37%,#90bff0 50%,#6ba8e5 51%,#a2daf5 83%,#bdf3fd 100%);
|
|
|
|
color: black;
|
|
|
|
text-align: center;
|
|
|
|
height: 48px;
|
|
|
|
line-height: 48px;
|
|
|
|
width: 48px;
|
|
|
|
float: left;
|
|
|
|
margin-right: 1em;
|
|
|
|
}
|
|
|
|
}
|
2017-01-17 05:41:13 -08:00
|
|
|
</style>
|