Big restructure
This commit is contained in:
parent
1d0ebeb2b7
commit
4ee57ab459
69 changed files with 124 additions and 124 deletions
18
apps/desktop/src/bun/index.ts
Normal file
18
apps/desktop/src/bun/index.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { BrowserWindow } from "electrobun/bun";
|
||||
|
||||
// Create the main application window
|
||||
const mainWindow = new BrowserWindow({
|
||||
title: "Hello Electrobun!",
|
||||
url: "views://mainview/index.html",
|
||||
renderer: "cef",
|
||||
frame: {
|
||||
width: 800,
|
||||
height: 800,
|
||||
x: 200,
|
||||
y: 200,
|
||||
},
|
||||
});
|
||||
|
||||
mainWindow.url = "views://mainview/index.html";
|
||||
|
||||
console.log("Hello Electrobun app started!");
|
||||
126
apps/desktop/src/mainview/index.css
Normal file
126
apps/desktop/src/mainview/index.css
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family:
|
||||
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
|
||||
Cantarell, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: #333;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 40px 20px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: white;
|
||||
font-size: 3rem;
|
||||
text-align: center;
|
||||
margin-bottom: 8px;
|
||||
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
font-size: 1.25rem;
|
||||
text-align: center;
|
||||
margin-top: 0;
|
||||
margin-bottom: 40px;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.welcome-section {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 30px;
|
||||
margin: 30px 0;
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #2563eb;
|
||||
margin-top: 30px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 20px 0;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
.links {
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
margin: 25px 0;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.doc-link {
|
||||
display: inline-block;
|
||||
background: #2563eb;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
padding: 12px 20px;
|
||||
border-radius: 8px;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s ease;
|
||||
box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
|
||||
}
|
||||
|
||||
.doc-link:hover {
|
||||
background: #1d4ed8;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
|
||||
}
|
||||
|
||||
code {
|
||||
background: #f1f5f9;
|
||||
color: #475569;
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.footer {
|
||||
text-align: center;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
margin-top: 40px;
|
||||
padding: 20px;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 8px;
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
.footer p {
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
/* Dark mode support */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.welcome-section {
|
||||
background: #1f2937;
|
||||
color: #f3f4f6;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #60a5fa;
|
||||
}
|
||||
|
||||
code {
|
||||
background: #374151;
|
||||
color: #d1d5db;
|
||||
}
|
||||
}
|
||||
64
apps/desktop/src/mainview/index.html
Normal file
64
apps/desktop/src/mainview/index.html
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Hello Electrobun!</title>
|
||||
<link rel="stylesheet" href="index.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Hello Electrobun! 🎉</h1>
|
||||
<p class="subtitle">A fast, cross-platform desktop app framework</p>
|
||||
|
||||
<div class="welcome-section">
|
||||
<p>
|
||||
Welcome to your first Electrobun app! This framework combines the
|
||||
power of Bun with native desktop capabilities.
|
||||
</p>
|
||||
|
||||
<h2>What is Electrobun?</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<strong>Fast:</strong> Built on Bun's lightning-fast JavaScript
|
||||
runtime
|
||||
</li>
|
||||
<li>
|
||||
<strong>Native:</strong> Access to system APIs like menus, trays,
|
||||
and file dialogs
|
||||
</li>
|
||||
<li>
|
||||
<strong>Cross-platform:</strong> Works on macOS, Windows, and Linux
|
||||
</li>
|
||||
<li>
|
||||
<strong>Web-based UI:</strong> Use familiar HTML, CSS, and
|
||||
JavaScript for your interface
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Get Started</h2>
|
||||
<p>
|
||||
Ready to build something amazing? Check out the documentation and
|
||||
examples:
|
||||
</p>
|
||||
|
||||
<div class="links">
|
||||
<a href="https://electrobun.dev/" class="doc-link"> 📚 Electrobun </a>
|
||||
<a href="https://github.com/blackboardsh/electrobun" class="doc-link">
|
||||
🐙 GitHub Repository
|
||||
</a>
|
||||
<a href="https://electrobun.dev/docs/apis/bun/" class="doc-link">
|
||||
💡 Api Docs
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<p>
|
||||
Edit <code>src/bun/index.ts</code> and <code>src/mainview/</code> to
|
||||
customize your app
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
1
apps/desktop/src/mainview/index.ts
Normal file
1
apps/desktop/src/mainview/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
console.log("Hello Electrobun view loaded!");
|
||||
Loading…
Reference in a new issue