working on color customization
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
<script>
|
||||
let { onclick, ondragstart, task } = $props();
|
||||
let { onclick, ondragstart, tag_colors = {}, task } = $props();
|
||||
|
||||
function calcStyle(){
|
||||
if (!task.tags || !tag_colors) return '';
|
||||
for (let tag of task.tags){
|
||||
let color = tag_colors[tag.toLowerCase()];
|
||||
if (color) return `background: ${color}`;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
let style = $derived.by(calcStyle)
|
||||
|
||||
</script>
|
||||
|
||||
<div draggable="true" class={`box prio_${task.total_prio} p${Math.floor(task.total_prio/10)*10} p${task.total_prio % 10}`} {onclick} {ondragstart} >
|
||||
<div
|
||||
draggable="true"
|
||||
class={`box prio_${task.total_prio} p${Math.floor(task.total_prio/10)*10} p${task.total_prio % 10}`}
|
||||
{onclick} {ondragstart} style={style}>
|
||||
<span class="title">{task.name}</span>
|
||||
{#if task.estimated_time}
|
||||
<span class="estimate">
|
||||
|
||||
Reference in New Issue
Block a user