Minimal start
This commit is contained in:
parent
a9266b58be
commit
89f2001033
27 changed files with 1475 additions and 1014 deletions
|
@ -1,4 +1,5 @@
|
||||||
import { defineConfig } from 'astro/config'
|
import { defineConfig } from 'astro/config'
|
||||||
|
import mdx from '@astrojs/mdx'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
compressHTML: true,
|
compressHTML: true,
|
||||||
|
@ -6,7 +7,6 @@ export default defineConfig({
|
||||||
outDir: "../../.build/output/astro",
|
outDir: "../../.build/output/astro",
|
||||||
cacheDir: "../../build/output/astro-cache/",
|
cacheDir: "../../build/output/astro-cache/",
|
||||||
server: {host: false},
|
server: {host: false},
|
||||||
build: {
|
integrations: [mdx()],
|
||||||
format: 'file'
|
build: {format: 'file'}
|
||||||
}
|
|
||||||
})
|
})
|
Before Width: | Height: | Size: 749 B After Width: | Height: | Size: 749 B |
11
.app/astro/src/components/content.astro
Normal file
11
.app/astro/src/components/content.astro
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
const AllContent = await Astro.glob('../../../../content/*')
|
||||||
|
---
|
||||||
|
|
||||||
|
<content>
|
||||||
|
{AllContent.map((component) => (
|
||||||
|
<div id={component.name} class={component.options}>
|
||||||
|
<component.default/>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</content>
|
9
.app/astro/src/components/sidebar.astro
Normal file
9
.app/astro/src/components/sidebar.astro
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
const AllTabs = await Astro.glob('../../../../content/*')
|
||||||
|
---
|
||||||
|
|
||||||
|
<sidebar>
|
||||||
|
{AllTabs.map((tab) =>
|
||||||
|
<tab data-tab={tab.name} class={tab.options}>{tab.name}</tab>
|
||||||
|
)}
|
||||||
|
</sidebar>
|
23
.app/astro/src/pages/index.astro
Normal file
23
.app/astro/src/pages/index.astro
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
---
|
||||||
|
import '../../configuration.ts'
|
||||||
|
|
||||||
|
// App Layout
|
||||||
|
import App from '../structure/app.astro'
|
||||||
|
|
||||||
|
// Components
|
||||||
|
import Sidebar from '../components/sidebar.astro'
|
||||||
|
import Content from '../components/content.astro'
|
||||||
|
|
||||||
|
// Styles
|
||||||
|
import '../styles/body.scss'
|
||||||
|
import '../styles/components/content.scss'
|
||||||
|
import '../styles/components/sidebar.scss'
|
||||||
|
---
|
||||||
|
|
||||||
|
<App>
|
||||||
|
<Sidebar/>
|
||||||
|
<Content/>
|
||||||
|
<script>
|
||||||
|
import "../scripts/sidebar.js";
|
||||||
|
</script>
|
||||||
|
</App>
|
24
.app/astro/src/scripts/sidebar.js
Normal file
24
.app/astro/src/scripts/sidebar.js
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
// Credit: Tabbed Navigation by Casey Jardin
|
||||||
|
// Source: https://codepen.io/alpha1337/pen/mxWBpq
|
||||||
|
setTimeout(() => {
|
||||||
|
const _tabs = document.querySelectorAll('[data-tab]')
|
||||||
|
const _content = document.getElementsByClassName('active')
|
||||||
|
|
||||||
|
const toggleContent = function() {
|
||||||
|
if (!this.classList.contains("active")) {
|
||||||
|
|
||||||
|
Array.from(_content).forEach( item => {
|
||||||
|
item.classList.remove('active')
|
||||||
|
})
|
||||||
|
|
||||||
|
this.classList.add('active')
|
||||||
|
let currentTab = this.getAttribute('data-tab'),
|
||||||
|
_tabContent = document.getElementById(currentTab)
|
||||||
|
_tabContent.classList.add('active')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Array.from(_tabs).forEach( item => {
|
||||||
|
item.addEventListener('click', toggleContent)
|
||||||
|
})
|
||||||
|
}, 1000)
|
6
.app/astro/src/styles/body.scss
Normal file
6
.app/astro/src/styles/body.scss
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
body {
|
||||||
|
background: #313131;
|
||||||
|
color: white;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
10
.app/astro/src/styles/components/content.scss
Normal file
10
.app/astro/src/styles/components/content.scss
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
content {
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
left: 290px;
|
||||||
|
width: calc(100% - 290px);
|
||||||
|
div {
|
||||||
|
display: none;
|
||||||
|
&.active {display: inherit}
|
||||||
|
}
|
||||||
|
}
|
20
.app/astro/src/styles/components/sidebar.scss
Normal file
20
.app/astro/src/styles/components/sidebar.scss
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
sidebar {
|
||||||
|
position: fixed;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
width: 250px;
|
||||||
|
height: 100%;
|
||||||
|
background: #161616;
|
||||||
|
padding: 20px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
tab {
|
||||||
|
margin-bottom: 6px;
|
||||||
|
padding: 12px 24px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 14px;
|
||||||
|
cursor: pointer;
|
||||||
|
&:hover {background: #282828}
|
||||||
|
&.active {background-color: #323232;}
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,7 +7,9 @@ else if (process.env.NODE_ENV === 'production') {var devTools =false}
|
||||||
let mainWindow : BrowserWindow
|
let mainWindow : BrowserWindow
|
||||||
|
|
||||||
const {TitlebarRespect} = require('electron-titlebar-respect')
|
const {TitlebarRespect} = require('electron-titlebar-respect')
|
||||||
TitlebarRespect({})
|
TitlebarRespect({
|
||||||
|
frameLinux: false
|
||||||
|
})
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
launch: function() {
|
launch: function() {
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"include": [
|
"include": [
|
||||||
"../../app/electron/main/index.ts",
|
"../../.app/electron/main/index.ts",
|
||||||
"../../app/electron/main/window.ts"
|
"../../.app/electron/main/window.ts",
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"../../app/astro",
|
"../../.app/astro",
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -6,7 +6,7 @@
|
||||||
"outDir": "../output/electron",
|
"outDir": "../output/electron",
|
||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"strict": true,
|
"strict": false,
|
||||||
"skipLibCheck": true
|
"skipLibCheck": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
import App from '../structure/app.astro'
|
|
||||||
---
|
|
||||||
|
|
||||||
<App>
|
|
||||||
<p>Hello</p>
|
|
||||||
</App>
|
|
BIN
bun.lockb
Executable file
BIN
bun.lockb
Executable file
Binary file not shown.
|
@ -57,40 +57,6 @@ export const splash = {
|
||||||
backgroundColor: "#232323",
|
backgroundColor: "#232323",
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////
|
|
||||||
// Sidebar //
|
|
||||||
//////////////////////
|
|
||||||
export const SIDEBARTOP = [
|
|
||||||
{
|
|
||||||
text: "Dashboard",
|
|
||||||
icon: "wand-magic-sparkles",
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "Files",
|
|
||||||
icon: "folder-tree"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "Webview Demo",
|
|
||||||
icon: "globe"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "Webview Demo 2",
|
|
||||||
icon: "globe"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "iFrame Demo",
|
|
||||||
icon: "eye"
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
export const SIDEBARBOTTOM = [
|
|
||||||
{
|
|
||||||
text: "Settings",
|
|
||||||
icon: "sliders"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
// Electron Builder //
|
// Electron Builder //
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
|
|
4
content/sample.astro
Normal file
4
content/sample.astro
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
export const name = 'Sample'
|
||||||
|
export const options = 'active'
|
||||||
|
---
|
19
package.json
19
package.json
|
@ -2,18 +2,22 @@
|
||||||
"name": "nexus-polestar",
|
"name": "nexus-polestar",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
|
"trustedDependencies": ["electron"],
|
||||||
"main": ".build/output/electron/app/electron/main/index.js",
|
"main": ".build/output/electron/app/electron/main/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "concurrently -k -r -t -g -n \"yarn tsc\" \"yarn astro:start\" \"wait-on http://localhost:2023 && yarn electron:start\"",
|
"start": "concurrently -k -r \"bun run astro:start\" \"wait-on http://localhost:4321 && bun run electron:start\"",
|
||||||
"build": "yarn tsc && yarn astro:build && yarn electron:build",
|
"build": "bun run tsc && bun run astro:build && bun run electron:build",
|
||||||
"tsc": "tsc -p .build/devlopment/tsconfig-build.json",
|
"tsc": "tsc -p .build/devlopment/tsconfig-build.json",
|
||||||
"astro:start": "astro dev --silent --root ./app/astro/",
|
"astro:start": "astro dev --root ./.app/astro/",
|
||||||
"astro:build": "astro build --silent --root ./app/astro/",
|
"astro:build": "astro build --silent --root ./.app/astro/",
|
||||||
"electron:start": "NODE_ENV=development electron .",
|
"electron:start": "NODE_ENV=development electron .",
|
||||||
"electron:build": "electron-builder --config ./.build/electron-builder.ts",
|
"electron:build": "electron-builder --config ./.build/electron-builder.ts"
|
||||||
"update": "yarn upgrade --latest"
|
},
|
||||||
|
"compilerOptions": {
|
||||||
|
"types": ["bun-types"]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@astrojs/mdx": "^1.0.3",
|
||||||
"astro": "^3.0.12",
|
"astro": "^3.0.12",
|
||||||
"astro-color-scheme": "^1.1.2",
|
"astro-color-scheme": "^1.1.2",
|
||||||
"electron-titlebar-respect": "^1.1.2",
|
"electron-titlebar-respect": "^1.1.2",
|
||||||
|
@ -21,8 +25,9 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"concurrently": "^8.2.1",
|
"concurrently": "^8.2.1",
|
||||||
"electron": "^26.2.0",
|
"electron": "latest",
|
||||||
"electron-builder": "^24.6.4",
|
"electron-builder": "^24.6.4",
|
||||||
|
"sass": "^1.66.1",
|
||||||
"wait-on": "^7.0.1"
|
"wait-on": "^7.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in a new issue