Commit ec492ba7 authored by Henrique Marques's avatar Henrique Marques
Browse files

Merge branch 'develop'

themes/comite-nacional-lula-livre/assets/images/map-icon.png

3.49 KB

themes/comite-nacional-lula-livre/assets/images/map-icon2.png

1.28 KB

......@@ -16,6 +16,33 @@ jQuery(window).on('scroll', function(){
}
});
if(jQuery('#mapa-cadastro').length > 0 ){
var mymap = L.map('mapa-cadastro').setView([-16, -57], 4);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
id: 'mapbox.streets'
}).addTo(mymap);
var flagIcon = L.icon({
iconUrl: '/wp-content/themes/comite-nacional-lula-livre/assets/images/map-icon.png',
shadowUrl: '',
iconSize: [30, 30], // size of the icon
shadowSize: [0, 0], // size of the shadow
iconAnchor: [15, 15], // point of the icon which will correspond to marker's location
shadowAnchor: [0, 0], // the same for the shadow
popupAnchor: [0, 0] // point from which the popup should open relative to the iconAnchor
});
if(window.mapa_cadastro){
window.mapa_cadastro.map(m => {
let marker = L.marker([m.latitude, m.longitude], {icon: flagIcon}).addTo(mymap);
})
}
}
window.fetchArt = function (id){
jQuery.get('/art/'+id, {}, function(response){
jQuery('.modal-art--content').html(response);
......
......@@ -71,4 +71,8 @@
.justify-content-end{
justify-content: flex-end;
}
.relative{
position: relative;
}
\ No newline at end of file
......@@ -5,13 +5,13 @@
/*------------------------------------------------------------------------ */
// TYPOGRAPHY
@each $font-size in (8,11,13,15,17,20,26,32,42,50) {
@each $font-size in (8,11,13,14,15,16,17,18,19,20,26,32,42,50) {
.fz#{$font-size} {
font-size: #{$font-size}px;
}
}
@each $line-height, $val in ("1-2":1.2,"1-6":1.6,"2":2) {
@each $line-height, $val in ("1-2":1.2,"1-4":1.4,"1-6":1.6,"2":2) {
.lh#{$line-height} {
line-height: #{$val}em;
}
......
.mapa-cadastro{
#mapa-cadastro { height: 480px; z-index: 1; }
.left{
position: absolute;
top: 50%;
transform: translateY(-50%);
z-index: 10;
max-width: 40%;
left: 0;
}
.right{
position: relative;
&:before{
content: '';
position: absolute;
height: 100%;
width: 300px;
top: 0;
left: 0;
z-index: 9;
background: linear-gradient(270deg, rgba(21, 41, 75, 0) 0%, rgba(21, 41, 75, 0.32) 40%, #15294B 98%);
pointer-events: none;
}
}
}
\ No newline at end of file
......@@ -27,7 +27,7 @@ body{
align-items: center;
transition: all .6s;
left: 0;
z-index: 10;
z-index: 100;
@include mobile{
left: -90vw;
......@@ -179,7 +179,7 @@ body{
width: 100vw;
background-color: #FFFFFF;
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.15);
z-index: 9;
z-index: 100;
transition: all .6s;
top: 0;
position: fixed;
......
......@@ -119,6 +119,7 @@ $theme-root: '/wp-content/themes/comite-nacional-lula-livre';
@import "3--components/c-art-card";
@import "3--components/c-abra-comite";
@import "3--components/c-banner-small";
@import "3--components/c-mapa-cadastro";
// LAYOUT PARTS
@import "4--layouts/l-navigation";
......
......@@ -6828,14 +6828,30 @@ body {
font-size: 13px;
}
.fz14 {
font-size: 14px;
}
.fz15 {
font-size: 15px;
}
.fz16 {
font-size: 16px;
}
.fz17 {
font-size: 17px;
}
.fz18 {
font-size: 18px;
}
.fz19 {
font-size: 19px;
}
.fz20 {
font-size: 20px;
}
......@@ -6860,6 +6876,10 @@ body {
line-height: 1.2em;
}
.lh1-4 {
line-height: 1.4em;
}
.lh1-6 {
line-height: 1.6em;
}
......@@ -7115,6 +7135,10 @@ ul.nav {
justify-content: flex-end;
}
.relative {
position: relative;
}
/* --------------------------------------------------------------------------
SPACING
-------------------------------------------------------------------------- */
......@@ -7529,14 +7553,30 @@ ul.nav {
font-size: 13px;
}
.fz14 {
font-size: 14px;
}
.fz15 {
font-size: 15px;
}
.fz16 {
font-size: 16px;
}
.fz17 {
font-size: 17px;
}
.fz18 {
font-size: 18px;
}
.fz19 {
font-size: 19px;
}
.fz20 {
font-size: 20px;
}
......@@ -7561,6 +7601,10 @@ ul.nav {
line-height: 1.2em;
}
.lh1-4 {
line-height: 1.4em;
}
.lh1-6 {
line-height: 1.6em;
}
......@@ -9284,6 +9328,36 @@ body .em-calendar td ul li a {
color: white;
}
.mapa-cadastro #mapa-cadastro {
height: 480px;
z-index: 1;
}
.mapa-cadastro .left {
position: absolute;
top: 50%;
transform: translateY(-50%);
z-index: 10;
max-width: 40%;
left: 0;
}
.mapa-cadastro .right {
position: relative;
}
.mapa-cadastro .right:before {
content: '';
position: absolute;
height: 100%;
width: 300px;
top: 0;
left: 0;
z-index: 9;
background: linear-gradient(270deg, rgba(21, 41, 75, 0) 0%, rgba(21, 41, 75, 0.32) 40%, #15294B 98%);
pointer-events: none;
}
/* --------------------------------------------------------------------------
NAVIGATION
-------------------------------------------------------------------------- */
......@@ -9315,7 +9389,7 @@ body {
align-items: center;
transition: all .6s;
left: 0;
z-index: 10;
z-index: 100;
}
@media (max-width: 767px) {
......@@ -9478,7 +9552,7 @@ body {
width: 100vw;
background-color: #FFFFFF;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.15);
z-index: 9;
z-index: 100;
transition: all .6s;
top: 0;
position: fixed;
......
......@@ -11430,6 +11430,31 @@ jQuery(window).on('scroll', function () {
}
});
 
if (jQuery('#mapa-cadastro').length > 0) {
var mymap = L.map('mapa-cadastro').setView([-16, -57], 4);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' + '<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + 'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
id: 'mapbox.streets'
}).addTo(mymap);
var flagIcon = L.icon({
iconUrl: '/wp-content/themes/comite-nacional-lula-livre/assets/images/map-icon.png',
shadowUrl: '',
iconSize: [30, 30], // size of the icon
shadowSize: [0, 0], // size of the shadow
iconAnchor: [15, 15], // point of the icon which will correspond to marker's location
shadowAnchor: [0, 0], // the same for the shadow
popupAnchor: [0, 0] // point from which the popup should open relative to the iconAnchor
});
if (window.mapa_cadastro) {
window.mapa_cadastro.map(function (m) {
var marker = L.marker([m.latitude, m.longitude], { icon: flagIcon }).addTo(mymap);
});
}
}
window.fetchArt = function (id) {
jQuery.get('/art/' + id, {}, function (response) {
jQuery('.modal-art--content').html(response);
......@@ -18,7 +18,8 @@ add_action( 'after_setup_theme', function() {
} );
function lula_load_assets() {
wp_enqueue_style( 'flickity-css', get_template_directory_uri() . '/dist/flickity.min.css' );
wp_enqueue_script('no-js', get_stylesheet_directory_uri() . '/no-js.js', array('jquery'), false, true);
wp_enqueue_style( 'flickity-css', get_template_directory_uri() . '/ dist/flickity.min.css' );
wp_enqueue_style( 'app', get_template_directory_uri() . '/dist/app.css', [], filemtime(__DIR__.'/dist/app.css') );
// wp_enqueue_script( 'manifest', get_template_directory_uri() . '/dist/manifest.js', array('jquery'), '1.0.0', true);
// wp_enqueue_script( 'vendor', get_template_directory_uri() . '/dist/vendor.js', array('manifest'), '1.0.0', true);
......
......@@ -8,10 +8,17 @@
<?php wp_head()?>
<title><?php wp_title()?></title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.4.0/dist/leaflet.css"
integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA=="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.4.0/dist/leaflet.js"
integrity="sha512-QVftwZFqvtRNi0ZyCtsznlKSWOStnDORoefr1enyq5mVL4tmKB3S/EnC3rRJcxCPavG10IcrVGSmPh6Qw5lwrg=="
crossorigin=""></script>
<script src="https://www.google.com/recaptcha/api.js?hl=pt-BR" async defer></script>
</head>
<body <?php body_class();?> >
<script src="https://www.google.com/recaptcha/api.js?hl=pt-BR" async defer></script>
<?php if(is_page() && $slider = get_post_meta(get_the_ID(), '_page_slider_shortcode', true)): ?>
<header class="slider-revolution">
......
<?php
/*
Widget Name: Mapa de Cadastros
Description: Adiciona um mapa que exibe os pins dos cadastros
Author: hacklab/
Author URI: https://hacklab.com.br/
*/
namespace widgets;
class MapaCadastro extends \SiteOrigin_Widget {
function __construct() {
$fields = [
'title' => [
'type' => 'text',
'label' => 'Título',
'default' => 'Mapa de Comitês Lula Livre'
],
'description' => [
'type' => 'text',
'label' => 'Descrição'
],
'button_text' => [
'type' => 'text',
'label' => 'Título do Botão',
'default' => 'Cadastre seu comitê'
],
'button_link' => [
'type' => 'text',
'label' => 'Link do Botão',
'default' => '#mapa-cadastro'
],
];
parent::__construct('mapa-cadastro', 'Mapa de Cadastros', [
'panels_groups' => [WIDGETGROUP_MAIN],
'description' => 'Adiciona um mapa com pins de cadastro'
], [], $fields, plugin_dir_path(__FILE__)
);
}
function get_template_variables($instance, $args)
{
$markers = [];
$markers_query = new \WP_Query([
'post_type' => 'cadastros',
'posts_per_page' => '-1',
]);
while($markers_query->have_posts()){
$markers_query->the_post();
$markers[] = [
'latitude' => get_post_meta(get_the_ID(), 'LATITUDE', true),
'longitude' => get_post_meta(get_the_ID(), 'LONGITUDE', true),
];
}
wp_localize_script('no-js', 'mapa_cadastro', $markers );
return [];
}
function get_template_name($instance) {
return 'template';
}
function get_style_name($instance) {
return 'style';
}
}
Siteorigin_widget_register('mapa-cadastro', __FILE__, 'widgets\MapaCadastro');
<div class="mapa-cadastro wrapper dark">
<div class="row justify-content-end relative">
<div class="left">
<h2 class="text-white section-title"><?= $instance['title']?></h2>
<p class="text-white fz14 lh1-4"><?= $instance['description']?></p>
<a href="<?= $instance['button_link']?>" class="button outline"><?= $instance['button_text']?></a>
</div>
<div class="column large-8 right">
<div id="mapa-cadastro"></div>
</div>
</div>
</div>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment