-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.vue
More file actions
190 lines (160 loc) · 4.08 KB
/
app.vue
File metadata and controls
190 lines (160 loc) · 4.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<template>
<div id="app">
<NuxtPage />
</div>
</template>
<script setup lang="ts">
// Global application configuration
useHead({
htmlAttrs: {
lang: 'en',
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'format-detection', content: 'telephone=no' },
],
})
// SEO por defecto
useSeoMeta({
title: 'Live JS - Editor de código JavaScript en línea',
description:
'Editor de código JavaScript en tiempo real con ejecución instantánea. Escribe, ejecuta y comparte código JavaScript directamente en tu navegador.',
ogTitle: 'Live JS - Editor de código JavaScript en línea',
ogDescription:
'Editor de código JavaScript en tiempo real con ejecución instantánea. Escribe, ejecuta y comparte código JavaScript directamente en tu navegador.',
ogImage: '/og-image.png',
ogType: 'website',
twitterCard: 'summary_large_image',
twitterTitle: 'Live JS - Editor de código JavaScript en línea',
twitterDescription: 'Editor de código JavaScript en tiempo real con ejecución instantánea.',
twitterImage: 'https://live-javascript.vercel.app/og-image.png',
})
// Configuración de tema por defecto
onMounted(() => {
// Cargar configuración guardada del usuario
const savedSettings = localStorage.getItem('live-js-settings')
if (savedSettings) {
try {
const settings = JSON.parse(savedSettings)
// Aplicar tema
if (settings.theme === 'dark') {
document.documentElement.classList.add('dark')
} else {
document.documentElement.classList.remove('dark')
}
// Aplicar otras configuraciones globales si es necesario
} catch (error) {
console.error('Error al cargar configuración:', error)
}
}
// Detectar preferencia de tema del sistema si no hay configuración guardada
if (!savedSettings) {
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches
if (prefersDark) {
document.documentElement.classList.add('dark')
}
}
})
</script>
<style>
@reference "tailwindcss";
/* Estilos globales adicionales */
#app {
min-height: 100vh;
}
/* Scrollbar personalizada para toda la aplicación */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
background: #cbd5e1;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #94a3b8;
}
/* Modo oscuro para scrollbar */
.dark ::-webkit-scrollbar-track {
background: #1e293b;
}
.dark ::-webkit-scrollbar-thumb {
background: #475569;
}
.dark ::-webkit-scrollbar-thumb:hover {
background: #64748b;
}
/* Transiciones suaves para cambios de tema */
* {
transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
/* Estilos para elementos de carga */
.loading-spinner {
@apply rounded-full border-2 border-gray-300 border-t-green-600;
animation: var(--animate-spin);
}
/* Estilos para notificaciones toast (si se implementan) */
.toast {
@apply fixed top-4 right-4 z-50 max-w-sm p-4 rounded-lg shadow-lg;
}
.toast-success {
@apply bg-green-100 border border-green-200 text-green-800;
}
.toast-error {
@apply bg-red-100 border border-red-200 text-red-800;
}
.toast-warning {
@apply bg-yellow-100 border border-yellow-200 text-yellow-800;
}
.toast-info {
@apply bg-blue-100 border border-blue-200 text-blue-800;
}
/* Estilos para elementos de enfoque accesibles */
.focus-visible {
@apply outline-none ring-2 ring-green-500 ring-offset-2;
}
/* Estilos para elementos deshabilitados */
.disabled {
@apply opacity-50 cursor-not-allowed;
}
/* Animaciones personalizadas */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.fade-in {
animation: fadeIn 0.3s ease-out;
}
@keyframes slideIn {
from {
transform: translateX(-100%);
}
to {
transform: translateX(0);
}
}
.slide-in {
animation: slideIn 0.3s ease-out;
}
/* Responsive utilities adicionales */
@media (max-width: 640px) {
.mobile-hidden {
display: none;
}
}
@media (min-width: 641px) {
.mobile-only {
display: none;
}
}
</style>