diff --git a/src/components/SearchScript.astro b/src/components/SearchScript.astro index 966ab1a..260f560 100644 --- a/src/components/SearchScript.astro +++ b/src/components/SearchScript.astro @@ -248,14 +248,16 @@ document.addEventListener('alpine:init', () => { iconSizeValue: 2, // Slider value: 1=small, 2=medium, 3=large iconSize: 'medium', // small, medium, large viewMode: 'grid', // grid or list + displayMode: 'both', // both, image, or name debounceTimeout: null, // For debouncing slider changes init() { baseSearch.init.call(this); - // Apply initial icon size and view mode + // Apply initial icon size, view mode, and display mode this.applyIconSize(); this.applyViewMode(); + this.applyDisplayMode(); }, // Icon size methods @@ -331,6 +333,44 @@ document.addEventListener('alpine:init', () => { // Add the new view mode class appList.classList.add(`view-mode-${this.viewMode}`); + // Update all category sections + document.querySelectorAll('.category-section').forEach(section => { + const gridContainer = section.querySelector('.grid'); + if (gridContainer) { + // Update grid classes based on view mode + if (this.viewMode === 'grid') { + gridContainer.classList.remove('grid-cols-1'); + gridContainer.classList.add('grid-cols-2', 'sm:grid-cols-3', 'lg:grid-cols-4'); + } else { + gridContainer.classList.remove('grid-cols-2', 'sm:grid-cols-3', 'lg:grid-cols-4'); + gridContainer.classList.add('grid-cols-1'); + } + } + }); + }, + + // Display mode methods + setDisplayMode(mode) { + this.displayMode = mode; + this.applyDisplayMode(); + }, + + applyDisplayMode() { + const appList = document.getElementById('app-list'); + if (!appList) return; + + // Remove existing display mode classes + appList.classList.remove('display-both', 'display-image-only', 'display-name-only'); + + // Add the new display mode class + if (this.displayMode === 'image') { + appList.classList.add('display-image-only'); + } else if (this.displayMode === 'name') { + appList.classList.add('display-name-only'); + } else { + appList.classList.add('display-both'); + } + // Update all category sections document.querySelectorAll('.category-section').forEach(section => { const gridContainer = section.querySelector('.grid'); diff --git a/src/components/StyleControlsScript.astro b/src/components/StyleControlsScript.astro index 6cf755f..0f8769d 100644 --- a/src/components/StyleControlsScript.astro +++ b/src/components/StyleControlsScript.astro @@ -49,6 +49,15 @@ if (e.altKey && e.key === 'g' && this.toggleViewMode) { this.toggleViewMode(); } + + // Alt+B, Alt+I, Alt+N for display modes + if (e.altKey && e.key === 'b' && this.setDisplayMode) { + this.setDisplayMode('both'); + } else if (e.altKey && e.key === 'i' && this.setDisplayMode) { + this.setDisplayMode('image'); + } else if (e.altKey && e.key === 'n' && this.setDisplayMode) { + this.setDisplayMode('name'); + } }); } }; diff --git a/src/components/common/ServiceCard.astro b/src/components/common/ServiceCard.astro index 37390a4..2b67bd4 100644 --- a/src/components/common/ServiceCard.astro +++ b/src/components/common/ServiceCard.astro @@ -76,6 +76,44 @@ const { name, href, img, alt } = Astro.props; text-align: left; } + /* Display mode styles */ + /* Default display mode (both) */ + .service-icon-container, .service-name { + display: block; + } + + /* Image only mode */ + :global(.display-image-only) .service-name { + display: none; + } + + :global(.display-image-only) .service-icon-container { + display: flex; + justify-content: center; + align-items: center; + } + + /* Name only mode */ + :global(.display-name-only) .service-icon-container { + display: none; + } + + :global(.display-name-only) .service-name { + display: block; + margin-top: 0; + font-size: 1.1rem; + } + + /* Adjust list view for different display modes */ + :global(.view-mode-list.display-name-only) .service-card { + padding: 0.75rem 1rem; + } + + :global(.view-mode-list.display-image-only) .service-card { + justify-content: center; + padding: 0.5rem; + } + /* Icon size adjustments with CSS variables for fine-grained control */ :global(#app-list) { --icon-scale: 2; /* Default medium size */ diff --git a/src/components/common/StyleControls.astro b/src/components/common/StyleControls.astro index cc5ab90..4d3badb 100644 --- a/src/components/common/StyleControls.astro +++ b/src/components/common/StyleControls.astro @@ -54,6 +54,51 @@ const { )} + {/* Display options selector */} +
+ +
+ + + +
+
+ {showViewSelector && (
@@ -86,14 +131,14 @@ const {