style(electron): tool bar refactor to give two levels
This commit is contained in:
BIN
assets/toolkit/appicon/toolkitIcon.png
Normal file
BIN
assets/toolkit/appicon/toolkitIcon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 366 KiB |
@@ -8,23 +8,86 @@
|
||||
|
||||
<body>
|
||||
<div class="main-container">
|
||||
<aside class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<h3>4DSTAR</h3>
|
||||
<!-- Primary Category Sidebar (Tier 1) -->
|
||||
<aside class="primary-sidebar" id="primary-sidebar">
|
||||
<div class="primary-sidebar-header">
|
||||
<div class="brand-icon">
|
||||
<div class="star-icon">✦</div>
|
||||
<div class="brand-text">4D</div>
|
||||
<h3 class="app-title">STAR</h3>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="sidebar-nav">
|
||||
<button id="open-bundle-btn" class="nav-button active">Open Bundle</button>
|
||||
<button id="create-bundle-btn" class="nav-button">Create Bundle</button>
|
||||
<nav class="category-nav">
|
||||
<div class="category-item active" data-category="libplugin" title="libplugin">
|
||||
<div class="category-icon" style="background-color: #3b82f6;">LP</div>
|
||||
<span class="category-label">libplugin</span>
|
||||
</div>
|
||||
<div class="category-item" data-category="libconstants" title="libconstants">
|
||||
<div class="category-icon" style="background-color: #10b981;">LC</div>
|
||||
<span class="category-label">libconstants</span>
|
||||
</div>
|
||||
<div class="category-item" data-category="opat" title="OPAT Core">
|
||||
<div class="category-icon" style="background-color: #f59e0b;">OC</div>
|
||||
<span class="category-label">OPAT Core</span>
|
||||
</div>
|
||||
<div class="category-item" data-category="serif" title="SERiF Libraries">
|
||||
<div class="category-icon" style="background-color: #ef4444;">SL</div>
|
||||
<span class="category-label">SERiF Libraries</span>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="sidebar-footer">
|
||||
<p>v1.0.0</p>
|
||||
<div class="primary-sidebar-footer">
|
||||
<div class="version-info">v1.0.0</div>
|
||||
<button id="info-btn" class="info-button" title="About 4DSTAR">
|
||||
<span class="info-icon">ℹ️</span>
|
||||
Info
|
||||
<span class="info-label">Info</span>
|
||||
</button>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- Secondary Content Sidebar (Tier 2) -->
|
||||
<aside class="secondary-sidebar" id="secondary-sidebar">
|
||||
<!-- libplugin content (existing sidebar content) -->
|
||||
<div class="sidebar-content" data-category="libplugin">
|
||||
<div class="sidebar-header">
|
||||
<h3>Bundle Manager</h3>
|
||||
</div>
|
||||
<nav class="sidebar-nav">
|
||||
<button id="open-bundle-btn" class="nav-button active">Open Bundle</button>
|
||||
<button id="create-bundle-btn" class="nav-button">Create Bundle</button>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<!-- libconstants content (empty for now) -->
|
||||
<div class="sidebar-content hidden" data-category="libconstants">
|
||||
<div class="sidebar-header">
|
||||
<h3>Constants</h3>
|
||||
</div>
|
||||
<div class="empty-state">
|
||||
<p>Constants tools coming soon...</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- OPAT Core content (empty for now) -->
|
||||
<div class="sidebar-content hidden" data-category="opat">
|
||||
<div class="sidebar-header">
|
||||
<h3>OPAT Core</h3>
|
||||
</div>
|
||||
<div class="empty-state">
|
||||
<p>OPAT tools coming soon...</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SERiF Libraries content (empty for now) -->
|
||||
<div class="sidebar-content hidden" data-category="serif">
|
||||
<div class="sidebar-header">
|
||||
<h3>SERiF Libraries</h3>
|
||||
</div>
|
||||
<div class="empty-state">
|
||||
<p>SERiF tools coming soon...</p>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<main class="content-area">
|
||||
<div id="welcome-screen">
|
||||
<h1>Welcome to 4DSTAR Bundle Manager</h1>
|
||||
|
||||
@@ -16,6 +16,7 @@ const createWindow = () => {
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 1200,
|
||||
height: 800,
|
||||
icon: path.join(__dirname, 'toolkitIcon.png'),
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
contextIsolation: false,
|
||||
|
||||
@@ -258,10 +258,63 @@ function setupEventListeners() {
|
||||
// GitHub link functionality
|
||||
githubLink.addEventListener('click', (e) => {
|
||||
e.preventDefault();
|
||||
// You can update this URL to the actual GitHub repository
|
||||
const { ipcRenderer } = require('electron');
|
||||
ipcRenderer.invoke('open-external', 'https://github.com/tboudreaux/4DSTAR');
|
||||
});
|
||||
|
||||
// Two-Tiered Sidebar functionality
|
||||
const categoryItems = document.querySelectorAll('.category-item');
|
||||
const sidebarContents = document.querySelectorAll('.sidebar-content');
|
||||
|
||||
// Category switching functionality
|
||||
categoryItems.forEach(categoryItem => {
|
||||
categoryItem.addEventListener('click', () => {
|
||||
const selectedCategory = categoryItem.getAttribute('data-category');
|
||||
|
||||
// Remove active class from all category items
|
||||
categoryItems.forEach(item => item.classList.remove('active'));
|
||||
|
||||
// Add active class to clicked category
|
||||
categoryItem.classList.add('active');
|
||||
|
||||
// Hide all sidebar contents
|
||||
sidebarContents.forEach(content => content.classList.add('hidden'));
|
||||
|
||||
// Show selected category content
|
||||
const selectedContent = document.querySelector(`.sidebar-content[data-category="${selectedCategory}"]`);
|
||||
if (selectedContent) {
|
||||
selectedContent.classList.remove('hidden');
|
||||
}
|
||||
|
||||
// Update welcome screen title based on selected category
|
||||
updateWelcomeScreen(selectedCategory);
|
||||
});
|
||||
});
|
||||
|
||||
// Update welcome screen based on selected category
|
||||
function updateWelcomeScreen(category) {
|
||||
const welcomeTitle = document.querySelector('#welcome-screen h1');
|
||||
const welcomeMessage = document.querySelector('#welcome-screen p');
|
||||
|
||||
const categoryTitles = {
|
||||
'libplugin': 'Welcome to 4DSTAR Bundle Manager',
|
||||
'libconstants': 'Welcome to 4DSTAR Constants',
|
||||
'opat': 'Welcome to OPAT Core',
|
||||
'serif': 'Welcome to SERiF Libraries'
|
||||
};
|
||||
|
||||
const categoryMessages = {
|
||||
'libplugin': 'Open or create a bundle to get started.',
|
||||
'libconstants': 'Constants tools coming soon...',
|
||||
'opat': 'OPAT tools coming soon...',
|
||||
'serif': 'SERiF tools coming soon...'
|
||||
};
|
||||
|
||||
if (welcomeTitle) welcomeTitle.textContent = categoryTitles[category] || 'Welcome to 4DSTAR';
|
||||
if (welcomeMessage) welcomeMessage.textContent = categoryMessages[category] || 'Select a category to get started.';
|
||||
}
|
||||
|
||||
// Old modal code removed - now using tab-based interface
|
||||
|
||||
// Create modern table-based interface for fillable targets
|
||||
|
||||
@@ -49,69 +49,241 @@ body {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
width: var(--sidebar-width);
|
||||
/* Two-Tiered Sidebar System */
|
||||
|
||||
/* Primary Sidebar (Tier 1) - Category Bar */
|
||||
.primary-sidebar {
|
||||
width: 60px;
|
||||
background-color: var(--sidebar-bg);
|
||||
border-right: 1px solid var(--border-color);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-shrink: 0;
|
||||
transition: background-color 0.2s;
|
||||
transition: width 0.3s ease, background-color 0.2s;
|
||||
overflow: hidden;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.sidebar-header {
|
||||
.primary-sidebar:hover {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.primary-sidebar-header {
|
||||
padding: 20px;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(147, 197, 253, 0.02) 100%);
|
||||
}
|
||||
|
||||
.brand-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Ensure proper centering in collapsed state */
|
||||
.primary-sidebar:not(:hover) .brand-icon {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.primary-sidebar:not(:hover) .app-title {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.star-icon {
|
||||
font-size: 18px;
|
||||
color: #3b82f6;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.brand-text {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: #1f2937;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.app-title {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: #1f2937;
|
||||
letter-spacing: 1px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.primary-sidebar:hover .app-title {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.category-nav {
|
||||
padding: 15px 0;
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.category-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 12px 16px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
white-space: nowrap;
|
||||
margin: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.category-item:hover {
|
||||
background-color: var(--hover-color);
|
||||
}
|
||||
|
||||
.category-item.active {
|
||||
background-color: rgba(59, 130, 246, 0.1);
|
||||
border-left: 3px solid var(--primary-color);
|
||||
padding-left: 13px;
|
||||
}
|
||||
|
||||
.category-icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: white;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.category-label {
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.primary-sidebar:hover .category-label {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.primary-sidebar-footer {
|
||||
padding: 12px 16px 16px 16px;
|
||||
border-top: 1px solid var(--border-color);
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
.version-info {
|
||||
font-size: 0.8rem;
|
||||
color: var(--text-light);
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.primary-sidebar:hover .version-info {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Secondary Sidebar (Tier 2) - Content Sidebar */
|
||||
.secondary-sidebar {
|
||||
width: var(--sidebar-width);
|
||||
background-color: #fafbfc;
|
||||
border-right: 1px solid #e5e7eb;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-shrink: 0;
|
||||
transition: background-color 0.2s;
|
||||
box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.sidebar-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.sidebar-content.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar-header {
|
||||
padding: 24px 24px 20px 24px;
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
text-align: center;
|
||||
background: linear-gradient(135deg, rgba(59, 130, 246, 0.02) 0%, rgba(147, 197, 253, 0.01) 100%);
|
||||
}
|
||||
|
||||
.sidebar-header h3 {
|
||||
font-size: 1.2rem;
|
||||
font-weight: 600;
|
||||
font-size: 1.3rem;
|
||||
font-weight: 700;
|
||||
color: #1f2937;
|
||||
margin: 0;
|
||||
letter-spacing: -0.025em;
|
||||
}
|
||||
|
||||
.sidebar-nav {
|
||||
padding: 15px 10px;
|
||||
padding: 24px 20px;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.nav-button {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 12px 15px;
|
||||
padding: 14px 20px;
|
||||
margin-bottom: 8px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
background-color: transparent;
|
||||
color: var(--text-color);
|
||||
font-size: 0.95rem;
|
||||
background: white;
|
||||
border: 1px solid #e5e7eb;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s, color 0.2s;
|
||||
border-radius: 10px;
|
||||
transition: all 0.2s ease;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.nav-button:hover {
|
||||
background-color: var(--primary-color);
|
||||
color: white;
|
||||
background-color: #f8fafc;
|
||||
border-color: #d1d5db;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.nav-button.active {
|
||||
background-color: var(--primary-color);
|
||||
background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
|
||||
border-color: #2563eb;
|
||||
color: white;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
|
||||
}
|
||||
|
||||
.sidebar-footer {
|
||||
padding: 12px 16px 16px 16px;
|
||||
font-size: 0.8rem;
|
||||
color: var(--text-light);
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.nav-button.active:hover {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
|
||||
}
|
||||
|
||||
/* Info Button in Sidebar */
|
||||
.empty-state {
|
||||
padding: 60px 24px;
|
||||
text-align: center;
|
||||
color: #9ca3af;
|
||||
font-style: italic;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
/* Info Button Updates */
|
||||
.info-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -137,6 +309,15 @@ body {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.primary-sidebar:hover .info-label {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Content Area */
|
||||
.content-area {
|
||||
flex-grow: 1;
|
||||
|
||||
BIN
electron/toolkitIcon.png
Normal file
BIN
electron/toolkitIcon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 366 KiB |
Reference in New Issue
Block a user