2019-08-24 23:42:41 +00:00
|
|
|
<template>
|
2019-12-08 17:08:32 +00:00
|
|
|
<div
|
|
|
|
|
class="color"
|
|
|
|
|
:data-color="color"
|
|
|
|
|
:class="{ active: active }"
|
|
|
|
|
v-tooltip="{ content: name || color }"
|
|
|
|
|
>
|
2019-11-14 04:40:02 +00:00
|
|
|
<span :style="{ backgroundColor: color }" class="preview">
|
2019-09-25 11:43:42 +00:00
|
|
|
<i v-if="active" class="material-icons activeTick">done</i>
|
2019-09-17 09:55:32 +00:00
|
|
|
</span>
|
|
|
|
|
</div>
|
2019-08-24 23:42:41 +00:00
|
|
|
</template>
|
|
|
|
|
|
2019-12-06 01:41:38 +00:00
|
|
|
<style scoped lang="scss">
|
2019-11-02 05:32:21 +00:00
|
|
|
.color {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
2019-12-01 00:50:37 +00:00
|
|
|
margin: 8px;
|
|
|
|
|
border-radius: 100%;
|
|
|
|
|
border: 3px solid var(--bg-dark-color);
|
2019-11-02 05:32:21 +00:00
|
|
|
cursor: pointer;
|
2019-12-01 00:50:37 +00:00
|
|
|
|
|
|
|
|
&.fg {
|
|
|
|
|
color: var(--act-color);
|
|
|
|
|
}
|
2019-08-24 23:42:41 +00:00
|
|
|
|
2019-11-02 05:32:21 +00:00
|
|
|
&.active {
|
2019-12-01 00:50:37 +00:00
|
|
|
border: 3px solid var(--ac-color);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.fg.active {
|
|
|
|
|
border: 3px solid var(--fg-color);
|
2019-11-02 05:32:21 +00:00
|
|
|
}
|
2019-08-24 23:42:41 +00:00
|
|
|
|
2019-11-02 05:32:21 +00:00
|
|
|
.preview {
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
border-radius: 100%;
|
|
|
|
|
padding: 16px;
|
|
|
|
|
position: relative;
|
2019-08-24 23:42:41 +00:00
|
|
|
|
2019-11-02 05:32:21 +00:00
|
|
|
.activeTick {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 50%;
|
|
|
|
|
left: 50%;
|
|
|
|
|
transform: translate(-50%, -50%);
|
2019-08-24 23:42:41 +00:00
|
|
|
}
|
2019-09-17 09:55:32 +00:00
|
|
|
}
|
2019-11-02 05:32:21 +00:00
|
|
|
}
|
2019-08-24 23:42:41 +00:00
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<script>
|
2019-11-02 05:32:21 +00:00
|
|
|
export default {
|
|
|
|
|
props: {
|
|
|
|
|
color: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: true
|
|
|
|
|
},
|
|
|
|
|
name: {
|
|
|
|
|
type: String
|
|
|
|
|
},
|
|
|
|
|
active: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false
|
2019-08-24 23:42:41 +00:00
|
|
|
}
|
2019-09-17 09:55:32 +00:00
|
|
|
}
|
2019-11-02 05:32:21 +00:00
|
|
|
};
|
2019-09-17 08:13:12 +00:00
|
|
|
</script>
|