🎨 Redesigned color swatches

This commit is contained in:
Liyas Thomas
2019-12-01 06:20:37 +05:30
parent 6a63325f10
commit ae528f6302
3 changed files with 19 additions and 20 deletions

View File

@@ -352,6 +352,8 @@ h3 {
padding: 4px; padding: 4px;
border-radius: 8px; border-radius: 8px;
box-shadow: 0 5px 30px rgba(black, 0.1); box-shadow: 0 5px 30px rgba(black, 0.1);
max-height: 256px;
overflow: auto;
} }
.popover-arrow { .popover-arrow {

View File

@@ -1,9 +1,8 @@
<template> <template>
<div class="color" :data-color="color"> <div class="color" :data-color="color" :class="{ active: active }" v-tooltip="{ content: name || color }">
<span :style="{ backgroundColor: color }" class="preview"> <span :style="{ backgroundColor: color }" class="preview">
<i v-if="active" class="material-icons activeTick">done</i> <i v-if="active" class="material-icons activeTick">done</i>
</span> </span>
{{ name || color }}
</div> </div>
</template> </template>
@@ -12,23 +11,27 @@
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 0 16px 0 4px; margin: 8px;
margin: 4px; border-radius: 100%;
background-color: var(--bg-dark-color); border: 3px solid var(--bg-dark-color);
color: var(--fg-color);
border-radius: 20px;
cursor: pointer; cursor: pointer;
height: 40px;
&.fg {
color: var(--act-color);
}
&.active { &.active {
background-color: var(--bg-dark-color); border: 3px solid var(--ac-color);
}
&.fg.active {
border: 3px solid var(--fg-color);
} }
.preview { .preview {
vertical-align: middle; vertical-align: middle;
display: inline-block; display: inline-block;
border-radius: 100%; border-radius: 100%;
margin-right: 8px;
padding: 16px; padding: 16px;
position: relative; position: relative;
@@ -37,16 +40,9 @@
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
color: #ffffff;
} }
} }
} }
.color.vibrant {
.preview .activeTick {
color: var(--act-color);
}
}
</style> </style>
<script> <script>

View File

@@ -3,7 +3,7 @@
<pw-section class="cyan" label="Theme" ref="theme"> <pw-section class="cyan" label="Theme" ref="theme">
<ul> <ul>
<li> <li>
<h3 class="title">{{ $t("background") }}</h3> <label>{{ $t("background") }}</label>
<div class="backgrounds"> <div class="backgrounds">
<span <span
:key="theme.class" :key="theme.class"
@@ -15,6 +15,7 @@
:class="{ vibrant: theme.vibrant }" :class="{ vibrant: theme.vibrant }"
:color="theme.color" :color="theme.color"
:name="theme.name" :name="theme.name"
class="bg"
></swatch> ></swatch>
</span> </span>
</div> </div>
@@ -22,7 +23,7 @@
</ul> </ul>
<ul> <ul>
<li> <li>
<h3 class="title">{{ $t("color") }}</h3> <label>{{ $t("color") }}</label>
<div class="colors"> <div class="colors">
<span <span
:key="entry.color" :key="entry.color"
@@ -34,6 +35,7 @@
:class="{ vibrant: entry.vibrant }" :class="{ vibrant: entry.vibrant }"
:color="entry.color" :color="entry.color"
:name="entry.name" :name="entry.name"
class="fg"
/> />
</span> </span>
</div> </div>
@@ -41,7 +43,6 @@
</ul> </ul>
<ul> <ul>
<li> <li>
<h3 class="title">{{ $t("color") }}</h3>
<span> <span>
<pw-toggle <pw-toggle
:on="settings.FRAME_COLORS_ENABLED" :on="settings.FRAME_COLORS_ENABLED"