Compare commits
2 Commits
776f367ee1
...
ace98a0fbc
| Author | SHA1 | Date | |
|---|---|---|---|
|
ace98a0fbc
|
|||
|
b2ddd95ff5
|
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "tools-app",
|
"name": "tools-app",
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "tools-app",
|
"name": "tools-app",
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lucide-vue-next": "^0.575.0",
|
"lucide-vue-next": "^0.575.0",
|
||||||
"vue": "^3.5.25",
|
"vue": "^3.5.25",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "tools-app",
|
"name": "tools-app",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
67
src/App.vue
67
src/App.vue
@@ -1,15 +1,50 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref, onMounted, onUnmounted } from 'vue'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
import Header from './components/Header.vue'
|
import Header from './components/Header.vue'
|
||||||
import Footer from './components/Footer.vue'
|
import Footer from './components/Footer.vue'
|
||||||
import Sidebar from './components/Sidebar.vue'
|
import Sidebar from './components/Sidebar.vue'
|
||||||
|
|
||||||
const isSidebarOpen = ref(true)
|
const isSidebarOpen = ref(window.innerWidth >= 768)
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
// Close sidebar on route change for mobile
|
||||||
|
router.afterEach(() => {
|
||||||
|
if (window.innerWidth < 768) {
|
||||||
|
isSidebarOpen.value = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
let lastWidth = window.innerWidth
|
||||||
|
|
||||||
|
const handleResize = () => {
|
||||||
|
const width = window.innerWidth
|
||||||
|
// Only change state when crossing the breakpoint
|
||||||
|
if (width >= 768 && lastWidth < 768) {
|
||||||
|
isSidebarOpen.value = true
|
||||||
|
} else if (width < 768 && lastWidth >= 768) {
|
||||||
|
isSidebarOpen.value = false
|
||||||
|
}
|
||||||
|
lastWidth = width
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
window.addEventListener('resize', handleResize)
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
window.removeEventListener('resize', handleResize)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Header @toggle-sidebar="isSidebarOpen = !isSidebarOpen" />
|
<Header @toggle-sidebar="isSidebarOpen = !isSidebarOpen" />
|
||||||
<div class="app-body">
|
<div class="app-body">
|
||||||
|
<div
|
||||||
|
class="sidebar-overlay"
|
||||||
|
:class="{ 'is-visible': isSidebarOpen }"
|
||||||
|
@click="isSidebarOpen = false"
|
||||||
|
></div>
|
||||||
<Sidebar :is-open="isSidebarOpen" />
|
<Sidebar :is-open="isSidebarOpen" />
|
||||||
<main class="main-content">
|
<main class="main-content">
|
||||||
<router-view />
|
<router-view />
|
||||||
@@ -24,6 +59,7 @@ const isSidebarOpen = ref(true)
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
overflow: hidden; /* Ensure body doesn't scroll */
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-content {
|
.main-content {
|
||||||
@@ -31,5 +67,32 @@ const isSidebarOpen = ref(true)
|
|||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%; /* Ensure it doesn't overflow */
|
max-width: 100%; /* Ensure it doesn't overflow */
|
||||||
|
overflow-y: auto; /* Allow content to scroll independently */
|
||||||
|
height: 100%; /* Take full height of app-body */
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-overlay {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
z-index: 900; /* Below sidebar (1000), above content */
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
transition: opacity 0.3s ease;
|
||||||
|
backdrop-filter: blur(2px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-overlay.is-visible {
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.sidebar-overlay {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const version = __APP_VERSION__;
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<footer class="app-footer unselectable">
|
<footer class="app-footer glass-panel unselectable">
|
||||||
<div class="footer-content">
|
<div class="footer-content">
|
||||||
<p>© {{ currentYear }} Tools App. v{{ version }}</p>
|
<p>© {{ currentYear }} Tools App. v{{ version }}</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -14,13 +14,18 @@ const version = __APP_VERSION__;
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.app-footer {
|
.app-footer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 1rem;
|
padding: 0.5rem;
|
||||||
background-color: #242424;
|
/* Background handled by glass-panel */
|
||||||
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
border-left: none;
|
||||||
|
border-right: none;
|
||||||
|
border-bottom: none;
|
||||||
|
border-radius: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-top: auto; /* Push to bottom in flex container */
|
margin-top: auto; /* Push to bottom in flex container */
|
||||||
|
z-index: 10;
|
||||||
|
height: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-content {
|
.footer-content {
|
||||||
@@ -31,7 +36,7 @@ const version = __APP_VERSION__;
|
|||||||
|
|
||||||
p {
|
p {
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
color: rgba(255, 255, 255, 0.6);
|
color: var(--text-muted);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,20 +17,42 @@ defineProps({
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.sidebar {
|
.sidebar {
|
||||||
width: 0;
|
/* Mobile First Styles */
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 250px;
|
||||||
background-color: var(--panel-bg);
|
background-color: var(--panel-bg);
|
||||||
backdrop-filter: blur(12px);
|
backdrop-filter: blur(12px);
|
||||||
-webkit-backdrop-filter: blur(12px);
|
-webkit-backdrop-filter: blur(12px);
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
transition: width 0.3s ease;
|
transition: transform 0.3s ease;
|
||||||
border-right: 1px solid var(--panel-border);
|
border-right: 1px solid var(--panel-border);
|
||||||
flex-shrink: 0;
|
z-index: 1000;
|
||||||
height: 100%;
|
|
||||||
box-shadow: var(--panel-shadow);
|
box-shadow: var(--panel-shadow);
|
||||||
|
transform: translateX(-100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar.is-open {
|
.sidebar.is-open {
|
||||||
width: 250px;
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.sidebar {
|
||||||
|
position: static;
|
||||||
|
transform: none;
|
||||||
|
width: 0;
|
||||||
|
height: auto;
|
||||||
|
transition: width 0.3s ease;
|
||||||
|
z-index: auto;
|
||||||
|
box-shadow: none; /* Shadow handled by panel logic or not needed inline */
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.is-open {
|
||||||
|
width: 250px;
|
||||||
|
transform: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-nav {
|
.sidebar-nav {
|
||||||
@@ -38,11 +60,19 @@ defineProps({
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 250px; /* Fixed width for content */
|
width: 250px; /* Fixed width for content */
|
||||||
|
min-width: 250px;
|
||||||
|
padding-top: 1rem; /* Add some top padding for mobile aesthetic */
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.sidebar-nav {
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-item {
|
.nav-item {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 0.5rem;
|
padding: 0.75rem 1rem;
|
||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
transition: background-color 0.2s, color 0.2s;
|
transition: background-color 0.2s, color 0.2s;
|
||||||
|
|||||||
@@ -84,7 +84,8 @@ body {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
min-width: 320px;
|
min-width: 320px;
|
||||||
min-height: 100vh;
|
height: 100vh;
|
||||||
|
overflow: hidden; /* Prevent body scroll */
|
||||||
}
|
}
|
||||||
|
|
||||||
#app {
|
#app {
|
||||||
@@ -92,6 +93,7 @@ body {
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
overflow: hidden; /* Prevent app scroll */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Common UI Element Styles */
|
/* Common UI Element Styles */
|
||||||
|
|||||||
Reference in New Issue
Block a user