diff --git a/README.md b/README.md index 2e2bafe..d5eeef0 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ Line generator for writing -## Licence +## Licence Thanks to [icons8](https://icons8.com/icon/vPDvU8cYImOg/noodles) for the logo ___ -[![Build Status](https://drone.3crabs.ru/api/badges/v9gel/lapsha/status.svg)](https://drone.3crabs.ru/v9gel/lapsha) +[![Build Status](https://drone.3crabs.ru/api/badges/VLADIMIR/lapsha/status.svg)](https://drone.3crabs.ru/VLADIMIR/lapsha) 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(() => { diff --git a/src/const.ts b/src/const.ts index 7bcefe6..df7e5d5 100644 --- a/src/const.ts +++ b/src/const.ts @@ -5,4 +5,6 @@ export const DEFAULT_IMAGE_WIDTH = 100; export const DEFAULT_IMAGE_HEIGHT = 100; export const DEFAULT_VERTICAL_MARGIN = 10; -export const DEFAULT_HORIZONTAL_MARGIN = 10; \ No newline at end of file +export const DEFAULT_HORIZONTAL_MARGIN = 10; + +export const DEFAULT_IMAGE_BACKGROUND_COLOR = "#ffffff" \ No newline at end of file