Minimal start

This commit is contained in:
Korbs 2023-09-10 05:31:31 -04:00
parent a9266b58be
commit 89f2001033
No known key found for this signature in database
27 changed files with 1475 additions and 1014 deletions

View file

@ -1,4 +1,5 @@
import { defineConfig } from 'astro/config'
import mdx from '@astrojs/mdx'
export default defineConfig({
compressHTML: true,
@ -6,7 +7,6 @@ export default defineConfig({
outDir: "../../.build/output/astro",
cacheDir: "../../build/output/astro-cache/",
server: {host: false},
build: {
format: 'file'
}
integrations: [mdx()],
build: {format: 'file'}
})

View file

Before

Width:  |  Height:  |  Size: 749 B

After

Width:  |  Height:  |  Size: 749 B

View 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>

View 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>

View 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>

View 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)

View file

@ -0,0 +1,6 @@
body {
background: #313131;
color: white;
font-family: Arial, Helvetica, sans-serif;
overflow: hidden;
}

View file

@ -0,0 +1,10 @@
content {
position: absolute;
top: 0px;
left: 290px;
width: calc(100% - 290px);
div {
display: none;
&.active {display: inherit}
}
}

View 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;}
}
}

View file

@ -7,7 +7,9 @@ else if (process.env.NODE_ENV === 'production') {var devTools =false}
let mainWindow : BrowserWindow
const {TitlebarRespect} = require('electron-titlebar-respect')
TitlebarRespect({})
TitlebarRespect({
frameLinux: false
})
module.exports = {
launch: function() {

View file

@ -1,10 +1,10 @@
{
"extends": "./tsconfig.json",
"include": [
"../../app/electron/main/index.ts",
"../../app/electron/main/window.ts"
"../../.app/electron/main/index.ts",
"../../.app/electron/main/window.ts",
],
"exclude": [
"../../app/astro",
"../../.app/astro",
]
}

View file

@ -6,7 +6,7 @@
"outDir": "../output/electron",
"removeComments": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"strict": false,
"skipLibCheck": true
}
}

View file

@ -1,7 +0,0 @@
---
import App from '../structure/app.astro'
---
<App>
<p>Hello</p>
</App>

BIN
bun.lockb Executable file

Binary file not shown.

View file

@ -57,40 +57,6 @@ export const splash = {
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 //
///////////////////////////////

4
content/sample.astro Normal file
View file

@ -0,0 +1,4 @@
---
export const name = 'Sample'
export const options = 'active'
---

View file

@ -2,18 +2,22 @@
"name": "nexus-polestar",
"version": "0.0.1",
"license": "AGPL-3.0-or-later",
"trustedDependencies": ["electron"],
"main": ".build/output/electron/app/electron/main/index.js",
"scripts": {
"start": "concurrently -k -r -t -g -n \"yarn tsc\" \"yarn astro:start\" \"wait-on http://localhost:2023 && yarn electron:start\"",
"build": "yarn tsc && yarn astro:build && yarn electron:build",
"start": "concurrently -k -r \"bun run astro:start\" \"wait-on http://localhost:4321 && bun run electron:start\"",
"build": "bun run tsc && bun run astro:build && bun run electron:build",
"tsc": "tsc -p .build/devlopment/tsconfig-build.json",
"astro:start": "astro dev --silent --root ./app/astro/",
"astro:build": "astro build --silent --root ./app/astro/",
"astro:start": "astro dev --root ./.app/astro/",
"astro:build": "astro build --silent --root ./.app/astro/",
"electron:start": "NODE_ENV=development electron .",
"electron:build": "electron-builder --config ./.build/electron-builder.ts",
"update": "yarn upgrade --latest"
"electron:build": "electron-builder --config ./.build/electron-builder.ts"
},
"compilerOptions": {
"types": ["bun-types"]
},
"dependencies": {
"@astrojs/mdx": "^1.0.3",
"astro": "^3.0.12",
"astro-color-scheme": "^1.1.2",
"electron-titlebar-respect": "^1.1.2",
@ -21,8 +25,9 @@
},
"devDependencies": {
"concurrently": "^8.2.1",
"electron": "^26.2.0",
"electron": "latest",
"electron-builder": "^24.6.4",
"sass": "^1.66.1",
"wait-on": "^7.0.1"
}
}
}

2302
yarn.lock

File diff suppressed because it is too large Load diff