scss
This commit is contained in:
@@ -1,59 +1,86 @@
|
||||
var isTouch = window.DocumentTouch && document instanceof DocumentTouch;
|
||||
function map() {
|
||||
|
||||
var mymap = L.map('map').setView([51.505, -0.09], 13);
|
||||
|
||||
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
|
||||
maxZoom: 18,
|
||||
attribution: 'Map data © <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);
|
||||
|
||||
L.marker([51.5, -0.09]).addTo(mymap)
|
||||
.bindPopup("<b>Hello world!</b><br />I am a popup.").openPopup();
|
||||
|
||||
L.circle([51.508, -0.11], 500, {
|
||||
color: 'red',
|
||||
fillColor: '#f03',
|
||||
fillOpacity: 0.5
|
||||
}).addTo(mymap).bindPopup("I am a circle.");
|
||||
|
||||
L.polygon([
|
||||
[51.509, -0.08],
|
||||
[51.503, -0.06],
|
||||
[51.51, -0.047]
|
||||
]).addTo(mymap).bindPopup("I am a polygon.");
|
||||
|
||||
|
||||
var popup = L.popup();
|
||||
|
||||
function onMapClick(e) {
|
||||
popup
|
||||
.setLatLng(e.latlng)
|
||||
.setContent("You clicked the map at " + e.latlng.toString())
|
||||
.openOn(mymap);
|
||||
}
|
||||
|
||||
mymap.on('click', onMapClick);
|
||||
|
||||
function scrollHeader() {
|
||||
// Has scrolled class on header
|
||||
var zvalue = $(document).scrollTop();
|
||||
if ( zvalue > 75 )
|
||||
$("#header").addClass("scrolled");
|
||||
else
|
||||
$("#header").removeClass("scrolled");
|
||||
}
|
||||
|
||||
function parallaxBackground() {
|
||||
$('.parallax').css('background-positionY', ($(window).scrollTop() * 0.3) + 'px');
|
||||
function filteritem() {
|
||||
var $card = $('#item > .card');
|
||||
var $cat = $('.cat a');
|
||||
var $img = $('#item .img');
|
||||
|
||||
var $grid = $card.masonry({
|
||||
itemSelector: '.card',
|
||||
columnWidth: '.card',
|
||||
percentPosition: true,
|
||||
gutter: 10,
|
||||
transitionDuration: '0.2s'
|
||||
});
|
||||
|
||||
// $card.masonry({
|
||||
// itemSelector: '.grid-item',
|
||||
// columnWidth: '.grid-sizer',
|
||||
// percentPosition: true
|
||||
// })
|
||||
|
||||
$grid.imagesLoaded().progress(function() {
|
||||
$grid.masonry();
|
||||
});
|
||||
|
||||
// $card.multipleFilterMasonry({
|
||||
// itemSelector: '.card',
|
||||
// filtersGroupSelector: '.tags'
|
||||
// });
|
||||
}
|
||||
|
||||
function slide() {
|
||||
$(".gal").slidesjs({
|
||||
width: 940,
|
||||
height: 528,
|
||||
pagination: {
|
||||
active: false
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
jQuery(document).ready(function($){
|
||||
|
||||
scrollHeader();
|
||||
|
||||
// Scroll Events
|
||||
if (!isTouch){
|
||||
$(document).scroll(function() {
|
||||
scrollHeader();
|
||||
parallaxBackground();
|
||||
});
|
||||
};
|
||||
|
||||
// Touch scroll
|
||||
$(document).on({
|
||||
'touchmove': function(e) {
|
||||
scrollHeader(); // Replace this with your code.
|
||||
}
|
||||
});
|
||||
|
||||
//Smooth scroll to start
|
||||
$('#to-start').click(function(){
|
||||
var start_y = $('#start').position().top;
|
||||
var header_offset = 45;
|
||||
window.scroll({ top: start_y - header_offset, left: 0, behavior: 'smooth' });
|
||||
return false;
|
||||
});
|
||||
|
||||
//Smooth scroll to top
|
||||
$('#to-top').click(function(){
|
||||
window.scroll({ top: 0, left: 0, behavior: 'smooth' });
|
||||
return false;
|
||||
});
|
||||
|
||||
// Responsive Menu
|
||||
$('#toggle').click(function () {
|
||||
$(this).toggleClass('active');
|
||||
$('#overlay').toggleClass('open');
|
||||
$('body').toggleClass('mobile-nav-open');
|
||||
});
|
||||
|
||||
// Tree Menu
|
||||
$(".tree").treemenu({delay:300});
|
||||
|
||||
slide();
|
||||
map();
|
||||
// filteritem();
|
||||
});
|
||||
|
Reference in New Issue
Block a user