diff --git a/bootstrap/web/config.php b/bootstrap/web/config.php index e89912f..c16923c 100644 --- a/bootstrap/web/config.php +++ b/bootstrap/web/config.php @@ -64,8 +64,8 @@ return [ ])) ], 'scripts' => [ - 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js', - 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/semantic.min.js' + 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js', + 'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.8/semantic.min.js' ], 'fonts' => (object) [ 'text/css' => [ diff --git a/common/Controller/Web/Home.php b/common/Controller/Web/Home.php index 44b80ce..9ce39b8 100644 --- a/common/Controller/Web/Home.php +++ b/common/Controller/Web/Home.php @@ -14,6 +14,7 @@ class Home { 'title' => 'BUSCAMOS LA MEJOR EXPERIENCA', 'contenido' => 'Eventos hechos a tu medida' ]; + $resumen = $handler->load('resumen'); $servicios = $handler->load('servicios'); $frase = (object) [ 'titulo' => 'Lorem ipsum dolor sit amet, consectetur adipiscing', @@ -39,6 +40,6 @@ class Home { } } - return $view->render($response, 'home', compact('banner', 'servicios', 'frase', 'clientes', 'testimonios', 'galeria')); + return $view->render($response, 'home', compact('banner', 'resumen', 'servicios', 'frase', 'clientes', 'testimonios', 'galeria')); } } diff --git a/public/assets/scripts/home.js b/public/assets/scripts/home.js index 46f8438..ca15274 100644 --- a/public/assets/scripts/home.js +++ b/public/assets/scripts/home.js @@ -1,9 +1,9 @@ -let clientes = { +const clientes = { clientes: [], current: 0, rows: 2, cols: 6, - decreaseClientes: () => { + decreaseClientes: function() { $('#img_clientes').find('.row').find('.column:last-child').remove() clientes.current -= clientes.rows if (clientes.current < - clientes.cols * clientes.rows) { @@ -20,7 +20,7 @@ let clientes = { $('
').attr('class', 'five wide tablet two wide computer column').append(clientes.clientes[n + 1]) ) }, - increaseClientes: () => { + increaseClientes: function() { $('#img_clientes').find('.row').find('.column:first-child').remove() clientes.current += 2 if (clientes.current > clientes.clientes.length - clientes.cols * clientes.rows) { @@ -33,7 +33,7 @@ let clientes = { $('').attr('class', 'five wide tablet two wide computer column').append(clientes.clientes[clientes.current + clientes.cols * clientes.rows - 1]) ) }, - setup: () => { + setup: function() { $('.ci .icon').css('cursor', 'pointer').click(function() { if ($(this).attr('class').indexOf('left') != -1) { clientes.decreaseClientes() @@ -43,7 +43,7 @@ let clientes = { }) } } -let eventos = { +const eventos = { eventos: [], current_tab: 'none', base_url: '', @@ -54,7 +54,6 @@ let eventos = { if (filter != 'none' && el.servicio != filter) { return } - console.debug(el.image) grid.append( $('').attr('class', 'eight wide tablet four wide computer column').append( $('').attr('class', 'ui basic segment').append( @@ -108,7 +107,7 @@ let eventos = { }) } } -let testimonios = { +const testimonios = { testimonios: [], current_testimonio: 0, cambiar: (id) => { @@ -134,3 +133,57 @@ let testimonios = { $('#marcador').find('.icon.outline').css('cursor', 'pointer') } } +const galeria = { + id: '', + galeria_id: '', + galeria: [], + base_url: '', + setup: function() { + $('.servicio').click((e) => { + this.changeTab(e.target) + }) + }, + changeTab: function(tab) { + this.drawTabs(tab) + $(this.galeria_id).html('') + const servicio = $(tab).attr('data-filter') + const grid = $(this.galeria_id) + $.each(this.galeria, (i, el) => { + if (servicio != 'none' && el.servicio != servicio) { + return + } + grid.append(this.drawCard(i, el)) + }) + }, + drawTabs: function(active) { + $(this.id).find('.servicio.active').removeClass('active') + $(active).addClass('active') + }, + drawCard: function(key, item) { + /* + + */ + return $('').attr('class', 'eight wide tablet four wide computer column').append( + $('').attr('class', 'ui basic segment').append( + $('').attr('href', this.base_url + '/evento/' + key).append( + $('').attr('class', 'ui image').html(item.image) + ).append( + $('').attr('class', 'ui center aligned header').html(item.titulo + '