adding in a startup template
This commit is contained in:
Executable
+147
@@ -0,0 +1,147 @@
|
||||
/*!
|
||||
Mailchimp Ajax Submit
|
||||
jQuery Plugin
|
||||
Author: Siddharth Doshi
|
||||
|
||||
Use:
|
||||
===
|
||||
$('#form_id').ajaxchimp(options);
|
||||
|
||||
- Form should have one <input> element with attribute 'type=email'
|
||||
- Form should have one label element with attribute 'for=email_input_id' (used to display error/success message)
|
||||
- All options are optional.
|
||||
|
||||
Options:
|
||||
=======
|
||||
options = {
|
||||
language: 'en',
|
||||
callback: callbackFunction,
|
||||
url: 'http://blahblah.us1.list-manage.com/subscribe/post?u=5afsdhfuhdsiufdba6f8802&id=4djhfdsh99f'
|
||||
}
|
||||
|
||||
Notes:
|
||||
=====
|
||||
To get the mailchimp JSONP url (undocumented), change 'post?' to 'post-json?' and add '&c=?' to the end.
|
||||
For e.g. 'http://blahblah.us1.list-manage.com/subscribe/post-json?u=5afsdhfuhdsiufdba6f8802&id=4djhfdsh99f&c=?',
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
$.ajaxChimp = {
|
||||
responses: {
|
||||
'We have sent you a confirmation email' : 0,
|
||||
'Please enter a value' : 1,
|
||||
'An email address must contain a single @' : 2,
|
||||
'The domain portion of the email address is invalid (the portion after the @: )' : 3,
|
||||
'The username portion of the email address is invalid (the portion before the @: )' : 4,
|
||||
'This email address looks fake or invalid. Please enter a real email address' : 5
|
||||
},
|
||||
translations: {
|
||||
'en': null
|
||||
},
|
||||
init: function (selector, options) {
|
||||
$(selector).ajaxChimp(options);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.ajaxChimp = function (options) {
|
||||
$(this).each(function(i, elem) {
|
||||
var form = $(elem);
|
||||
var email = form.find('input[type=email]');
|
||||
var label = form.find('label[for=' + email.attr('id') + ']');
|
||||
|
||||
var settings = $.extend({
|
||||
'url': form.attr('action'),
|
||||
'language': 'en'
|
||||
}, options);
|
||||
|
||||
var url = settings.url.replace('/post?', '/post-json?').concat('&c=?');
|
||||
|
||||
form.attr('novalidate', 'true');
|
||||
email.attr('name', 'EMAIL');
|
||||
|
||||
form.submit(function () {
|
||||
var msg;
|
||||
function successCallback(resp) {
|
||||
if (resp.result === 'success') {
|
||||
msg = 'We have sent you a confirmation email';
|
||||
label.removeClass('error').addClass('valid');
|
||||
email.removeClass('error').addClass('valid');
|
||||
} else {
|
||||
email.removeClass('valid').addClass('error');
|
||||
label.removeClass('valid').addClass('error');
|
||||
var index = -1;
|
||||
try {
|
||||
var parts = resp.msg.split(' - ', 2);
|
||||
if (parts[1] === undefined) {
|
||||
msg = resp.msg;
|
||||
} else {
|
||||
var i = parseInt(parts[0], 10);
|
||||
if (i.toString() === parts[0]) {
|
||||
index = parts[0];
|
||||
msg = parts[1];
|
||||
} else {
|
||||
index = -1;
|
||||
msg = resp.msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
index = -1;
|
||||
msg = resp.msg;
|
||||
}
|
||||
}
|
||||
|
||||
// Translate and display message
|
||||
if (
|
||||
settings.language !== 'en'
|
||||
&& $.ajaxChimp.responses[msg] !== undefined
|
||||
&& $.ajaxChimp.translations
|
||||
&& $.ajaxChimp.translations[settings.language]
|
||||
&& $.ajaxChimp.translations[settings.language][$.ajaxChimp.responses[msg]]
|
||||
) {
|
||||
msg = $.ajaxChimp.translations[settings.language][$.ajaxChimp.responses[msg]];
|
||||
}
|
||||
label.html(msg);
|
||||
|
||||
label.show(2000);
|
||||
if (settings.callback) {
|
||||
settings.callback(resp);
|
||||
}
|
||||
}
|
||||
|
||||
var data = {};
|
||||
var dataArray = form.serializeArray();
|
||||
$.each(dataArray, function (index, item) {
|
||||
data[item.name] = item.value;
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: data,
|
||||
success: successCallback,
|
||||
dataType: 'jsonp',
|
||||
error: function (resp, text) {
|
||||
console.log('mailchimp ajax submit error: ' + text);
|
||||
}
|
||||
});
|
||||
|
||||
// Translate and display submit message
|
||||
var submitMsg = 'Submitting...';
|
||||
if(
|
||||
settings.language !== 'en'
|
||||
&& $.ajaxChimp.translations
|
||||
&& $.ajaxChimp.translations[settings.language]
|
||||
&& $.ajaxChimp.translations[settings.language]['submit']
|
||||
) {
|
||||
submitMsg = $.ajaxChimp.translations[settings.language]['submit'];
|
||||
}
|
||||
label.html(submitMsg).show(2000);
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
return this;
|
||||
};
|
||||
})(jQuery);
|
||||
Executable
+72
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
--------------------------------
|
||||
Ajax Contact Form
|
||||
--------------------------------
|
||||
+ https://github.com/mehedidb/Ajax_Contact_Form
|
||||
+ A Simple Ajax Contact Form developed in PHP with HTML5 Form validation.
|
||||
+ Has a fallback in jQuery for browsers that do not support HTML5 form validation.
|
||||
+ version 1.0.1
|
||||
+ Copyright 2016 Mehedi Hasan Nahid
|
||||
+ Licensed under the MIT license
|
||||
+ https://github.com/mehedidb/Ajax_Contact_Form
|
||||
*/
|
||||
|
||||
(function ($, window, document, undefined) {
|
||||
'use strict';
|
||||
|
||||
var $form = $('#contact-form');
|
||||
|
||||
$form.submit(function (e) {
|
||||
// remove the error class
|
||||
$('.form-group').removeClass('has-error');
|
||||
$('.help-block').remove();
|
||||
|
||||
// get the form data
|
||||
var formData = {
|
||||
'name' : $('input[name="form-name"]').val(),
|
||||
'email' : $('input[name="form-email"]').val(),
|
||||
'subject' : $('input[name="form-subject"]').val(),
|
||||
'message' : $('textarea[name="form-message"]').val()
|
||||
};
|
||||
|
||||
// process the form
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'process.php',
|
||||
data : formData,
|
||||
dataType : 'json',
|
||||
encode : true
|
||||
}).done(function (data) {
|
||||
// handle errors
|
||||
if (!data.success) {
|
||||
if (data.errors.name) {
|
||||
$('#name-field').addClass('has-error');
|
||||
$('#name-field').find('.col-lg-10').append('<span class="help-block">' + data.errors.name + '</span>');
|
||||
}
|
||||
|
||||
if (data.errors.email) {
|
||||
$('#email-field').addClass('has-error');
|
||||
$('#email-field').find('.col-lg-10').append('<span class="help-block">' + data.errors.email + '</span>');
|
||||
}
|
||||
|
||||
if (data.errors.subject) {
|
||||
$('#subject-field').addClass('has-error');
|
||||
$('#subject-field').find('.col-lg-10').append('<span class="help-block">' + data.errors.subject + '</span>');
|
||||
}
|
||||
|
||||
if (data.errors.message) {
|
||||
$('#message-field').addClass('has-error');
|
||||
$('#message-field').find('.col-lg-10').append('<span class="help-block">' + data.errors.message + '</span>');
|
||||
}
|
||||
} else {
|
||||
// display success message
|
||||
$form.html('<div class="alert alert-success">' + data.message + '</div>');
|
||||
}
|
||||
}).fail(function (data) {
|
||||
// for debug
|
||||
console.log(data)
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
});
|
||||
}(jQuery, window, document));
|
||||
+4
File diff suppressed because one or more lines are too long
Executable
+156
@@ -0,0 +1,156 @@
|
||||
(function ($) {
|
||||
|
||||
"use strict";
|
||||
$(".carousel-inner .item:first-child").addClass("active");
|
||||
/* Mobile menu click then remove
|
||||
==========================*/
|
||||
$(".mainmenu-area #primary_menu li a").on("click", function () {
|
||||
$(".navbar-collapse").removeClass("in");
|
||||
});
|
||||
/* Scroll to top
|
||||
===================*/
|
||||
$.scrollUp({
|
||||
scrollText: '<i class="lnr lnr-arrow-up"></i>',
|
||||
easingType: 'linear',
|
||||
scrollSpeed: 900,
|
||||
animation: 'fade'
|
||||
});
|
||||
/* testimonials Slider Active
|
||||
=============================*/
|
||||
$('.gallery-slide').owlCarousel({
|
||||
loop: true,
|
||||
margin: 0,
|
||||
responsiveClass: true,
|
||||
nav: false,
|
||||
autoplay: true,
|
||||
autoplayTimeout: 4000,
|
||||
smartSpeed: 1000,
|
||||
navText: ['<i class="lnr lnr-chevron-left"></i>', '<i class="lnr lnr-chevron-right"></i>'],
|
||||
responsive: {
|
||||
0: {
|
||||
items: 1,
|
||||
},
|
||||
600: {
|
||||
items: 2
|
||||
},
|
||||
1280: {
|
||||
items: 3
|
||||
},
|
||||
1500: {
|
||||
items: 4
|
||||
}
|
||||
}
|
||||
});
|
||||
/* testimonials Slider Active
|
||||
=============================*/
|
||||
$('.team-slide').owlCarousel({
|
||||
loop: true,
|
||||
margin: 0,
|
||||
responsiveClass: true,
|
||||
nav: true,
|
||||
autoplay: true,
|
||||
autoplayTimeout: 4000,
|
||||
smartSpeed: 1000,
|
||||
navText: ['<i class="lnr lnr-chevron-left"></i>', '<i class="lnr lnr-chevron-right"></i>'],
|
||||
responsive: {
|
||||
0: {
|
||||
items: 1,
|
||||
},
|
||||
600: {
|
||||
items: 2
|
||||
},
|
||||
1000: {
|
||||
items: 3
|
||||
}
|
||||
}
|
||||
});
|
||||
$(".toggole-boxs").accordion();
|
||||
/*---------------------------
|
||||
MICHIMP INTEGRATION
|
||||
-----------------------------*/
|
||||
$('#mc-form').ajaxChimp({
|
||||
url: 'https://quomodosoft.us14.list-manage.com/subscribe/post?u=b2a3f199e321346f8785d48fb&id=d0323b0697', //Set Your Mailchamp URL
|
||||
callback: function (resp) {
|
||||
if (resp.result === 'success') {
|
||||
$('.subscrie-form, .join-button').fadeOut();
|
||||
$('body').css('overflow-y', 'scroll');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/*-- Smoth-Scroll --*/
|
||||
$('.mainmenu-area a[href*="#"]')
|
||||
// Remove links that don't actually link to anything
|
||||
.not('[href="#"]')
|
||||
.not('[href="#0"]')
|
||||
.click(function (event) {
|
||||
// On-page links
|
||||
if (
|
||||
location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') &&
|
||||
location.hostname == this.hostname
|
||||
) {
|
||||
// Figure out element to scroll to
|
||||
var target = $(this.hash);
|
||||
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
|
||||
// Does a scroll target exist?
|
||||
if (target.length) {
|
||||
// Only prevent default if animation is actually gonna happen
|
||||
event.preventDefault();
|
||||
$('html, body').animate({
|
||||
scrollTop: target.offset().top
|
||||
}, 1000, function () {
|
||||
// Callback after animation
|
||||
// Must change focus!
|
||||
var $target = $(target);
|
||||
$target.focus();
|
||||
if ($target.is(":focus")) { // Checking if the target was focused
|
||||
return false;
|
||||
} else {
|
||||
$target.attr('tabindex', '-1'); // Adding tabindex for elements not focusable
|
||||
$target.focus(); // Set focus again
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
/*--------------------
|
||||
MAGNIFIC POPUP JS
|
||||
----------------------*/
|
||||
var magnifPopup = function () {
|
||||
$('.popup').magnificPopup({
|
||||
type: 'iframe',
|
||||
removalDelay: 300,
|
||||
mainClass: 'mfp-with-zoom',
|
||||
gallery: {
|
||||
enabled: true
|
||||
},
|
||||
zoom: {
|
||||
enabled: true, // By default it's false, so don't forget to enable it
|
||||
|
||||
duration: 300, // duration of the effect, in milliseconds
|
||||
easing: 'ease-in-out', // CSS transition easing function
|
||||
|
||||
// The "opener" function should return the element from which popup will be zoomed in
|
||||
// and to which popup will be scaled down
|
||||
// By defailt it looks for an image tag:
|
||||
opener: function (openerElement) {
|
||||
// openerElement is the element on which popup was initialized, in this case its <a> tag
|
||||
// you don't need to add "opener" option if this code matches your needs, it's defailt one.
|
||||
return openerElement.is('img') ? openerElement : openerElement.find('img');
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
// Call the functions
|
||||
magnifPopup();
|
||||
/* Preloader Js
|
||||
===================*/
|
||||
$(window).on("load", function () {
|
||||
$('.preloader').fadeOut(500);
|
||||
/*WoW js Active
|
||||
=================*/
|
||||
new WOW().init({
|
||||
mobile: false,
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
+2
File diff suppressed because one or more lines are too long
+7
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* scrollup v2.4.1
|
||||
* Url: http://markgoodyear.com/labs/scrollup/
|
||||
* Copyright (c) Mark Goodyear — @markgdyr — http://markgoodyear.com
|
||||
* License: MIT
|
||||
*/
|
||||
!function(l,o,e){"use strict";l.fn.scrollUp=function(o){l.data(e.body,"scrollUp")||(l.data(e.body,"scrollUp",!0),l.fn.scrollUp.init(o))},l.fn.scrollUp.init=function(r){var s,t,c,i,n,a,d,p=l.fn.scrollUp.settings=l.extend({},l.fn.scrollUp.defaults,r),f=!1;switch(d=p.scrollTrigger?l(p.scrollTrigger):l("<a/>",{id:p.scrollName,href:"#top"}),p.scrollTitle&&d.attr("title",p.scrollTitle),d.appendTo("body"),p.scrollImg||p.scrollTrigger||d.html(p.scrollText),d.css({display:"none",position:"fixed",zIndex:p.zIndex}),p.activeOverlay&&l("<div/>",{id:p.scrollName+"-active"}).css({position:"absolute",top:p.scrollDistance+"px",width:"100%",borderTop:"1px dotted"+p.activeOverlay,zIndex:p.zIndex}).appendTo("body"),p.animation){case"fade":s="fadeIn",t="fadeOut",c=p.animationSpeed;break;case"slide":s="slideDown",t="slideUp",c=p.animationSpeed;break;default:s="show",t="hide",c=0}i="top"===p.scrollFrom?p.scrollDistance:l(e).height()-l(o).height()-p.scrollDistance,n=l(o).scroll(function(){l(o).scrollTop()>i?f||(d[s](c),f=!0):f&&(d[t](c),f=!1)}),p.scrollTarget?"number"==typeof p.scrollTarget?a=p.scrollTarget:"string"==typeof p.scrollTarget&&(a=Math.floor(l(p.scrollTarget).offset().top)):a=0,d.click(function(o){o.preventDefault(),l("html, body").animate({scrollTop:a},p.scrollSpeed,p.easingType)})},l.fn.scrollUp.defaults={scrollName:"scrollUp",scrollDistance:300,scrollFrom:"top",scrollSpeed:300,easingType:"linear",animation:"fade",animationSpeed:200,scrollTrigger:!1,scrollTarget:!1,scrollText:"Scroll to top",scrollTitle:!1,scrollImg:!1,activeOverlay:!1,zIndex:2147483647},l.fn.scrollUp.destroy=function(r){l.removeData(e.body,"scrollUp"),l("#"+l.fn.scrollUp.settings.scrollName).remove(),l("#"+l.fn.scrollUp.settings.scrollName+"-active").remove(),l.fn.jquery.split(".")[1]>=7?l(o).off("scroll",r):l(o).unbind("scroll",r)},l.scrollUp=l.fn.scrollUp}(jQuery,window,document);
|
||||
+7
File diff suppressed because one or more lines are too long
+5
File diff suppressed because one or more lines are too long
+18706
File diff suppressed because it is too large
Load Diff
+4
File diff suppressed because one or more lines are too long
+2
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user