Add frontend 2.0

This commit is contained in:
2022-01-22 19:28:06 +01:00
parent ff22127baa
commit e0efd9dc41
28 changed files with 1954 additions and 140 deletions

View File

@@ -0,0 +1,28 @@
import { defineStore } from 'pinia';
import { generateSplitCover } from '@/lib/covergen';
export const useCover = defineStore('coverSettings', {
state() {
return {
customer: '',
prefix: 'offerte',
number: '',
color: '#ff00ff',
frontUri: '',
backUri: '',
};
},
actions: {
render() {
const { front, back } = generateSplitCover({
customer: this.customer,
numberPrefix: this.prefix,
number: this.number,
hlColor: this.color,
});
this.frontUri = URL.createObjectURL(front);
this.backUri = URL.createObjectURL(back);
},
},
});