Skip to content

Commit

Permalink
Add more reveal.js config
Browse files Browse the repository at this point in the history
  • Loading branch information
ducquando committed Apr 17, 2024
1 parent 1b0a8bd commit b197115
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
9 changes: 8 additions & 1 deletion src/const/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
3 changes: 3 additions & 0 deletions src/const/vogues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -27,6 +29,7 @@ export const vogues = {
previewWidth: 128,
previewHeight: 72,
previewPadBot: 20,
projectName: 'Untitled Presentation',
},
color: {
blue: '#00f',
Expand Down
2 changes: 1 addition & 1 deletion src/style/_vars.scss
Original file line number Diff line number Diff line change
@@ -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%);
Expand Down
2 changes: 1 addition & 1 deletion src/wireframes/components/settings/PresentSetting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const PresentSetting = React.memo(() => {

const handleSrcCancel = () => {
setIsScrChange(false);
setRevealScr(JSON.stringify(editor.revealConfig, null, 4));
setRevealScr(editor.revealConfig);
}

return (
Expand Down
6 changes: 3 additions & 3 deletions src/wireframes/model/editor-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -105,8 +105,8 @@ export class EditorState extends Record<Props> {
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,
};

Expand Down

0 comments on commit b197115

Please sign in to comment.