wip
This commit is contained in:
@@ -19,23 +19,24 @@ export class FileLoader implements IPluginBuilder {
|
|||||||
const { menuManifest } = builderContext;
|
const { menuManifest } = builderContext;
|
||||||
const { files } = this.options;
|
const { files } = this.options;
|
||||||
files.forEach((file) => {
|
files.forEach((file) => {
|
||||||
const fileName =
|
const filePath = file.path.split("/").pop() ?? file.path;
|
||||||
file.nameOverride ?? file.path.split("/").pop() ?? file.path;
|
const fileName = file.nameOverride ?? filePath;
|
||||||
const isImage = fileName.match(/\.(png|jpe?g|gif|webp)$/);
|
const isImage = fileName.match(/\.(png|jpe?g|gif|webp)$/);
|
||||||
if (isImage) {
|
if (isImage) {
|
||||||
console.log("Processing image", file.path);
|
console.log("Processing image", file.path);
|
||||||
ffmpeg(file.path)
|
ffmpeg(file.path)
|
||||||
.output(`${builderContext.outputDirectory}/${fileName}`)
|
.output(`${builderContext.outputDirectory}/${filePath}`)
|
||||||
.size(`${this.options.imageWidth ?? 200}x?`)
|
.size(`${this.options.imageWidth ?? 200}x?`)
|
||||||
.run();
|
.run();
|
||||||
} else {
|
} else {
|
||||||
console.log("Copying file", file.path);
|
const destination = `${builderContext.outputDirectory}/${filePath}`;
|
||||||
copyFile(file.path, `${builderContext.outputDirectory}/${fileName}`);
|
console.log("Copying file", file.path, "to", destination);
|
||||||
|
copyFile(file.path, destination);
|
||||||
}
|
}
|
||||||
if (file.menuEntry) {
|
if (file.menuEntry) {
|
||||||
menuManifest.push({
|
menuManifest.push({
|
||||||
name: fileName,
|
name: fileName,
|
||||||
link: file.path,
|
link: filePath,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
4
src/assets/base.css
Normal file
4
src/assets/base.css
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
:root {
|
||||||
|
--color-background: #1c1b28;
|
||||||
|
--color-accent: #00FFFF;
|
||||||
|
}
|
||||||
@@ -24,7 +24,6 @@ new ToolchainBuilder(paths)
|
|||||||
files: [
|
files: [
|
||||||
{
|
{
|
||||||
path: "src/templates/404.html",
|
path: "src/templates/404.html",
|
||||||
nameOverride: "Not Found Page",
|
|
||||||
menuEntry: false,
|
menuEntry: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -32,6 +31,14 @@ new ToolchainBuilder(paths)
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "src/assets/favicon.ico",
|
path: "src/assets/favicon.ico",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "src/assets/base.css"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "src/playground/dropdown.html",
|
||||||
|
menuEntry: true,
|
||||||
|
nameOverride: "Dropdown playground"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
|
|||||||
13
src/playground/dropdown.html
Normal file
13
src/playground/dropdown.html
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<html>
|
||||||
|
<meta>
|
||||||
|
<link href="base.css" rel="stylesheet" />
|
||||||
|
<style contenteditable>
|
||||||
|
body {
|
||||||
|
background-color: var(--color-background);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</meta>
|
||||||
|
|
||||||
|
<body>arst</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Document</title>
|
<title>Document</title>
|
||||||
|
<link href="base.css" rel="stylesheet" />
|
||||||
<style>
|
<style>
|
||||||
html {
|
html {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
@@ -23,7 +24,7 @@
|
|||||||
body {
|
body {
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
color: #fbfbfe;
|
color: #fbfbfe;
|
||||||
background-color: #1c1b28;
|
background-color: var(--color-background);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
Reference in New Issue
Block a user