first commit
This commit is contained in:
@@ -0,0 +1,228 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
|
||||
/* Load Map
|
||||
========================= */
|
||||
(function () {
|
||||
|
||||
// Set Maps location and theme
|
||||
var address = "New York";
|
||||
loadMap(address,"ultra-white"); // themes: 1.normal 2.ultra-white
|
||||
|
||||
})();
|
||||
|
||||
|
||||
/* Browser capability
|
||||
========================= */
|
||||
|
||||
if ( (bowser.firefox && bowser.version < 52) || (bowser.msie && bowser.version <= 11)) {
|
||||
$("<link/>", {
|
||||
rel: "stylesheet",
|
||||
type: "text/css",
|
||||
href: "css/browser-fix.css"
|
||||
}).appendTo("head");
|
||||
}
|
||||
|
||||
if( !bowser.msie && !bowser.msedge ) {
|
||||
imagesLoaded(document.querySelector('main'), function() {
|
||||
$('div.tilter').each(function(i, el) {
|
||||
new TiltFx(el, [{}]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* Scoll Navigation
|
||||
========================= */
|
||||
|
||||
var NvScr = {
|
||||
|
||||
offset : -10,
|
||||
|
||||
init : function() {
|
||||
|
||||
NvScr.topMenu = $(".menu");
|
||||
NvScr.topMenuHeight = NvScr.topMenu.outerHeight() + NvScr.offset;
|
||||
NvScr.menuItems = NvScr.topMenu.find('a[href*="#"]'),
|
||||
|
||||
NvScr.scrollItems = NvScr.menuItems.map(function(){
|
||||
var href = $(this).attr("href"),
|
||||
id = href.substring(href.indexOf('#')),
|
||||
item = $(id);
|
||||
if (item.length) { return item; }
|
||||
});
|
||||
|
||||
// so we can get a fancy scroll animation
|
||||
NvScr.menuItems.on('click', NvScr.onClick);
|
||||
|
||||
NvScr.shrinkMenu();
|
||||
|
||||
$(window).on("scroll", NvScr.onScroll)
|
||||
|
||||
},
|
||||
|
||||
onClick : function(e) {
|
||||
|
||||
// close menu on click for mobile phones
|
||||
var screen_width = $(window).innerWidth()
|
||||
if(screen_width < 769)
|
||||
$('.navbar-toggle').trigger('click');
|
||||
|
||||
var href = $(this).attr("href"),
|
||||
id = href.substring(href.indexOf('#'));
|
||||
offsetTop = href === "#" ? 0 : $(id).offset().top - NvScr.topMenuHeight+1;
|
||||
$('html, body').stop().animate({
|
||||
scrollTop: offsetTop
|
||||
}, 1000);
|
||||
return false;
|
||||
},
|
||||
|
||||
onScroll: function() {
|
||||
// Get container scroll position
|
||||
var fromTop = $(this).scrollTop() + NvScr.topMenuHeight;
|
||||
|
||||
// Get id of current scroll item
|
||||
var cur = NvScr.scrollItems.map(function(){
|
||||
if ($(this).offset().top < fromTop)
|
||||
return this;
|
||||
});
|
||||
|
||||
// Get the id of the current element
|
||||
cur = cur[cur.length-1];
|
||||
var id = cur && cur.length ? cur[0].id : "";
|
||||
|
||||
NvScr.menuItems.parent().removeClass("menu-item--current");
|
||||
if(id){
|
||||
NvScr.menuItems.parent().end().filter("[href*='#"+id+"']").parent().addClass("menu-item--current");
|
||||
}
|
||||
|
||||
NvScr.shrinkMenu();
|
||||
},
|
||||
|
||||
shrinkMenu: function() {
|
||||
var scrollTop = $(window).scrollTop();
|
||||
if ( scrollTop > 150 ) {
|
||||
$("#menu-container").addClass("menu-scrolled");
|
||||
} else {
|
||||
$("#menu-container").removeClass("menu-scrolled");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
NvScr.init();
|
||||
|
||||
|
||||
/* Owl Slider
|
||||
========================= */
|
||||
$('#owl-carousel').owlCarousel({
|
||||
items: 1,
|
||||
singleItem: true,
|
||||
loop: true,
|
||||
autoplay:true
|
||||
});
|
||||
|
||||
|
||||
/* Owl Slider Client Testimonials
|
||||
=================================== */
|
||||
$('#owl-carousel-testimonials').owlCarousel({
|
||||
items: 1,
|
||||
singleItem: true,
|
||||
loop: true,
|
||||
autoplay:true
|
||||
});
|
||||
|
||||
|
||||
/* Owl Slider Our Latest Projects
|
||||
=================================== */
|
||||
$('#owl-carousel-projects').owlCarousel({
|
||||
items: 4,
|
||||
margin: 20,
|
||||
loop: false,
|
||||
navigation: false,
|
||||
dots: false,
|
||||
autoplay:false,
|
||||
|
||||
responsive:{
|
||||
0:{
|
||||
items:1,
|
||||
},
|
||||
601:{
|
||||
items:2
|
||||
},
|
||||
992:{
|
||||
items:3
|
||||
},
|
||||
1200:{
|
||||
items:4
|
||||
}
|
||||
},
|
||||
responsiveRefreshRate : 50,
|
||||
});
|
||||
|
||||
/* Owl Slider Our Team
|
||||
=================================== */
|
||||
$('#owl-carousel-team').owlCarousel({
|
||||
items: 4,
|
||||
margin: 10,
|
||||
loop: false,
|
||||
navigation: false,
|
||||
dots: false,
|
||||
autoplay:false,
|
||||
|
||||
responsive:{
|
||||
0:{
|
||||
items:1,
|
||||
},
|
||||
601:{
|
||||
items:2,
|
||||
},
|
||||
992:{
|
||||
items:3,
|
||||
},
|
||||
1200:{
|
||||
items:4
|
||||
}
|
||||
},
|
||||
responsiveRefreshRate : 50,
|
||||
});
|
||||
|
||||
// Preloader
|
||||
imagesLoaded(document.querySelector('body'), function() {
|
||||
$("#preloader").css('display','none');
|
||||
})
|
||||
|
||||
/* Contact Form
|
||||
========================= */
|
||||
$(function () {
|
||||
|
||||
var contact_form = $("#contact-form");
|
||||
var contact_response = $(".mail-response");
|
||||
|
||||
contact_form.on('submit', function(e) {
|
||||
|
||||
contact_response.html(" ");
|
||||
$.ajax({
|
||||
url: 'contact.php',
|
||||
type: 'POST',
|
||||
data: contact_form.serialize(),
|
||||
success : function(res) {
|
||||
console.log(res);
|
||||
console.log(res.status);
|
||||
if(res.status === 401 || res.status === 400 )
|
||||
contact_response.addClass("error-msg");
|
||||
else if(res.status === "200") {
|
||||
console.log("this is called")
|
||||
contact_response.addClass("success-msg");
|
||||
}
|
||||
|
||||
contact_response.html(res.message);
|
||||
}
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,213 @@
|
||||
'use strict';
|
||||
|
||||
function loadMap(address,theme) {
|
||||
var geocoder;
|
||||
var map;
|
||||
var themes = [];
|
||||
|
||||
themes["normal"] = [];
|
||||
|
||||
themes["ultra-white"] = [
|
||||
{
|
||||
"featureType": "water",
|
||||
"elementType": "geometry",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#e9e9e9"
|
||||
},
|
||||
{
|
||||
"lightness": 17
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "landscape",
|
||||
"elementType": "geometry",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#f5f5f5"
|
||||
},
|
||||
{
|
||||
"lightness": 20
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "road.highway",
|
||||
"elementType": "geometry.fill",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#ffffff"
|
||||
},
|
||||
{
|
||||
"lightness": 17
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "road.highway",
|
||||
"elementType": "geometry.stroke",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#ffffff"
|
||||
},
|
||||
{
|
||||
"lightness": 29
|
||||
},
|
||||
{
|
||||
"weight": 0.2
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "road.arterial",
|
||||
"elementType": "geometry",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#ffffff"
|
||||
},
|
||||
{
|
||||
"lightness": 18
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "road.local",
|
||||
"elementType": "geometry",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#ffffff"
|
||||
},
|
||||
{
|
||||
"lightness": 16
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "poi",
|
||||
"elementType": "geometry",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#f5f5f5"
|
||||
},
|
||||
{
|
||||
"lightness": 21
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "poi.park",
|
||||
"elementType": "geometry",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#dedede"
|
||||
},
|
||||
{
|
||||
"lightness": 21
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"elementType": "labels.text.stroke",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "on"
|
||||
},
|
||||
{
|
||||
"color": "#ffffff"
|
||||
},
|
||||
{
|
||||
"lightness": 16
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"elementType": "labels.text.fill",
|
||||
"stylers": [
|
||||
{
|
||||
"saturation": 36
|
||||
},
|
||||
{
|
||||
"color": "#333333"
|
||||
},
|
||||
{
|
||||
"lightness": 40
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"elementType": "labels.icon",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "off"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "transit",
|
||||
"elementType": "geometry",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#f2f2f2"
|
||||
},
|
||||
{
|
||||
"lightness": 19
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "administrative",
|
||||
"elementType": "geometry.fill",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#fefefe"
|
||||
},
|
||||
{
|
||||
"lightness": 20
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "administrative",
|
||||
"elementType": "geometry.stroke",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#fefefe"
|
||||
},
|
||||
{
|
||||
"lightness": 17
|
||||
},
|
||||
{
|
||||
"weight": 1.2
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
geocoder = new google.maps.Geocoder();
|
||||
var latlng = new google.maps.LatLng(-34.397, 150.644);
|
||||
var mapProp = {
|
||||
zoom:13,
|
||||
mapTypeId:google.maps.MapTypeId.ROADMAP,
|
||||
scrollwheel: false,
|
||||
disableDefaultUI: true,
|
||||
};
|
||||
map = new google.maps.Map(document.getElementById('map'), mapProp);
|
||||
var img = {
|
||||
url: './img/location.png',
|
||||
scaledSize : new google.maps.Size(40, 40),
|
||||
};
|
||||
geocoder.geocode( { 'address': address}, function(results, status) {
|
||||
if (status == 'OK') {
|
||||
map.setCenter(results[0].geometry.location);
|
||||
var marker = new google.maps.Marker({
|
||||
map: map,
|
||||
position: results[0].geometry.location,
|
||||
icon: img
|
||||
});
|
||||
}
|
||||
else
|
||||
alert("Please set a valid address");
|
||||
});
|
||||
map.set('styles', themes[theme]);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Vendored
+94
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user