case "paragraph": return
{item.text}
case "strong":
return diff --git a/package.json b/package.json
index 71e4a3a..7c137e7 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "ation",
- "version": "0.0.1",
+ "version": "0.1.0",
"description": "a simple presentation software",
"main": "main.js",
"scripts": {
diff --git a/src/Ation.js b/src/Ation.js
index 5cb6bb5..27330c2 100644
--- a/src/Ation.js
+++ b/src/Ation.js
@@ -1,4 +1,6 @@
"use strict";
+const {app, protocol} = require("electron");
+const url = require("url");
const WindowManager = require("./WindowManager");
@@ -9,6 +11,14 @@ class Ation {
if (Ation.Instances > 0)
throw new Error("Only one Instance of Ation possible");
this.windowManager = new WindowManager();
+
+ app.whenReady().then(async () => {
+ protocol.registerFileProtocol("slideimg", (request, callback) => {
+ const path = request.url.replace(/^slideimg:\/\//, "");
+ console.log(path);
+ callback(path);
+ });
+ });
}
}
Ation.Instances = 0;
diff --git a/src/WindowManager.js b/src/WindowManager.js
index 322f49f..e7eee28 100644
--- a/src/WindowManager.js
+++ b/src/WindowManager.js
@@ -36,9 +36,10 @@ class WindowManager {
return null;
const fileContents = await fs.readFile(result.filePaths[0], {encoding : "utf-8"});
+ const basePath = path.dirname(result.filePaths[0]);
const data = parser(fileContents);
- return data;
+ return [basePath, data];
});
}
diff --git a/src/ui/src/assets/css/_blackout.scss b/src/ui/src/assets/css/_blackout.scss
index c6afcd6..95e09ad 100644
--- a/src/ui/src/assets/css/_blackout.scss
+++ b/src/ui/src/assets/css/_blackout.scss
@@ -3,6 +3,7 @@
top: 0;
left: 0;
width: 100vw;
+ cursor: none;
height: 100vh;
z-index: 1000;
background: black;
diff --git a/src/ui/src/assets/css/_forms.scss b/src/ui/src/assets/css/_forms.scss
index ce383a9..5f4dfec 100644
--- a/src/ui/src/assets/css/_forms.scss
+++ b/src/ui/src/assets/css/_forms.scss
@@ -21,4 +21,24 @@ button {
margin-right: 0.3rem;
vertical-align: middle;
}
+}
+
+.checkbox {
+ display: inline-block;
+ width: 2vw;
+ height: 2vw;
+ border: solid 1px color(hightlight);
+ color: color(hightlight);
+ position: relative;
+
+ &.checked {
+ &::before {
+ content: "X";
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ font-size: 1.8vw;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/ui/src/assets/css/_slide.scss b/src/ui/src/assets/css/_slide.scss
index 1500252..7a4c276 100644
--- a/src/ui/src/assets/css/_slide.scss
+++ b/src/ui/src/assets/css/_slide.scss
@@ -1,33 +1,93 @@
.slide {
font-family: "Iosevka", sans-serif;
- font-size: 2rem;
+ font-size: 4vw;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
user-select: none;
+ padding: 8vw;
+ text-align: center;
aspect-ratio: 1.333;
background: color(background);
color: color(foreground);
+ ul, ol, pre {
+ text-align: left;
+ }
+
+ ul, ol {
+ li.task {
+ list-style: none;
+ margin-left: -0.8em;
+ }
+ }
+
+ blockquote {
+ opacity: 0.5;
+ font-style: italic;
+ position: relative;
+
+ &::before, &::after {
+ position: absolute;
+ font-size: 8vw;
+ opacity: 0.1;
+ }
+
+ &::before {
+ top: 0;
+ left: 0;
+ margin-left: -4vw;
+ content: "„";
+ }
+
+ &::after {
+ bottom: 0;
+ right: 0;
+ margin-right: -4vw;
+ content: "“";
+ }
+ }
+
+ figure {
+ img {
+ max-width: 95%;
+ height: auto;
+ }
+
+ figcaption {
+ font-size: 1.8vw;
+ opacity: 0.6;
+ font-style: italic;
+ font-weight: normal;
+ }
+ }
+
&.title {
p {
font-style: italic;
- font-size: 1.8rem;
+ font-size: 3.5vw;
color: color(scrollbar);
&:nth-of-type(2) {
- font-size: 1.2rem;
+ font-size: 2.8vw;
}
}
}
- h1 {
- font-size: 4rem;
+ code:not([class*=language-]) {
+ font-weight: normal;
+ font-size: 0.9em;
+ color: color(hightlight);
}
- code {
- font-size: 1.2rem;
+ pre {
+ font-size: 1.5vw;
width: 90%;
+ padding: 4vw !important;
+
+ * {
+ font-weight: normal !important;
+ }
}
}
\ No newline at end of file
diff --git a/src/ui/src/assets/css/_slidesList.scss b/src/ui/src/assets/css/_slidesList.scss
index 9970dc5..5091054 100644
--- a/src/ui/src/assets/css/_slidesList.scss
+++ b/src/ui/src/assets/css/_slidesList.scss
@@ -16,5 +16,9 @@
margin: 5% 0 0 5%;
aspect-ratio: 1.333;
-webkit-transform-origin: top left;
+
+ &.active {
+ border: solid 3px color(hightlight);
+ }
}
}
\ No newline at end of file
diff --git a/src/ui/src/assets/css/_variables.scss b/src/ui/src/assets/css/_variables.scss
index 1a83e37..972d73b 100644
--- a/src/ui/src/assets/css/_variables.scss
+++ b/src/ui/src/assets/css/_variables.scss
@@ -4,7 +4,8 @@ $colors : (
foreground : #ddd,
sidebarBackground : #333,
mainBackground : #222,
- scrollbar : rgba(255,255,255,0.2)
+ scrollbar : rgba(255,255,255,0.2),
+ hightlight : lawngreen
);
:root {
diff --git a/src/ui/src/components/Ation.js b/src/ui/src/components/Ation.js
index d3e7b36..b0f5539 100644
--- a/src/ui/src/components/Ation.js
+++ b/src/ui/src/components/Ation.js
@@ -11,15 +11,17 @@ import Toolbar from "./Toolbar";
import SlideContext from "../shared/SlideContext";
const Ation = () => {
- const [mode, setMode] = useState(Mode.NORMAL);
- const [deck, setDeck] = useState([]);
- const [slide, setSlide] = useState(0);
+ const [mode, setMode] = useState(Mode.NORMAL);
+ const [deck, setDeck] = useState([]);
+ const [slide, setSlide] = useState(0);
+ const [basePath, setBasePath] = useState("");
const openFile = async () => {
- const slideDeck = await window.api.openFile();
+ const [basePath, slideDeck] = await window.api.openFile();
if (!slideDeck)
return;
+ setBasePath(basePath);
setDeck(slideDeck);
}
@@ -27,7 +29,7 @@ const Ation = () => {
return
case "paragraph": return
{item.text}
case "strong":
return