1280 lines
51 KiB
HTML
1280 lines
51 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<title>Customizer Completo - Estilo WordPress</title>
|
||
<style>
|
||
* {
|
||
margin: 0;
|
||
padding: 0;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
body {
|
||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||
overflow: hidden;
|
||
font-size: 13px;
|
||
}
|
||
|
||
/* HEADER - Estilo WordPress */
|
||
.customizer-header {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
height: 46px;
|
||
background: #23282d;
|
||
border-bottom: 1px solid #000;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 0 15px;
|
||
z-index: 1000;
|
||
}
|
||
|
||
.customizer-header-left {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 15px;
|
||
}
|
||
|
||
.customizer-logo {
|
||
width: 20px;
|
||
height: 20px;
|
||
background: #fff;
|
||
border-radius: 3px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
color: #23282d;
|
||
font-weight: bold;
|
||
font-size: 12px;
|
||
}
|
||
|
||
.customizer-title {
|
||
color: #fff;
|
||
font-size: 14px;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.customizer-close {
|
||
background: transparent;
|
||
border: none;
|
||
color: #a7aaad;
|
||
font-size: 20px;
|
||
cursor: pointer;
|
||
padding: 5px 10px;
|
||
line-height: 1;
|
||
}
|
||
|
||
.customizer-close:hover {
|
||
color: #fff;
|
||
}
|
||
|
||
/* MAIN CONTAINER */
|
||
.customizer-container {
|
||
display: flex;
|
||
height: 100vh;
|
||
padding-top: 46px;
|
||
}
|
||
|
||
/* SIDEBAR - Estilo WordPress */
|
||
.customizer-sidebar {
|
||
width: 300px;
|
||
background: #fff;
|
||
border-right: 1px solid #ddd;
|
||
display: flex;
|
||
flex-direction: column;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.customizer-sidebar-content {
|
||
flex: 1;
|
||
overflow-y: auto;
|
||
overflow-x: hidden;
|
||
padding: 0;
|
||
scroll-behavior: smooth;
|
||
}
|
||
|
||
/* Menú lateral de secciones con PANELES */
|
||
.customizer-nav {
|
||
background: #f6f7f7;
|
||
border-bottom: 1px solid #ddd;
|
||
padding: 0;
|
||
}
|
||
|
||
.customizer-nav-panel {
|
||
border-bottom: 1px solid #ddd;
|
||
}
|
||
|
||
.customizer-nav-panel-title {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 12px 15px;
|
||
color: #23282d;
|
||
font-size: 13px;
|
||
font-weight: 600;
|
||
cursor: pointer;
|
||
user-select: none;
|
||
background: #f6f7f7;
|
||
}
|
||
|
||
.customizer-nav-panel-title:hover {
|
||
background: #fff;
|
||
}
|
||
|
||
.customizer-nav-panel-title::after {
|
||
content: '▼';
|
||
font-size: 10px;
|
||
color: #646970;
|
||
transition: transform 0.2s;
|
||
}
|
||
|
||
.customizer-nav-panel-title.collapsed::after {
|
||
transform: rotate(-90deg);
|
||
}
|
||
|
||
.customizer-nav-panel-items {
|
||
display: block;
|
||
}
|
||
|
||
.customizer-nav-panel-items.collapsed {
|
||
display: none;
|
||
}
|
||
|
||
.customizer-nav-item {
|
||
display: block;
|
||
padding: 12px 15px 12px 30px;
|
||
color: #23282d;
|
||
text-decoration: none;
|
||
border-bottom: 1px solid #ddd;
|
||
font-size: 13px;
|
||
cursor: pointer;
|
||
transition: background 0.1s;
|
||
}
|
||
|
||
.customizer-nav-item:hover {
|
||
background: #fff;
|
||
}
|
||
|
||
.customizer-nav-item.active {
|
||
background: #fff;
|
||
border-left: 4px solid #2271b1;
|
||
padding-left: 26px;
|
||
}
|
||
|
||
.customizer-nav-item-single {
|
||
padding-left: 15px;
|
||
}
|
||
|
||
/* Secciones de controles */
|
||
.customizer-section {
|
||
display: none;
|
||
padding: 20px;
|
||
}
|
||
|
||
.customizer-section.active {
|
||
display: block;
|
||
}
|
||
|
||
.customizer-section-title {
|
||
font-size: 13px;
|
||
font-weight: 600;
|
||
color: #23282d;
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.5px;
|
||
margin-bottom: 15px;
|
||
padding-bottom: 10px;
|
||
border-bottom: 1px solid #ddd;
|
||
}
|
||
|
||
.customizer-control {
|
||
margin-bottom: 20px;
|
||
}
|
||
|
||
.customizer-control-label {
|
||
display: block;
|
||
font-size: 13px;
|
||
font-weight: 600;
|
||
color: #23282d;
|
||
margin-bottom: 8px;
|
||
}
|
||
|
||
.customizer-control-description {
|
||
font-size: 12px;
|
||
color: #646970;
|
||
margin-top: 5px;
|
||
margin-bottom: 8px;
|
||
}
|
||
|
||
/* Toggle Switch - Estilo WordPress */
|
||
.customizer-toggle {
|
||
position: relative;
|
||
display: inline-block;
|
||
width: 50px;
|
||
height: 24px;
|
||
}
|
||
|
||
.customizer-toggle input {
|
||
opacity: 0;
|
||
width: 0;
|
||
height: 0;
|
||
}
|
||
|
||
.customizer-toggle-slider {
|
||
position: absolute;
|
||
cursor: pointer;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
background-color: #c3c4c7;
|
||
transition: 0.3s;
|
||
border-radius: 24px;
|
||
}
|
||
|
||
.customizer-toggle-slider:before {
|
||
position: absolute;
|
||
content: "";
|
||
height: 18px;
|
||
width: 18px;
|
||
left: 3px;
|
||
bottom: 3px;
|
||
background-color: white;
|
||
transition: 0.3s;
|
||
border-radius: 50%;
|
||
}
|
||
|
||
.customizer-toggle input:checked + .customizer-toggle-slider {
|
||
background-color: #2271b1;
|
||
}
|
||
|
||
.customizer-toggle input:checked + .customizer-toggle-slider:before {
|
||
transform: translateX(26px);
|
||
}
|
||
|
||
.customizer-toggle-wrapper {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
}
|
||
|
||
/* Range Slider - Estilo WordPress */
|
||
.customizer-range {
|
||
width: 100%;
|
||
height: 6px;
|
||
border-radius: 3px;
|
||
background: #ddd;
|
||
outline: none;
|
||
-webkit-appearance: none;
|
||
}
|
||
|
||
.customizer-range::-webkit-slider-thumb {
|
||
-webkit-appearance: none;
|
||
appearance: none;
|
||
width: 18px;
|
||
height: 18px;
|
||
border-radius: 50%;
|
||
background: #2271b1;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.customizer-range::-moz-range-thumb {
|
||
width: 18px;
|
||
height: 18px;
|
||
border-radius: 50%;
|
||
background: #2271b1;
|
||
cursor: pointer;
|
||
border: none;
|
||
}
|
||
|
||
.customizer-range-wrapper {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
}
|
||
|
||
.customizer-range-value {
|
||
min-width: 50px;
|
||
text-align: right;
|
||
font-size: 13px;
|
||
color: #646970;
|
||
}
|
||
|
||
/* Inputs estándar */
|
||
.customizer-control-input {
|
||
width: 100%;
|
||
padding: 8px 12px;
|
||
border: 1px solid #8c8f94;
|
||
border-radius: 4px;
|
||
font-size: 14px;
|
||
font-family: inherit;
|
||
transition: border-color 0.2s, box-shadow 0.2s;
|
||
}
|
||
|
||
.customizer-control-input:focus {
|
||
outline: none;
|
||
border-color: #2271b1;
|
||
box-shadow: 0 0 0 1px #2271b1;
|
||
}
|
||
|
||
.customizer-control-textarea {
|
||
min-height: 80px;
|
||
resize: vertical;
|
||
}
|
||
|
||
/* Color picker */
|
||
.customizer-color-group {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
}
|
||
|
||
.customizer-color-picker {
|
||
width: 50px;
|
||
height: 40px;
|
||
border: 1px solid #8c8f94;
|
||
border-radius: 4px;
|
||
cursor: pointer;
|
||
padding: 2px;
|
||
}
|
||
|
||
.customizer-color-text {
|
||
flex: 1;
|
||
}
|
||
|
||
/* Media Upload Button */
|
||
.customizer-media-button {
|
||
padding: 8px 16px;
|
||
background: #f0f0f1;
|
||
border: 1px solid #8c8f94;
|
||
border-radius: 4px;
|
||
cursor: pointer;
|
||
font-size: 13px;
|
||
color: #2c3338;
|
||
transition: all 0.2s;
|
||
}
|
||
|
||
.customizer-media-button:hover {
|
||
background: #dcdcde;
|
||
}
|
||
|
||
.customizer-media-preview {
|
||
margin-top: 10px;
|
||
max-width: 100%;
|
||
border: 1px solid #ddd;
|
||
border-radius: 4px;
|
||
display: none;
|
||
}
|
||
|
||
.customizer-media-preview.show {
|
||
display: block;
|
||
}
|
||
|
||
/* Select */
|
||
.customizer-control-select {
|
||
width: 100%;
|
||
padding: 8px 12px;
|
||
border: 1px solid #8c8f94;
|
||
border-radius: 4px;
|
||
font-size: 14px;
|
||
font-family: inherit;
|
||
background: #fff;
|
||
cursor: pointer;
|
||
}
|
||
|
||
/* Repeater Control */
|
||
.customizer-repeater {
|
||
border: 1px solid #ddd;
|
||
border-radius: 4px;
|
||
padding: 15px;
|
||
margin-bottom: 15px;
|
||
background: #f9f9f9;
|
||
}
|
||
|
||
.customizer-repeater-header {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
margin-bottom: 10px;
|
||
}
|
||
|
||
.customizer-repeater-title {
|
||
font-weight: 600;
|
||
font-size: 13px;
|
||
}
|
||
|
||
.customizer-repeater-remove {
|
||
background: #d63638;
|
||
color: white;
|
||
border: none;
|
||
padding: 4px 10px;
|
||
border-radius: 3px;
|
||
cursor: pointer;
|
||
font-size: 12px;
|
||
}
|
||
|
||
.customizer-repeater-add {
|
||
background: #2271b1;
|
||
color: white;
|
||
border: none;
|
||
padding: 8px 16px;
|
||
border-radius: 4px;
|
||
cursor: pointer;
|
||
font-size: 13px;
|
||
margin-top: 10px;
|
||
}
|
||
|
||
/* Icon Picker */
|
||
.customizer-icon-picker {
|
||
display: grid;
|
||
grid-template-columns: repeat(6, 1fr);
|
||
gap: 8px;
|
||
margin-top: 10px;
|
||
max-height: 200px;
|
||
overflow-y: auto;
|
||
padding: 10px;
|
||
border: 1px solid #ddd;
|
||
border-radius: 4px;
|
||
background: #f9f9f9;
|
||
}
|
||
|
||
.customizer-icon-item {
|
||
width: 40px;
|
||
height: 40px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
border: 1px solid #ddd;
|
||
border-radius: 4px;
|
||
cursor: pointer;
|
||
font-size: 18px;
|
||
background: #fff;
|
||
transition: all 0.2s;
|
||
}
|
||
|
||
.customizer-icon-item:hover {
|
||
background: #f0f0f1;
|
||
border-color: #2271b1;
|
||
}
|
||
|
||
.customizer-icon-item.selected {
|
||
background: #2271b1;
|
||
color: white;
|
||
border-color: #2271b1;
|
||
}
|
||
|
||
/* Hidden Control */
|
||
.customizer-control-hidden {
|
||
display: none;
|
||
}
|
||
|
||
/* Divider */
|
||
.customizer-divider {
|
||
height: 1px;
|
||
background: #ddd;
|
||
margin: 20px 0;
|
||
}
|
||
|
||
/* PREVIEW */
|
||
.customizer-preview {
|
||
flex: 1;
|
||
background: #f0f0f1;
|
||
position: relative;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.customizer-preview iframe {
|
||
width: 100%;
|
||
height: 100%;
|
||
border: none;
|
||
}
|
||
|
||
/* FOOTER - Estilo WordPress */
|
||
.customizer-footer {
|
||
position: fixed;
|
||
bottom: 0;
|
||
left: 0;
|
||
right: 0;
|
||
height: 50px;
|
||
background: #f6f7f7;
|
||
border-top: 1px solid #ddd;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 0 20px;
|
||
z-index: 1000;
|
||
}
|
||
|
||
.customizer-footer-left {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
}
|
||
|
||
.customizer-footer-right {
|
||
display: flex;
|
||
gap: 10px;
|
||
}
|
||
|
||
.customizer-btn {
|
||
padding: 8px 16px;
|
||
border: none;
|
||
border-radius: 4px;
|
||
font-size: 13px;
|
||
font-weight: 500;
|
||
cursor: pointer;
|
||
transition: all 0.2s;
|
||
}
|
||
|
||
.customizer-btn-secondary {
|
||
background: #f0f0f1;
|
||
color: #2c3338;
|
||
}
|
||
|
||
.customizer-btn-secondary:hover {
|
||
background: #dcdcde;
|
||
}
|
||
|
||
.customizer-btn-primary {
|
||
background: #2271b1;
|
||
color: #fff;
|
||
}
|
||
|
||
.customizer-btn-primary:hover {
|
||
background: #135e96;
|
||
}
|
||
|
||
.customizer-btn-primary:disabled {
|
||
background: #c3c4c7;
|
||
cursor: not-allowed;
|
||
}
|
||
|
||
.customizer-btn-discard {
|
||
display: none;
|
||
}
|
||
|
||
.customizer-btn-discard.has-changes {
|
||
display: inline-block;
|
||
}
|
||
|
||
.customizer-status {
|
||
font-size: 12px;
|
||
color: #646970;
|
||
margin-left: 10px;
|
||
}
|
||
|
||
.customizer-status.saving {
|
||
color: #2271b1;
|
||
}
|
||
|
||
.customizer-status.saved {
|
||
color: #00a32a;
|
||
}
|
||
|
||
.customizer-status.error {
|
||
color: #d63638;
|
||
}
|
||
|
||
.customizer-unsaved-indicator {
|
||
display: inline-block;
|
||
width: 8px;
|
||
height: 8px;
|
||
background: #d63638;
|
||
border-radius: 50%;
|
||
margin-right: 8px;
|
||
display: none;
|
||
}
|
||
|
||
.customizer-unsaved-indicator.has-changes {
|
||
display: inline-block;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<!-- HEADER -->
|
||
<div class="customizer-header">
|
||
<div class="customizer-header-left">
|
||
<div class="customizer-logo">W</div>
|
||
<div class="customizer-title">Personalizar</div>
|
||
</div>
|
||
<button class="customizer-close" onclick="closeCustomizer()" title="Cerrar">×</button>
|
||
</div>
|
||
|
||
<!-- MAIN CONTAINER -->
|
||
<div class="customizer-container">
|
||
<!-- SIDEBAR -->
|
||
<div class="customizer-sidebar">
|
||
<!-- Menú lateral con PANELES -->
|
||
<div class="customizer-nav">
|
||
<!-- Panel: General Options -->
|
||
<div class="customizer-nav-panel">
|
||
<div class="customizer-nav-panel-title" onclick="togglePanel(this)">
|
||
General Options
|
||
</div>
|
||
<div class="customizer-nav-panel-items">
|
||
<a href="#" class="customizer-nav-item" data-section="site-identity">Identidad del sitio</a>
|
||
<a href="#" class="customizer-nav-item" data-section="top-header">Top Bar Setting</a>
|
||
<a href="#" class="customizer-nav-item" data-section="header-nav">Menu Bar Setting</a>
|
||
<a href="#" class="customizer-nav-item" data-section="page-header">Page Header Setting</a>
|
||
<a href="#" class="customizer-nav-item" data-section="top-scroller">Top Scroller Setting</a>
|
||
<a href="#" class="customizer-nav-item" data-section="blog-setting">Blog Setting</a>
|
||
<a href="#" class="customizer-nav-item" data-section="footer-setting">Footer Setting</a>
|
||
<a href="#" class="customizer-nav-item" data-section="typography">Body Typography Setting</a>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Secciones individuales -->
|
||
<a href="#" class="customizer-nav-item customizer-nav-item-single active" data-section="colors">Colores</a>
|
||
<a href="#" class="customizer-nav-item customizer-nav-item-single" data-section="content">Contenido</a>
|
||
<a href="#" class="customizer-nav-item customizer-nav-item-single" data-section="media">Medios</a>
|
||
<a href="#" class="customizer-nav-item customizer-nav-item-single" data-section="contact">Contacto</a>
|
||
<a href="#" class="customizer-nav-item customizer-nav-item-single" data-section="social">Redes Sociales</a>
|
||
<a href="#" class="customizer-nav-item customizer-nav-item-single" data-section="widgets">Widgets</a>
|
||
<a href="#" class="customizer-nav-item customizer-nav-item-single" data-section="menus">Menús</a>
|
||
</div>
|
||
|
||
<!-- Contenido de secciones -->
|
||
<div class="customizer-sidebar-content">
|
||
<!-- Sección: Identidad del sitio -->
|
||
<div class="customizer-section active" id="site-identity">
|
||
<div class="customizer-section-title">Identidad del sitio</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Nombre del sitio</label>
|
||
<input type="text" class="customizer-control-input" id="site_name" value="Mi Restaurante" data-setting="site_name">
|
||
<div class="customizer-control-description">El nombre aparece en el encabezado del sitio.</div>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Descripción corta</label>
|
||
<textarea class="customizer-control-input customizer-control-textarea" id="site_description" data-setting="site_description">El mejor restaurante de la ciudad</textarea>
|
||
<div class="customizer-control-description">En pocas palabras, explica de qué trata este sitio.</div>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Logo Size</label>
|
||
<div class="customizer-range-wrapper">
|
||
<input type="range" class="customizer-range" id="logo_size" min="50" max="300" value="150" data-setting="logo_size">
|
||
<span class="customizer-range-value" id="logo_size_value">150px</span>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Site Title Font Size</label>
|
||
<div class="customizer-range-wrapper">
|
||
<input type="range" class="customizer-range" id="site_title_font_size" min="12" max="48" value="24" data-setting="site_title_font_size">
|
||
<span class="customizer-range-value" id="site_title_font_size_value">24px</span>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Site Description Font Size</label>
|
||
<div class="customizer-range-wrapper">
|
||
<input type="range" class="customizer-range" id="site_desc_font_size" min="10" max="24" value="14" data-setting="site_desc_font_size">
|
||
<span class="customizer-range-value" id="site_desc_font_size_value">14px</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Sección: Top Bar Setting -->
|
||
<div class="customizer-section" id="top-header">
|
||
<div class="customizer-section-title">Top Bar Setting</div>
|
||
|
||
<div class="customizer-control customizer-control-hidden">
|
||
<label class="customizer-control-label">Setting</label>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<div class="customizer-toggle-wrapper">
|
||
<label class="customizer-control-label">Enable / Disable ?</label>
|
||
<label class="customizer-toggle">
|
||
<input type="checkbox" id="enable_top_header" data-setting="enable_top_header" checked>
|
||
<span class="customizer-toggle-slider"></span>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="customizer-divider"></div>
|
||
|
||
<!-- Info 1 -->
|
||
<div class="customizer-control customizer-control-hidden">
|
||
<label class="customizer-control-label">Info 1</label>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<div class="customizer-toggle-wrapper">
|
||
<label class="customizer-control-label">Enable / Disable Info 1?</label>
|
||
<label class="customizer-toggle">
|
||
<input type="checkbox" id="enable_hdr_info1" data-setting="enable_hdr_info1" checked>
|
||
<span class="customizer-toggle-slider"></span>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Icon</label>
|
||
<input type="text" class="customizer-control-input" id="hdr_info1_icon" value="fa-phone" data-setting="hdr_info1_icon" placeholder="fa-phone">
|
||
<div class="customizer-control-description">Font Awesome icon class</div>
|
||
<div class="customizer-icon-picker" id="icon_picker_1">
|
||
<div class="customizer-icon-item" data-icon="fa-phone">📞</div>
|
||
<div class="customizer-icon-item" data-icon="fa-envelope">✉️</div>
|
||
<div class="customizer-icon-item" data-icon="fa-map-marker">📍</div>
|
||
<div class="customizer-icon-item" data-icon="fa-clock">🕐</div>
|
||
<div class="customizer-icon-item" data-icon="fa-facebook">📘</div>
|
||
<div class="customizer-icon-item" data-icon="fa-instagram">📷</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Title</label>
|
||
<input type="text" class="customizer-control-input" id="hdr_info1_title" value="+34 123 456 789" data-setting="hdr_info1_title">
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Link</label>
|
||
<input type="text" class="customizer-control-input" id="hdr_info1_link" value="tel:+34123456789" data-setting="hdr_info1_link">
|
||
</div>
|
||
|
||
<div class="customizer-divider"></div>
|
||
|
||
<!-- Info 2 -->
|
||
<div class="customizer-control customizer-control-hidden">
|
||
<label class="customizer-control-label">Info 2</label>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<div class="customizer-toggle-wrapper">
|
||
<label class="customizer-control-label">Enable / Disable Info 2?</label>
|
||
<label class="customizer-toggle">
|
||
<input type="checkbox" id="enable_hdr_info2" data-setting="enable_hdr_info2">
|
||
<span class="customizer-toggle-slider"></span>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Icon</label>
|
||
<input type="text" class="customizer-control-input" id="hdr_info2_icon" value="fa-envelope" data-setting="hdr_info2_icon">
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Title</label>
|
||
<input type="text" class="customizer-control-input" id="hdr_info2_title" value="info@restaurante.com" data-setting="hdr_info2_title">
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Link</label>
|
||
<input type="text" class="customizer-control-input" id="hdr_info2_link" value="mailto:info@restaurante.com" data-setting="hdr_info2_link">
|
||
</div>
|
||
|
||
<div class="customizer-divider"></div>
|
||
|
||
<!-- Info 3 -->
|
||
<div class="customizer-control customizer-control-hidden">
|
||
<label class="customizer-control-label">Info 3</label>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<div class="customizer-toggle-wrapper">
|
||
<label class="customizer-control-label">Enable / Disable Info 3?</label>
|
||
<label class="customizer-toggle">
|
||
<input type="checkbox" id="enable_hdr_info3" data-setting="enable_hdr_info3">
|
||
<span class="customizer-toggle-slider"></span>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Icon</label>
|
||
<input type="text" class="customizer-control-input" id="hdr_info3_icon" value="fa-map-marker" data-setting="hdr_info3_icon">
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Title</label>
|
||
<input type="text" class="customizer-control-input" id="hdr_info3_title" value="Calle Principal 123" data-setting="hdr_info3_title">
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Link</label>
|
||
<input type="text" class="customizer-control-input" id="hdr_info3_link" value="https://maps.google.com" data-setting="hdr_info3_link">
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Sección: Colores -->
|
||
<div class="customizer-section" id="colors">
|
||
<div class="customizer-section-title">Colores</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Color primario</label>
|
||
<div class="customizer-color-group">
|
||
<input type="color" class="customizer-color-picker" id="color_primary" value="#c94d4d" data-setting="color_primary">
|
||
<input type="text" class="customizer-control-input customizer-color-text" id="color_primary_text" value="#c94d4d" readonly>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Color secundario</label>
|
||
<div class="customizer-color-group">
|
||
<input type="color" class="customizer-color-picker" id="color_secondary" value="#d97757" data-setting="color_secondary">
|
||
<input type="text" class="customizer-control-input customizer-color-text" id="color_secondary_text" value="#d97757" readonly>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Color de texto</label>
|
||
<div class="customizer-color-group">
|
||
<input type="color" class="customizer-color-picker" id="color_text" value="#2c2c2c" data-setting="color_text">
|
||
<input type="text" class="customizer-control-input customizer-color-text" id="color_text_text" value="#2c2c2c" readonly>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Color de fondo</label>
|
||
<div class="customizer-color-group">
|
||
<input type="color" class="customizer-color-picker" id="color_background" value="#ffffff" data-setting="color_background">
|
||
<input type="text" class="customizer-control-input customizer-color-text" id="color_background_text" value="#ffffff" readonly>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Sección: Tipografía -->
|
||
<div class="customizer-section" id="typography">
|
||
<div class="customizer-section-title">Body Typography Setting</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Font Family</label>
|
||
<select class="customizer-control-select" id="font_family" data-setting="font_family">
|
||
<option value="Roboto">Roboto</option>
|
||
<option value="Georgia">Georgia</option>
|
||
<option value="Playfair Display">Playfair Display</option>
|
||
<option value="Cormorant Garamond">Cormorant Garamond</option>
|
||
<option value="Oswald">Oswald</option>
|
||
<option value="Arial">Arial</option>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Font Size</label>
|
||
<div class="customizer-range-wrapper">
|
||
<input type="range" class="customizer-range" id="font_size" min="12" max="24" value="16" data-setting="font_size">
|
||
<span class="customizer-range-value" id="font_size_value">16px</span>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Line Height</label>
|
||
<div class="customizer-range-wrapper">
|
||
<input type="range" class="customizer-range" id="line_height" min="1" max="3" step="0.1" value="1.6" data-setting="line_height">
|
||
<span class="customizer-range-value" id="line_height_value">1.6</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Sección: Medios -->
|
||
<div class="customizer-section" id="media">
|
||
<div class="customizer-section-title">Medios</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Logo</label>
|
||
<button class="customizer-media-button" onclick="openMediaUploader('logo')">Seleccionar imagen</button>
|
||
<img id="logo_preview" class="customizer-media-preview" src="" alt="Logo preview">
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Imagen Hero</label>
|
||
<button class="customizer-media-button" onclick="openMediaUploader('hero')">Seleccionar imagen</button>
|
||
<img id="hero_preview" class="customizer-media-preview" src="" alt="Hero preview">
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Favicon</label>
|
||
<button class="customizer-media-button" onclick="openMediaUploader('favicon')">Seleccionar imagen</button>
|
||
<img id="favicon_preview" class="customizer-media-preview" src="" alt="Favicon preview">
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Sección: Redes Sociales con Repeater -->
|
||
<div class="customizer-section" id="social">
|
||
<div class="customizer-section-title">Redes Sociales</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">WhatsApp Flotante</label>
|
||
<div class="customizer-toggle-wrapper">
|
||
<label class="customizer-control-label">Activar botón flotante</label>
|
||
<label class="customizer-toggle">
|
||
<input type="checkbox" id="enable_whatsapp_float" data-setting="enable_whatsapp_float" checked>
|
||
<span class="customizer-toggle-slider"></span>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Número de WhatsApp</label>
|
||
<input type="tel" class="customizer-control-input" id="whatsapp_number" value="+34123456789" data-setting="whatsapp_number">
|
||
<div class="customizer-control-description">Número para el botón flotante</div>
|
||
</div>
|
||
|
||
<div class="customizer-divider"></div>
|
||
|
||
<div id="social_repeater">
|
||
<div class="customizer-repeater">
|
||
<div class="customizer-repeater-header">
|
||
<div class="customizer-repeater-title">Red Social 1</div>
|
||
<button class="customizer-repeater-remove" onclick="removeRepeaterItem(this)">Eliminar</button>
|
||
</div>
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Tipo</label>
|
||
<select class="customizer-control-select" data-setting="social_type">
|
||
<option value="facebook">Facebook</option>
|
||
<option value="instagram">Instagram</option>
|
||
<option value="twitter">Twitter</option>
|
||
<option value="youtube">YouTube</option>
|
||
<option value="linkedin">LinkedIn</option>
|
||
</select>
|
||
</div>
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">URL</label>
|
||
<input type="url" class="customizer-control-input" data-setting="social_url" placeholder="https://...">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<button class="customizer-repeater-add" onclick="addRepeaterItem()">+ Añadir Red Social</button>
|
||
</div>
|
||
|
||
<!-- Más secciones... (simplificadas por espacio) -->
|
||
<div class="customizer-section" id="content">
|
||
<div class="customizer-section-title">Contenido</div>
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Título principal</label>
|
||
<input type="text" class="customizer-control-input" id="hero_title" value="Bienvenido" data-setting="hero_title">
|
||
</div>
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Descripción</label>
|
||
<textarea class="customizer-control-input customizer-control-textarea" id="hero_description" data-setting="hero_description">Descripción de tu restaurante...</textarea>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="customizer-section" id="contact">
|
||
<div class="customizer-section-title">Contacto</div>
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Dirección</label>
|
||
<input type="text" class="customizer-control-input" id="contact_address" placeholder="Calle Principal 123" data-setting="contact_address">
|
||
</div>
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Teléfono</label>
|
||
<input type="tel" class="customizer-control-input" id="contact_phone" placeholder="+34 123 456 789" data-setting="contact_phone">
|
||
</div>
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Email</label>
|
||
<input type="email" class="customizer-control-input" id="contact_email" placeholder="contacto@restaurante.com" data-setting="contact_email">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- PREVIEW -->
|
||
<div class="customizer-preview">
|
||
<div class="customizer-loading" id="preview-loading">Cargando vista previa...</div>
|
||
<iframe id="preview-iframe" src="about:blank" style="display: none;"></iframe>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- FOOTER -->
|
||
<div class="customizer-footer">
|
||
<div class="customizer-footer-left">
|
||
<span class="customizer-unsaved-indicator" id="unsaved-indicator"></span>
|
||
<span class="customizer-status" id="status-text">Listo</span>
|
||
</div>
|
||
<div class="customizer-footer-right">
|
||
<button class="customizer-btn customizer-btn-secondary customizer-btn-discard" id="btn-discard" onclick="discardChanges()">Descartar cambios</button>
|
||
<button class="customizer-btn customizer-btn-primary" id="btn-save" onclick="saveChanges()">Guardar y Publicar</button>
|
||
</div>
|
||
</div>
|
||
|
||
<script>
|
||
// Estado del customizer
|
||
let hasUnsavedChanges = false;
|
||
let originalValues = {};
|
||
let currentValues = {};
|
||
let repeaterCount = 1;
|
||
|
||
// Inicializar
|
||
document.addEventListener('DOMContentLoaded', function() {
|
||
// Guardar valores originales
|
||
document.querySelectorAll('[data-setting]').forEach(input => {
|
||
originalValues[input.dataset.setting] = input.value || (input.checked ? true : false);
|
||
currentValues[input.dataset.setting] = input.value || (input.checked ? true : false);
|
||
});
|
||
|
||
// Navegación entre secciones
|
||
document.querySelectorAll('.customizer-nav-item').forEach(item => {
|
||
item.addEventListener('click', function(e) {
|
||
e.preventDefault();
|
||
const section = this.dataset.section;
|
||
if (section) {
|
||
showSection(section);
|
||
}
|
||
});
|
||
});
|
||
|
||
// Sincronizar color pickers
|
||
document.querySelectorAll('.customizer-color-picker').forEach(picker => {
|
||
const textInput = document.getElementById(picker.id + '_text');
|
||
if (textInput) {
|
||
picker.addEventListener('input', function() {
|
||
textInput.value = this.value;
|
||
markAsChanged();
|
||
updatePreview();
|
||
});
|
||
}
|
||
});
|
||
|
||
// Range sliders
|
||
document.querySelectorAll('.customizer-range').forEach(range => {
|
||
const valueSpan = document.getElementById(range.id + '_value');
|
||
if (valueSpan) {
|
||
range.addEventListener('input', function() {
|
||
const unit = this.id.includes('font') || this.id.includes('size') ? 'px' : '';
|
||
valueSpan.textContent = this.value + unit;
|
||
markAsChanged();
|
||
updatePreview();
|
||
});
|
||
}
|
||
});
|
||
|
||
// Toggle switches
|
||
document.querySelectorAll('.customizer-toggle input').forEach(toggle => {
|
||
toggle.addEventListener('change', function() {
|
||
markAsChanged();
|
||
updatePreview();
|
||
});
|
||
});
|
||
|
||
// Escuchar cambios en inputs
|
||
document.querySelectorAll('[data-setting]').forEach(input => {
|
||
input.addEventListener('input', function() {
|
||
markAsChanged();
|
||
updatePreview();
|
||
});
|
||
|
||
input.addEventListener('change', function() {
|
||
markAsChanged();
|
||
updatePreview();
|
||
});
|
||
});
|
||
|
||
// Icon picker
|
||
document.querySelectorAll('.customizer-icon-item').forEach(item => {
|
||
item.addEventListener('click', function() {
|
||
const icon = this.dataset.icon;
|
||
const picker = this.closest('.customizer-icon-picker');
|
||
const input = document.getElementById(picker.id.replace('icon_picker_', 'hdr_info') + '_icon');
|
||
if (input) {
|
||
input.value = icon;
|
||
markAsChanged();
|
||
updatePreview();
|
||
}
|
||
|
||
// Visual feedback
|
||
picker.querySelectorAll('.customizer-icon-item').forEach(i => i.classList.remove('selected'));
|
||
this.classList.add('selected');
|
||
});
|
||
});
|
||
|
||
// Confirmar antes de salir si hay cambios
|
||
window.addEventListener('beforeunload', function(e) {
|
||
if (hasUnsavedChanges) {
|
||
e.preventDefault();
|
||
e.returnValue = '';
|
||
}
|
||
});
|
||
});
|
||
|
||
// Toggle panel
|
||
function togglePanel(element) {
|
||
const items = element.nextElementSibling;
|
||
element.classList.toggle('collapsed');
|
||
items.classList.toggle('collapsed');
|
||
}
|
||
|
||
// Mostrar sección
|
||
function showSection(sectionId) {
|
||
// Ocultar todas las secciones
|
||
document.querySelectorAll('.customizer-section').forEach(section => {
|
||
section.classList.remove('active');
|
||
});
|
||
|
||
// Mostrar sección seleccionada
|
||
const section = document.getElementById(sectionId);
|
||
if (section) {
|
||
section.classList.add('active');
|
||
}
|
||
|
||
// Actualizar navegación
|
||
document.querySelectorAll('.customizer-nav-item').forEach(item => {
|
||
item.classList.remove('active');
|
||
if (item.dataset.section === sectionId) {
|
||
item.classList.add('active');
|
||
}
|
||
});
|
||
}
|
||
|
||
// Marcar como cambiado
|
||
function markAsChanged() {
|
||
hasUnsavedChanges = true;
|
||
document.getElementById('unsaved-indicator').classList.add('has-changes');
|
||
document.getElementById('btn-discard').classList.add('has-changes');
|
||
|
||
// Actualizar valores actuales
|
||
document.querySelectorAll('[data-setting]').forEach(input => {
|
||
if (input.type === 'checkbox') {
|
||
currentValues[input.dataset.setting] = input.checked;
|
||
} else {
|
||
currentValues[input.dataset.setting] = input.value;
|
||
}
|
||
});
|
||
}
|
||
|
||
// Actualizar preview (simulado)
|
||
function updatePreview() {
|
||
console.log('Preview actualizado:', currentValues);
|
||
}
|
||
|
||
// Guardar cambios
|
||
function saveChanges() {
|
||
const btn = document.getElementById('btn-save');
|
||
const status = document.getElementById('status-text');
|
||
|
||
btn.disabled = true;
|
||
status.textContent = 'Guardando...';
|
||
status.className = 'customizer-status saving';
|
||
|
||
// Simular guardado
|
||
setTimeout(() => {
|
||
Object.keys(currentValues).forEach(key => {
|
||
originalValues[key] = currentValues[key];
|
||
});
|
||
|
||
hasUnsavedChanges = false;
|
||
document.getElementById('unsaved-indicator').classList.remove('has-changes');
|
||
document.getElementById('btn-discard').classList.remove('has-changes');
|
||
|
||
status.textContent = 'Guardado';
|
||
status.className = 'customizer-status saved';
|
||
btn.disabled = false;
|
||
|
||
setTimeout(() => {
|
||
status.textContent = 'Listo';
|
||
status.className = 'customizer-status';
|
||
}, 2000);
|
||
}, 1000);
|
||
}
|
||
|
||
// Descartar cambios
|
||
function discardChanges() {
|
||
if (!confirm('¿Descartar todos los cambios sin guardar?')) {
|
||
return;
|
||
}
|
||
|
||
// Restaurar valores originales
|
||
Object.keys(originalValues).forEach(key => {
|
||
const input = document.querySelector(`[data-setting="${key}"]`);
|
||
if (input) {
|
||
if (input.type === 'checkbox') {
|
||
input.checked = originalValues[key];
|
||
} else {
|
||
input.value = originalValues[key];
|
||
}
|
||
currentValues[key] = originalValues[key];
|
||
}
|
||
});
|
||
|
||
// Sincronizar color pickers
|
||
document.querySelectorAll('.customizer-color-picker').forEach(picker => {
|
||
const textInput = document.getElementById(picker.id + '_text');
|
||
if (textInput) {
|
||
picker.value = textInput.value;
|
||
}
|
||
});
|
||
|
||
// Sincronizar ranges
|
||
document.querySelectorAll('.customizer-range').forEach(range => {
|
||
const valueSpan = document.getElementById(range.id + '_value');
|
||
if (valueSpan) {
|
||
const unit = range.id.includes('font') || range.id.includes('size') ? 'px' : '';
|
||
valueSpan.textContent = range.value + unit;
|
||
}
|
||
});
|
||
|
||
hasUnsavedChanges = false;
|
||
document.getElementById('unsaved-indicator').classList.remove('has-changes');
|
||
document.getElementById('btn-discard').classList.remove('has-changes');
|
||
|
||
updatePreview();
|
||
}
|
||
|
||
// Cerrar customizer
|
||
function closeCustomizer() {
|
||
if (hasUnsavedChanges) {
|
||
if (!confirm('¿Tienes cambios sin guardar. ¿Seguro que quieres salir?')) {
|
||
return;
|
||
}
|
||
}
|
||
alert('Redirigiendo al dashboard...');
|
||
}
|
||
|
||
// Media uploader (simulado)
|
||
function openMediaUploader(type) {
|
||
alert('En WordPress real, esto abre el selector de medios. Tipo: ' + type);
|
||
// Simular selección
|
||
const preview = document.getElementById(type + '_preview');
|
||
if (preview) {
|
||
preview.src = 'https://via.placeholder.com/300x200?text=' + type;
|
||
preview.classList.add('show');
|
||
}
|
||
markAsChanged();
|
||
}
|
||
|
||
// Repeater functions
|
||
function addRepeaterItem() {
|
||
repeaterCount++;
|
||
const container = document.getElementById('social_repeater');
|
||
const newItem = document.createElement('div');
|
||
newItem.className = 'customizer-repeater';
|
||
newItem.innerHTML = `
|
||
<div class="customizer-repeater-header">
|
||
<div class="customizer-repeater-title">Red Social ${repeaterCount}</div>
|
||
<button class="customizer-repeater-remove" onclick="removeRepeaterItem(this)">Eliminar</button>
|
||
</div>
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">Tipo</label>
|
||
<select class="customizer-control-select" data-setting="social_type_${repeaterCount}">
|
||
<option value="facebook">Facebook</option>
|
||
<option value="instagram">Instagram</option>
|
||
<option value="twitter">Twitter</option>
|
||
<option value="youtube">YouTube</option>
|
||
<option value="linkedin">LinkedIn</option>
|
||
</select>
|
||
</div>
|
||
<div class="customizer-control">
|
||
<label class="customizer-control-label">URL</label>
|
||
<input type="url" class="customizer-control-input" data-setting="social_url_${repeaterCount}" placeholder="https://...">
|
||
</div>
|
||
`;
|
||
container.appendChild(newItem);
|
||
markAsChanged();
|
||
}
|
||
|
||
function removeRepeaterItem(button) {
|
||
if (confirm('¿Eliminar esta red social?')) {
|
||
button.closest('.customizer-repeater').remove();
|
||
markAsChanged();
|
||
}
|
||
}
|
||
</script>
|
||
</body>
|
||
</html>
|