From b19711594b7f9e91300def42ea0df6af7d8fac56 Mon Sep 17 00:00:00 2001 From: Do Duc Quan <99700700+ducquando@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:01:57 +0700 Subject: [PATCH] Add more reveal.js config --- src/const/scripts.ts | 9 ++++++++- src/const/vogues.ts | 3 +++ src/style/_vars.scss | 2 +- src/wireframes/components/settings/PresentSetting.tsx | 2 +- src/wireframes/model/editor-state.ts | 6 +++--- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/const/scripts.ts b/src/const/scripts.ts index 36f3048..95fce07 100644 --- a/src/const/scripts.ts +++ b/src/const/scripts.ts @@ -6,9 +6,16 @@ * Copyright (c) Do Duc Quan. All rights reserved. */ +import { vogues } from "./vogues" + export const scripts = { common: { animation: '', - reveal: JSON.stringify({ hash: true, backgroundTransition: "none" }, null, 4) + reveal: JSON.stringify({ + hash: true, + backgroundTransition: "none", + width: vogues.common.canvasWidth, + height: vogues.common.canvasHeight, + }, null, 4) } } \ No newline at end of file diff --git a/src/const/vogues.ts b/src/const/vogues.ts index 5374ed5..794a70e 100644 --- a/src/const/vogues.ts +++ b/src/const/vogues.ts @@ -10,6 +10,8 @@ import { LineCurve, LineNode, LinePivot } from "@app/wireframes/interface"; export const vogues = { common: { + canvasWidth: 1280, + canvasHeight: 720, dragSize: 12, editorMargin: 13, editorPad: 10, @@ -27,6 +29,7 @@ export const vogues = { previewWidth: 128, previewHeight: 72, previewPadBot: 20, + projectName: 'Untitled Presentation', }, color: { blue: '#00f', diff --git a/src/style/_vars.scss b/src/style/_vars.scss index 4bce60f..c6b1c13 100644 --- a/src/style/_vars.scss +++ b/src/style/_vars.scss @@ -1,6 +1,6 @@ /* stylelint-disable */ -$color-background: rgb(240, 242, 245); +$color-background: #f0f2f5; $color-border: #e8e8e8; $color-border-dark: darken($color-border, 5%); diff --git a/src/wireframes/components/settings/PresentSetting.tsx b/src/wireframes/components/settings/PresentSetting.tsx index 3a60119..57afb52 100644 --- a/src/wireframes/components/settings/PresentSetting.tsx +++ b/src/wireframes/components/settings/PresentSetting.tsx @@ -49,7 +49,7 @@ export const PresentSetting = React.memo(() => { const handleSrcCancel = () => { setIsScrChange(false); - setRevealScr(JSON.stringify(editor.revealConfig, null, 4)); + setRevealScr(editor.revealConfig); } return ( diff --git a/src/wireframes/model/editor-state.ts b/src/wireframes/model/editor-state.ts index 2e8e9c5..799e37e 100644 --- a/src/wireframes/model/editor-state.ts +++ b/src/wireframes/model/editor-state.ts @@ -7,7 +7,7 @@ */ import { Color, ImmutableList, ImmutableMap, MathHelper, Record, Vec2 } from '@app/core/utils'; -import { scripts } from '@app/const'; +import { scripts, vogues } from '@app/const'; import { Diagram } from './diagram'; import { UndoableState } from './undoable-state'; @@ -105,8 +105,8 @@ export class EditorState extends Record { diagrams: ImmutableMap.of(diagrams), diagramIds: ImmutableList.of(diagramIds), id: MathHelper.guid(), - size: size || new Vec2(1280, 720), - name: name || 'Untitled Presentation', + size: size || new Vec2(vogues.common.canvasWidth, vogues.common.canvasHeight), + name: name || vogues.common.projectName, revealConfig: scripts.common.reveal, };