Finished Canvas CSS

This commit is contained in:
2024-09-02 11:47:15 +02:00
parent 2a8abb4796
commit 6981b32a3a
5 changed files with 113 additions and 135 deletions

View File

@@ -1,7 +1,6 @@
import useDatabase from "~/composables/useDatabase";
import { extname, basename } from 'node:path';
import type { File, FileType } from '~/types/api';
import { InputTypeHTMLAttribute } from "vue";
import { CanvasColor, CanvasContent } from "~/types/canvas";
const typeMapping: Record<string, FileType> = {
@@ -125,12 +124,12 @@ function reshapeContent(content: string, type: FileType): string | null
function getColor(color: string): CanvasColor
{
const colors: Record<string, string> = {
'1': 'fill-light-red dark:fill-dark-red stroke-light-red dark:stroke-dark-red',
'2': 'fill-light-orange dark:fill-dark-orange stroke-light-orange dark:stroke-dark-orange',
'3': 'fill-light-yellow dark:fill-dark-yellow stroke-light-yellow dark:stroke-dark-yellow',
'4': 'fill-light-green dark:fill-dark-green stroke-light-green dark:stroke-dark-green',
'5': 'fill-light-cyan dark:fill-dark-cyan stroke-light-cyan dark:stroke-dark-cyan',
'6': 'fill-light-purple dark:fill-dark-purple stroke-light-purple dark:stroke-dark-purple',
'1': 'red',
'2': 'orange',
'3': 'yellow',
'4': 'green',
'5': 'cyan',
'6': 'purple',
};
if(colors.hasOwnProperty(color))
return { class: colors[color] };