333
| <![CDATA[<script>
//SELECT NOTICIA
$('#cat_noticias').change(function() {
// set the window's location property to the value of the option the user has selected
window.location = $(this).val();
});
//FIM SELECT NOTICIA
//LISTA GRADE NOTICIAS
if(sessionStorage.exibe == 'grade'){
$("#lista-noticia").css("display", "none");
$("#grade-noticia").css("display", "block");
$("#botao-grade").css("display", "none");
$("#botao-lista").css("display", "block");
}
if(sessionStorage.exibe == 'lista'){
$("#lista-noticia").css("display", "block");
$("#grade-noticia").css("display", "none");
$("#botao-grade").css("display", "block");
$("#botao-lista").css("display", "none");
}
$(document).on("click", "#botao-grade", function (evt) {
sessionStorage.setItem("exibe", "grade");
$("#lista-noticia").css("display", "none");
$("#grade-noticia").css("display", "block");
$("#botao-grade").css("display", "none");
$("#botao-lista").css("display", "block");
})
$(document).on("click", "#botao-lista", function (evt) {
sessionStorage.setItem("exibe", "lista");
$("#lista-noticia").css("display", "block");
$("#grade-noticia").css("display", "none");
$("#botao-grade").css("display", "block");
$("#botao-lista").css("display", "none");
})
// FIM LISTA GRADE NOTICIAS
//NEWSLETTER
$('.rapido-lista').on("click", "#newsletter", function () {
(async () => {
const { value: email } = await Swal.fire({
title: 'Insira seu e-mail',
input: 'email',
showCloseButton: true,
showLoaderOnConfirm: true,
preConfirm:false,
inputLabel: 'Seu email',
inputPlaceholder: 'Insira seu endereço de e-mail',
})
if (email) {
jQuery.ajax({
type: 'GET',
//data: $('form').serialize(),
url: "https://camarablu.sc.gov.br/template/newsletter.php?email="+email+'&token=94082f94c485875ea8e86d1a3989288f',
success: function(data) {
var jsonData = JSON.parse(data);
var email = jsonData.email;
if (jsonData.success == "1"){
Swal.fire(
'Feito!',
'E-mail inserido em nossas listas com sucesso!',
'success'
)
}else{
Swal.fire(
'Ops...!',
'Falha ao inserir e-mail!',
'error'
)
}
}
});
}
})()
});
//FIM NEWSLETTER
//ALTERA VIDEO
$(document).on("click", ".video", function (evt) {
evt.preventDefault();
alterId($(this).data("url"));
});
function alterId(id){
$("#video1").attr("src", "https://www.youtube-nocookie.com/embed/"+id);
$("#"+id).css("background-color", "#CCC");
}
//ALTERA VIDEO FIM
//ENVIA CHAMADO
$("form#chamado").submit(function(e) {
e.preventDefault();
var formData = new FormData(this);
$('#enviar').attr('disabled', 'disabled');
$.ajax({
url: "https://camarablu.sc.gov.br/template/chamado.php",
type: 'POST',
data: formData,
success: function( data ) {
$('.aviso').html(data);
},
cache: false,
contentType: false,
processData: false
});
});
//FIM ENVIA CHAMADO
//SWIPER VEREADORES
var swiper = new Swiper(".mySwiper", {
slidesPerView: 4,
spaceBetween: 30,
loop: true,
loopFillGroupWithBlank: true,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
breakpoints: {
// when window width is >= 320px
320: {
slidesPerView: 1,
spaceBetween: 20
},
// when window width is >= 480px
480: {
slidesPerView: 1,
spaceBetween: 30
},
// when window width is >= 992px
992: {
slidesPerView: 4,
spaceBetween: 40
}
}
});
//FIM SWIPPER VEREADORES
//BANNER
var width = $(window).width();
if(width < 576){
$( "banner-desktop" ).remove();
}else{
$( "#banner-mobile" ).remove();
}
//FIM BANNER
if(sessionStorage.contraste == 'ativado'){
$("#ativar_contraste").attr("id", 'desativar_contraste');
$('#acessibilidade_constraste').attr('disabled', false);
}else{
$('#acessibilidade_constraste').attr('disabled', true);
$("#desativar_contraste").attr("id", 'ativar_contraste');
}
//console.log(sessionStorage.contraste);
$(document).ready(function(){
$(document).on('click', '#ativar_contraste', function(){
$('#acessibilidade_constraste').attr('disabled', false);
$("#ativar_contraste").attr("id", 'desativar_contraste');
sessionStorage.setItem("contraste", 'ativado');
});
$(document).on('click', '#desativar_contraste', function(){
$('#acessibilidade_constraste').attr('disabled', true);
$("#desativar_contraste").attr("id", 'ativar_contraste');
sessionStorage.setItem("contraste", 'inativo');
});
});
</script>]]>
|