Files
perfil/nuxt4/app/components/WindowTitleBar.vue
josedario87 05e5e9e7f8
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 57s
Mejorar visibilidad de patrón y eliminar gap en barra de título
- Aumentar opacidad del patrón en modo light (0.03 → 0.08)
- Agregar margin: 0 a la barra de título
- Forzar margin y padding: 0 en body y html
- Eliminar línea blanca entre body y barra de título
2025-10-16 23:31:03 -06:00

163 lines
3.9 KiB
Vue

<template>
<div
v-if="isWindowControlsOverlay"
class="window-titlebar"
:style="{ height: titlebarHeight }"
>
<div class="titlebar-content">
<span class="app-title">Perfil Nucleo</span>
</div>
</div>
</template>
<script setup lang="ts">
const isWindowControlsOverlay = ref(false)
const titlebarHeight = ref('40px')
onMounted(() => {
// Detectar si Window Controls Overlay está activo
if ('windowControlsOverlay' in navigator) {
const wco = (navigator as any).windowControlsOverlay
isWindowControlsOverlay.value = wco.visible
// Obtener la geometría del overlay si está disponible
if (wco.getTitlebarAreaRect) {
const rect = wco.getTitlebarAreaRect()
titlebarHeight.value = `${rect.height}px`
}
// Escuchar cambios en el overlay
wco.addEventListener('geometrychange', (event: any) => {
isWindowControlsOverlay.value = event.visible
if (event.titlebarAreaRect) {
titlebarHeight.value = `${event.titlebarAreaRect.height}px`
}
})
}
})
</script>
<style scoped>
.window-titlebar {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 9999;
/* Completamente transparente con patrón sutil */
background: transparent;
/* Patrón de puntos más visible en modo light para indicar área arrastrable */
background-image:
repeating-linear-gradient(
90deg,
transparent,
transparent 8px,
rgba(128, 128, 128, 0.08) 8px,
rgba(128, 128, 128, 0.08) 9px
),
repeating-linear-gradient(
0deg,
transparent,
transparent 8px,
rgba(128, 128, 128, 0.08) 8px,
rgba(128, 128, 128, 0.08) 9px
);
/* Esta propiedad permite arrastrar la ventana */
-webkit-app-region: drag;
app-region: drag;
display: flex;
align-items: center;
padding: 0 1rem;
user-select: none;
transition: all 0.3s ease;
/* Bloquear interacción con elementos debajo */
pointer-events: auto;
/* Eliminar cualquier margen o gap */
margin: 0;
}
.titlebar-content {
display: flex;
align-items: center;
width: 100%;
height: 100%;
}
.app-title {
font-size: 0.75rem;
font-weight: 600;
color: var(--color-gray-800);
white-space: nowrap;
padding: 0.25rem 0.75rem;
/* Chip cuadrado con bordes mínimamente redondeados */
background: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(10px) saturate(150%);
border-radius: 0.25rem;
box-shadow:
0 1px 3px 0 rgba(0, 0, 0, 0.1),
inset 0 1px 1px 0 rgba(255, 255, 255, 0.5);
border: 1px solid rgba(0, 0, 0, 0.08);
/* Permitir click en el chip */
-webkit-app-region: no-drag;
app-region: no-drag;
pointer-events: auto;
}
/* Permitir que los elementos interactivos dentro de la barra sean clickeables */
.window-titlebar button,
.window-titlebar a,
.window-titlebar input {
-webkit-app-region: no-drag;
app-region: no-drag;
pointer-events: auto;
}
/* Modo oscuro */
</style>
<style>
.dark .window-titlebar {
/* Patrón más sutil en modo oscuro */
background-image:
repeating-linear-gradient(
90deg,
transparent,
transparent 8px,
rgba(255, 255, 255, 0.02) 8px,
rgba(255, 255, 255, 0.02) 9px
),
repeating-linear-gradient(
0deg,
transparent,
transparent 8px,
rgba(255, 255, 255, 0.02) 8px,
rgba(255, 255, 255, 0.02) 9px
);
}
.dark .app-title {
color: var(--color-gray-100) !important;
background: rgba(0, 0, 0, 0.7) !important;
border-color: rgba(255, 255, 255, 0.1) !important;
box-shadow:
0 1px 3px 0 rgba(0, 0, 0, 0.3),
inset 0 1px 1px 0 rgba(255, 255, 255, 0.05) !important;
}
/* Ajustar el padding del contenido principal cuando la barra está visible */
.window-titlebar ~ * {
padding-top: env(titlebar-area-height, 0px);
}
/* Eliminar gap entre body y barra de título */
body {
margin: 0 !important;
padding: 0 !important;
}
html {
margin: 0 !important;
padding: 0 !important;
}
</style>