Falta responsive y boton para subir
This commit is contained in:
@ -1,10 +1,38 @@
|
||||
function resize() {
|
||||
let p = 400 / 944
|
||||
$('.container').each(function(i, el) {
|
||||
let height = $(this).height
|
||||
let width = $(this).width
|
||||
var proportionals = []
|
||||
var widths = []
|
||||
var heights = []
|
||||
var changeables = []
|
||||
function register_resizeables() {
|
||||
proportionals.push($('img'))
|
||||
//widths.push()
|
||||
heights.push($('#backgrounds div'))
|
||||
changeables.push($('.sticky'))
|
||||
}
|
||||
|
||||
$(this).width = height * p;
|
||||
const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0)
|
||||
const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0)
|
||||
|
||||
function mod_height(elem, p) {
|
||||
elem.height = (elem.height * p)
|
||||
}
|
||||
function mod_width(elem, p) {
|
||||
elem.width = (elem.width * p)
|
||||
}
|
||||
function mod_dim(elem, p) {
|
||||
mod_width(elem, p)
|
||||
mod_height(elem, p)
|
||||
}
|
||||
function resize() {
|
||||
let p = 400 / 1080
|
||||
|
||||
$.each(proportionals, (i, el) => {
|
||||
mod_dim(el, p)
|
||||
})
|
||||
$.each(widths, (i, el) => {
|
||||
mod_width(el, p)
|
||||
})
|
||||
$.each(heights, (i, el) => {
|
||||
mod_height(el, p)
|
||||
})
|
||||
}
|
||||
|
||||
@ -216,11 +244,68 @@ let conversemos_form = {
|
||||
}
|
||||
}
|
||||
|
||||
let testimonios = {
|
||||
testimonios: [
|
||||
"Este soporte que compré en @Stand-cl me cambió la vida, me sirve para el teléfono y el ipad, y ya no tengo que andar acomodando los aparatos en cualquier parte para las videollamadas",
|
||||
"Siiii todo mi gusto.. me encantó lo completo que es. Gracias",
|
||||
"Está super cool se ve de buena calidad",
|
||||
"Llego el mío, y es excelente, estoy feliz con mi compra",
|
||||
"Hola!!Me llegó el pedido, Muchas gracias muy bello. Me salvaste la vida",
|
||||
"Perfecto el producto, funciona impecable, muchas gracias",
|
||||
"Están bacanes! muchísimas gracias. Le regalé a mis viejos y lo aman",
|
||||
"Hola! Quería decirte que me encantaron los soportes, Muy útiles!",
|
||||
"Compré 3 y olvidé decirte que los encontré geniales! Me encantaron",
|
||||
"Diseño simple y funcional, minimalista y excelente precio, despacho súper Rápido.. gracias!"
|
||||
],
|
||||
elem: $('#felices .testimonios'),
|
||||
page: 0,
|
||||
setup: function() {
|
||||
this.draw()
|
||||
},
|
||||
draw: function() {
|
||||
var n = this.page * 3
|
||||
this.elem.find('.testimonio').each((i, el) => {
|
||||
if (n >= this.testimonios.length) {
|
||||
$(el).html('')
|
||||
return
|
||||
}
|
||||
$(el).html(this.testimonios[n])
|
||||
n += 1
|
||||
})
|
||||
this.draw_nav()
|
||||
},
|
||||
draw_nav: function() {
|
||||
let N = Math.ceil(this.testimonios.length / 3)
|
||||
let k = this.page
|
||||
let nav = this.elem.parent().find('.nav')
|
||||
let tests = this
|
||||
nav.html('')
|
||||
for (var i = 0; i < N; i ++) {
|
||||
var circle = $('<i></i>').attr('class', 'small circle outline icon').css('cursor', 'pointer').attr('data-page', i)
|
||||
if (i == k) {
|
||||
circle.removeClass('outline')
|
||||
}
|
||||
circle.click(function(e) {
|
||||
tests.page = parseInt($(this).attr('data-page'))
|
||||
tests.draw()
|
||||
})
|
||||
nav.append(circle)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
register_resizeables()
|
||||
|
||||
if (vw < 1080) {
|
||||
resize()
|
||||
}
|
||||
|
||||
$('.menu.sticky').sticky()
|
||||
$('.column2 .sticky').sticky({
|
||||
context: '#column'
|
||||
})
|
||||
$('#subir').sticky()
|
||||
|
||||
$('.shopping.cart').innerText = 0
|
||||
|
||||
@ -233,4 +318,5 @@ $(document).ready(function() {
|
||||
let cotiza_color = new Colors($('#corporativos .colores'))
|
||||
cotiza_form.setup()
|
||||
conversemos_form.setup()
|
||||
testimonios.setup()
|
||||
})
|
||||
|
Reference in New Issue
Block a user