diff --git a/src/App.vue b/src/App.vue index 649b0c8..2bd170b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,12 +4,13 @@ import Page from './components/Page.vue'; import Input from './components/Input.vue'; import Canvas from './components/Canvas.vue'; import { ref } from 'vue'; -import { DEFAULT_HORIZONTAL_MARGIN, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH, DEFAULT_VERTICAL_MARGIN } from './const'; +import { DEFAULT_HORIZONTAL_MARGIN, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH, DEFAULT_VERTICAL_MARGIN, DEFAULT_IMAGE_BACKGROUND_COLOR } from './const'; const vMargin = ref(DEFAULT_VERTICAL_MARGIN) const hMargin = ref(DEFAULT_HORIZONTAL_MARGIN) const imageWidth = ref(DEFAULT_IMAGE_WIDTH) const imageHeight = ref(DEFAULT_IMAGE_HEIGHT) +const imageBackgroundColor = ref(DEFAULT_IMAGE_BACKGROUND_COLOR) const savePng = async () => { const canvas = document.getElementById("canvas") as HTMLCanvasElement; @@ -27,6 +28,16 @@ const savePng = async () => { @@ -66,15 +84,29 @@ body { background-color: aqua; } -.l-button { +.l-base-button { color: #22333B; background-color: #EAE0D5; border: 1px solid #5E503F; +} + +.l-base-button:hover { + background-color: #d7c7b6; +} + +.l-button { border-radius: 10px; margin: 5px; padding: 10px; } +.l-mini-button { + border-radius: 3px; + margin: 3px; + padding: 2px 10px; + font-size: 10pt; +} + @font-face { font-family: 'MPLUS1p'; font-style: normal; @@ -92,4 +124,16 @@ h1 { padding: 20px; background-color: white; } + +.l-mini-buttons-bar { + padding: 0 0 20px 5px; +} + +.input { + margin: 10px; +} + +.l-input { + margin: 10px 0; +} diff --git a/src/components/Canvas.vue b/src/components/Canvas.vue index 2084ff2..48fc979 100644 --- a/src/components/Canvas.vue +++ b/src/components/Canvas.vue @@ -7,15 +7,18 @@ const props = defineProps<{ hMargin: number; imageWidth: number; imageHeight: number; + imageBackgroundColor: string; }>(); const ctx = ref(null); const clearCanvas = () => { - const { imageWidth, imageHeight } = props; + const { imageWidth, imageHeight, imageBackgroundColor } = props; if (ctx.value) { - ctx.value.clearRect(0, 0, imageWidth * ONE_MM, imageHeight * ONE_MM); + ctx.value.shadowColor + ctx.value.fillStyle = imageBackgroundColor; + ctx.value.fillRect(0, 0, imageWidth * ONE_MM, imageHeight * ONE_MM); ctx.value.beginPath(); } }; @@ -58,11 +61,7 @@ onUpdated(() => {