the website

This commit is contained in:
Sid Alapati 2024-06-02 14:32:07 -04:00
commit addd3d29de
35 changed files with 44522 additions and 0 deletions

10
README.md Normal file
View File

@ -0,0 +1,10 @@
# Running
```bash
npm i
npm run dev
```
for production enter `gulp`
website files for production are in the generated `dist` folder

29705
css/style.css Normal file

File diff suppressed because it is too large Load Diff

BIN
fonts/FontAwesome.otf Normal file

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
fonts/lg.eot Normal file

Binary file not shown.

47
fonts/lg.svg Normal file
View File

@ -0,0 +1,47 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
<json>
<![CDATA[
{
"fontFamily": "lg",
"majorVersion": 1,
"minorVersion": 0,
"fontURL": "https://github.com/sachinchoolur/lightGallery",
"copyright": "sachin",
"license": "MLT",
"licenseURL": "http://opensource.org/licenses/MIT",
"version": "Version 1.0",
"fontId": "lg",
"psName": "lg",
"subFamily": "Regular",
"fullName": "lg",
"description": "Font generated by IcoMoon."
}
]]>
</json>
</metadata>
<defs>
<font id="lg" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xe01a;" glyph-name="pause_circle_outline" data-tags="pause_circle_outline" d="M554 256.667v340h86v-340h-86zM512 84.667q140 0 241 101t101 241-101 241-241 101-241-101-101-241 101-241 241-101zM512 852.667q176 0 301-125t125-301-125-301-301-125-301 125-125 301 125 301 301 125zM384 256.667v340h86v-340h-86z" />
<glyph unicode="&#xe01d;" glyph-name="play_circle_outline" data-tags="play_circle_outline" d="M512 84.667q140 0 241 101t101 241-101 241-241 101-241-101-101-241 101-241 241-101zM512 852.667q176 0 301-125t125-301-125-301-301-125-301 125-125 301 125 301 301 125zM426 234.667v384l256-192z" />
<glyph unicode="&#xe033;" glyph-name="stack-2" data-tags="stack-2" d="M384 853.334h426.667q53 0 90.5-37.5t37.5-90.5v-426.667q0-53-37.5-90.5t-90.5-37.5h-426.667q-53 0-90.5 37.5t-37.5 90.5v426.667q0 53 37.5 90.5t90.5 37.5zM170.667 675.334v-547.333q0-17.667 12.5-30.167t30.167-12.5h547.333q-13.333-37.667-46.333-61.5t-74.333-23.833h-426.667q-53 0-90.5 37.5t-37.5 90.5v426.667q0 41.333 23.833 74.333t61.5 46.333zM810.667 768h-426.667q-17.667 0-30.167-12.5t-12.5-30.167v-426.667q0-17.667 12.5-30.167t30.167-12.5h426.667q17.667 0 30.167 12.5t12.5 30.167v426.667q0 17.667-12.5 30.167t-30.167 12.5z" />
<glyph unicode="&#xe070;" glyph-name="clear" data-tags="clear" d="M810 664.667l-238-238 238-238-60-60-238 238-238-238-60 60 238 238-238 238 60 60 238-238 238 238z" />
<glyph unicode="&#xe094;" glyph-name="arrow-left" data-tags="arrow-left" d="M426.667 768q17.667 0 30.167-12.5t12.5-30.167q0-18-12.667-30.333l-225.667-225.667h665q17.667 0 30.167-12.5t12.5-30.167-12.5-30.167-30.167-12.5h-665l225.667-225.667q12.667-12.333 12.667-30.333 0-17.667-12.5-30.167t-30.167-12.5q-18 0-30.333 12.333l-298.667 298.667q-12.333 13-12.333 30.333t12.333 30.333l298.667 298.667q12.667 12.333 30.333 12.333z" />
<glyph unicode="&#xe095;" glyph-name="arrow-right" data-tags="arrow-right" d="M597.333 768q18 0 30.333-12.333l298.667-298.667q12.333-12.333 12.333-30.333t-12.333-30.333l-298.667-298.667q-12.333-12.333-30.333-12.333-18.333 0-30.5 12.167t-12.167 30.5q0 18 12.333 30.333l226 225.667h-665q-17.667 0-30.167 12.5t-12.5 30.167 12.5 30.167 30.167 12.5h665l-226 225.667q-12.333 12.333-12.333 30.333 0 18.333 12.167 30.5t30.5 12.167z" />
<glyph unicode="&#xe0f2;" glyph-name="vertical_align_bottom" data-tags="vertical_align_bottom" d="M170 128.667h684v-86h-684v86zM682 384.667l-170-172-170 172h128v426h84v-426h128z" />
<glyph unicode="&#xe1ff;" glyph-name="apps" data-tags="apps" d="M682 84.667v172h172v-172h-172zM682 340.667v172h172v-172h-172zM426 596.667v172h172v-172h-172zM682 768.667h172v-172h-172v172zM426 340.667v172h172v-172h-172zM170 340.667v172h172v-172h-172zM170 84.667v172h172v-172h-172zM426 84.667v172h172v-172h-172zM170 596.667v172h172v-172h-172z" />
<glyph unicode="&#xe20c;" glyph-name="fullscreen" data-tags="fullscreen" d="M598 724.667h212v-212h-84v128h-128v84zM726 212.667v128h84v-212h-212v84h128zM214 512.667v212h212v-84h-128v-128h-84zM298 340.667v-128h128v-84h-212v212h84z" />
<glyph unicode="&#xe20d;" glyph-name="fullscreen_exit" data-tags="fullscreen_exit" d="M682 596.667h128v-84h-212v212h84v-128zM598 128.667v212h212v-84h-128v-128h-84zM342 596.667v128h84v-212h-212v84h128zM214 256.667v84h212v-212h-84v128h-128z" />
<glyph unicode="&#xe311;" glyph-name="zoom_in" data-tags="zoom_in" d="M512 512.667h-86v-86h-42v86h-86v42h86v86h42v-86h86v-42zM406 340.667q80 0 136 56t56 136-56 136-136 56-136-56-56-136 56-136 136-56zM662 340.667l212-212-64-64-212 212v34l-12 12q-76-66-180-66-116 0-197 80t-81 196 81 197 197 81 196-81 80-197q0-104-66-180l12-12h34z" />
<glyph unicode="&#xe312;" glyph-name="zoom_out" data-tags="zoom_out" d="M298 554.667h214v-42h-214v42zM406 340.667q80 0 136 56t56 136-56 136-136 56-136-56-56-136 56-136 136-56zM662 340.667l212-212-64-64-212 212v34l-12 12q-76-66-180-66-116 0-197 80t-81 196 81 197 197 81 196-81 80-197q0-104-66-180l12-12h34z" />
<glyph unicode="&#xe80d;" glyph-name="share" data-tags="share" d="M768 252.667c68 0 124-56 124-124s-56-126-124-126-124 58-124 126c0 10 0 20 2 28l-302 176c-24-22-54-34-88-34-70 0-128 58-128 128s58 128 128 128c34 0 64-12 88-34l300 174c-2 10-4 20-4 30 0 70 58 128 128 128s128-58 128-128-58-128-128-128c-34 0-64 14-88 36l-300-176c2-10 4-20 4-30s-2-20-4-30l304-176c22 20 52 32 84 32z" />
<glyph unicode="&#xe901;" glyph-name="facebook-with-circle" data-tags="facebook-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM628.429 612.659h-73.882c-8.755 0-18.483-11.52-18.483-26.829v-53.35h92.416l-13.978-76.083h-78.438v-228.403h-87.194v228.403h-79.104v76.083h79.104v44.749c0 64.205 44.544 116.378 105.677 116.378h73.882v-80.947z" />
<glyph unicode="&#xe902;" glyph-name="google-with-circle" data-tags="google+-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM483.686 249.805c-30.874-15.002-64.102-16.589-76.954-16.589-2.458 0-3.84 0-3.84 0s-1.178 0-2.765 0c-20.070 0-119.962 4.608-119.962 95.59 0 89.395 108.8 96.41 142.131 96.41h0.87c-19.251 25.702-15.258 51.61-15.258 51.61-1.69-0.102-4.147-0.205-7.168-0.205-12.544 0-36.762 1.997-57.549 15.411-25.498 16.384-38.4 44.288-38.4 82.893 0 109.107 119.142 113.51 120.32 113.613h118.989v-2.611c0-13.312-23.91-15.923-40.192-18.125-5.53-0.819-16.64-1.894-19.763-3.482 30.157-16.128 35.021-41.421 35.021-79.104 0-42.906-16.794-65.587-34.611-81.51-11.059-9.882-19.712-17.613-19.712-28.006 0-10.189 11.878-20.582 25.702-32.717 22.579-19.917 53.555-47.002 53.555-92.723 0-47.258-20.326-81.050-60.416-100.454zM742.4 460.8h-76.8v-76.8h-51.2v76.8h-76.8v51.2h76.8v76.8h51.2v-76.8h76.8v-51.2zM421.018 401.92c-2.662 0-5.325-0.102-8.038-0.307-22.733-1.69-43.725-10.189-58.88-24.013-15.053-13.619-22.733-30.822-21.658-48.179 2.304-36.403 41.37-57.702 88.832-54.323 46.694 3.379 77.824 30.31 75.571 66.714-2.15 34.202-31.898 60.109-75.827 60.109zM465.766 599.808c-12.39 43.52-32.358 56.422-63.386 56.422-3.328 0-6.707-0.512-9.933-1.382-13.466-3.84-24.166-15.053-30.106-31.744-6.093-16.896-6.451-34.509-1.229-54.579 9.472-35.891 34.97-61.901 60.672-61.901 3.379 0 6.758 0.41 9.933 1.382 28.109 7.885 45.722 50.79 34.048 91.802z" />
<glyph unicode="&#xe903;" glyph-name="pinterest-with-circle" data-tags="pinterest-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM545.638 344.32c-31.539 2.406-44.749 18.022-69.427 32.973-13.568-71.219-30.157-139.52-79.309-175.206-15.206 107.725 22.221 188.518 39.629 274.381-29.645 49.92 3.533 150.323 66.099 125.645 76.954-30.515-66.662-185.6 29.747-205.005 100.659-20.173 141.773 174.694 79.36 237.978-90.214 91.494-262.502 2.099-241.306-128.87 5.12-32 38.246-41.728 13.21-85.914-57.702 12.8-74.957 58.317-72.704 118.989 3.533 99.328 89.242 168.909 175.155 178.483 108.698 12.083 210.688-39.885 224.819-142.182 15.821-115.405-49.101-240.282-165.274-231.27z" />
<glyph unicode="&#xe904;" glyph-name="twitter-with-circle" data-tags="twitter-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM711.936 549.683c0.205-4.198 0.256-8.397 0.256-12.493 0-128-97.331-275.507-275.405-275.507-54.682 0-105.574 15.974-148.378 43.52 7.526-0.922 15.258-1.28 23.091-1.28 45.363 0 87.091 15.411 120.218 41.421-42.342 0.819-78.080 28.774-90.419 67.174 5.888-1.075 11.93-1.69 18.176-1.69 8.806 0 17.408 1.178 25.498 3.379-44.288 8.909-77.67 48.026-77.67 94.925v1.178c13.056-7.219 28.006-11.622 43.878-12.134-26.010 17.408-43.059 47.002-43.059 80.64 0 17.715 4.762 34.406 13.107 48.691 47.77-58.573 119.040-97.075 199.526-101.222-1.69 7.117-2.509 14.49-2.509 22.118 0 53.402 43.315 96.819 96.819 96.819 27.802 0 52.992-11.776 70.656-30.618 22.067 4.403 42.752 12.39 61.44 23.501-7.219-22.579-22.528-41.574-42.547-53.606 19.61 2.406 38.246 7.578 55.603 15.309-12.954-19.405-29.389-36.506-48.282-50.125z" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
fonts/lg.ttf Normal file

Binary file not shown.

BIN
fonts/lg.woff Normal file

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

101
gulpfile.js Normal file
View File

@ -0,0 +1,101 @@
// based on https://gist.github.com/torgeir/8507130
// Load plugins
let gulp = require("gulp"),
autoprefixer = require("gulp-autoprefixer"),
csso = require("gulp-csso"),
uglify = require("gulp-uglify"),
htmlmin = require("gulp-html-minimizer"),
clean = require("gulp-clean"),
purgecss = require("gulp-purgecss"),
connect = require("gulp-connect");
// Styles
gulp.task("styles", function () {
return gulp
.src("./css/*.css")
.pipe(
purgecss({
content: ["index.html", "js/*.js"],
})
)
.pipe(autoprefixer())
.pipe(csso())
.pipe(gulp.dest("./dist/css"))
.pipe(connect.reload());
});
// Scripts
gulp.task("scripts", function () {
return gulp
.src("./js/*.js")
.pipe(uglify())
.pipe(gulp.dest("./dist/js"))
.pipe(connect.reload());
});
// Images
gulp.task("images", function () {
return gulp
.src(["./images/**"], { removeBOM: false })
.pipe(gulp.dest("./dist/images"))
.pipe(connect.reload());
});
gulp.task("html", function () {
return gulp
.src("./index.html")
.pipe(
htmlmin({
collapseWhitespace: true,
removeComments: true,
minifyCSS: true,
minifyJS: true,
removeAttributeQuotes: true,
removeRedundantAttributes: true,
removeOptionalTags: true,
removeStyleLinkTypeAttributes: true,
removeScriptTypeAttributes: true,
})
)
.pipe(gulp.dest("./dist"))
.pipe(connect.reload());
});
// Clean
gulp.task("clean", function () {
return gulp
.src(["dist/css", "dist/js", "dist/images", "dist/index.html"], {
read: false,
allowEmpty: true,
})
.pipe(clean());
});
// Default task
gulp.task(
"default",
gulp.series("clean", async function minifyAll() {
return gulp.parallel("styles", "scripts", "images", "html")();
})
);
// Connect server
gulp.task("connect", function () {
// Listen on port 8080
connect.server({
root: "dist",
port: 8080,
livereload: true,
});
});
// Watch
gulp.task("watch", function () {
gulp.watch("./css/*.css", gulp.series("styles"));
gulp.watch("./js/*.js", gulp.series("scripts"));
gulp.watch("./images/**/*", gulp.series("images"));
gulp.watch("./index.html", gulp.series("html"));
});
gulp.task("dev", gulp.series("default", gulp.parallel("connect", "watch")));

BIN
images/_blank.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

BIN
images/ajax-loader.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
images/bg-wave-dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
images/bg-wave-light.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

1
images/codeabodelogo.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
images/loading.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
images/preloader.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
images/teaching-coding.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 KiB

BIN
images/video-play.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
images/vimeo-play.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
images/youtube-play.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

1908
index.html Normal file

File diff suppressed because one or more lines are too long

207
js/core.min.js vendored Normal file

File diff suppressed because one or more lines are too long

830
js/script.js Normal file
View File

@ -0,0 +1,830 @@
"use strict";
(function () {
// Global variables
var userAgent = navigator.userAgent.toLowerCase(),
initialDate = new Date(),
$document = $(document),
$window = $(window),
$html = $("html"),
$body = $("body"),
isDesktop = $html.hasClass("desktop"),
isIE =
userAgent.indexOf("msie") !== -1
? parseInt(userAgent.split("msie")[1], 10)
: userAgent.indexOf("trident") !== -1
? 11
: userAgent.indexOf("edge") !== -1
? 12
: false,
isMobile =
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
navigator.userAgent
),
windowReady = false,
isNoviBuilder = false,
livedemo = true,
plugins = {
captcha: $(".recaptcha "),
copyrightYear: $(".copyright-year "),
owl: $(".owl-carousel "),
preloader: $(".preloader "),
rdNavbar: $(".rd-navbar "),
rdMailForm: $(".rd-mailform "),
rdInputLabel: $(".form-label "),
regula: $("[data-constraints] "),
wow: $(".wow "),
counter: document.querySelectorAll(".counter "),
buttonNuka: $(".button-nuka "),
};
// Initialize scripts that require a loaded window
$window.on("load", function () {
// Page loader & Page transition
if (plugins.preloader.length && !isNoviBuilder) {
pageTransition({
target: document.querySelector(".page"),
delay: 0,
duration: 500,
classIn: "fadeIn",
classOut: "fadeOut",
classActive: "animated",
conditions: function (event, link) {
return (
link &&
!/(\#|javascript:void\(0\)|callto:|tel:|mailto:|:\/\/)/.test(
link
) &&
!event.currentTarget.hasAttribute("data-lightgallery")
);
},
onTransitionStart: function (options) {
setTimeout(function () {
plugins.preloader.removeClass("loaded");
}, options.duration * 0.75);
},
onReady: function () {
plugins.preloader.addClass("loaded");
windowReady = true;
},
});
}
// Counter
if (plugins.counter) {
for (let i = 0; i < plugins.counter.length; i++) {
let node = plugins.counter[i],
counter = aCounter({
node: node,
duration: node.getAttribute("data-duration") || 1000,
formatter: node.hasAttribute("data-formatter")
? function (value) {
return Number(value.toFixed()).toLocaleString(
node.getAttribute("data-formatter")
);
}
: null,
}),
scrollHandler = function () {
if (
Util.inViewport(this) &&
!this.classList.contains("animated-first")
) {
this.counter.run();
this.classList.add("animated-first");
}
}.bind(node),
blurHandler = function () {
this.counter.params.to = parseInt(this.textContent, 10);
this.counter.run();
}.bind(node);
if (isNoviBuilder) {
node.counter.run();
node.addEventListener("blur", blurHandler);
} else {
scrollHandler();
window.addEventListener("scroll", scrollHandler);
}
}
}
});
// Initialize scripts that require a finished document
$(function () {
isNoviBuilder = window.xMode;
/**
* @desc Initialize owl carousel plugin
* @param {object} carousel - carousel jQuery object
*/
function initOwlCarousel(carousel) {
var aliaces = ["-", "-sm-", "-md-", "-lg-", "-xl-", "-xxl-"],
values = [0, 576, 768, 992, 1200, 1600],
responsive = {};
for (var j = 0; j < values.length; j++) {
responsive[values[j]] = {};
for (var k = j; k >= -1; k--) {
if (
!responsive[values[j]]["items"] &&
carousel.attr("data" + aliaces[k] + "items")
) {
responsive[values[j]]["items"] =
k < 0
? 1
: parseInt(carousel.attr("data" + aliaces[k] + "items"), 10);
}
if (
!responsive[values[j]]["stagePadding"] &&
responsive[values[j]]["stagePadding"] !== 0 &&
carousel.attr("data" + aliaces[k] + "stage-padding")
) {
responsive[values[j]]["stagePadding"] =
k < 0
? 0
: parseInt(
carousel.attr("data" + aliaces[k] + "stage-padding"),
10
);
}
if (
!responsive[values[j]]["margin"] &&
responsive[values[j]]["margin"] !== 0 &&
carousel.attr("data" + aliaces[k] + "margin")
) {
responsive[values[j]]["margin"] =
k < 0
? 30
: parseInt(carousel.attr("data" + aliaces[k] + "margin"), 10);
}
}
}
// Initialize lightgallery items in cloned owl items
carousel.on("initialized.owl.carousel", function () {
initLightGalleryItem(
carousel.find('[data-lightgallery="item"]'),
"lightGallery-in-carousel"
);
});
carousel.owlCarousel({
autoplay: isNoviBuilder
? false
: carousel.attr("data-autoplay") !== "false",
autoplayTimeout: carousel.attr("data-autoplay-time-out")
? Number(carousel.attr("data-autoplay-time-out"))
: 3000,
smartSpeed: carousel.attr("data-smart-speed")
? Number(carousel.attr("data-smart-speed"))
: 250,
autoplayHoverPause:
carousel.attr("data-autoplay-hover-pause") === "true",
URLhashListener:
carousel.attr("data-hash-navigation") === "true" || false,
startPosition: "URLHash",
slideTransition: carousel.attr("data-slide-transition")
? carousel.attr("data-slide-transition")
: "",
loop: isNoviBuilder ? false : carousel.attr("data-loop") !== "false",
items: 1,
autoHeight: carousel.attr("data-auto-height") === "true",
center: carousel.attr("data-center") === "true",
dotsContainer: carousel.attr("data-pagination-class") || false,
navContainer: carousel.attr("data-navigation-class") || false,
mouseDrag: isNoviBuilder
? false
: carousel.attr("data-mouse-drag") !== "false",
nav: carousel.attr("data-nav") === "true",
dots: carousel.attr("data-dots") === "true",
dotsEach: carousel.attr("data-dots-each")
? parseInt(carousel.attr("data-dots-each"), 10)
: false,
animateIn: carousel.attr("data-animation-in")
? carousel.attr("data-animation-in")
: false,
animateOut: carousel.attr("data-animation-out")
? carousel.attr("data-animation-out")
: false,
responsive: responsive,
navText: carousel.attr("data-nav-text")
? $.parseJSON(carousel.attr("data-nav-text"))
: [],
navClass: carousel.attr("data-nav-class")
? $.parseJSON(carousel.attr("data-nav-class"))
: ["owl-prev", "owl-next"],
});
}
/**
* @desc Attach form validation to elements
* @param {object} elements - jQuery object
*/
function attachFormValidator(elements) {
// Custom validator - phone number
regula.custom({
name: "PhoneNumber",
defaultMessage: "Invalid phone number format",
validator: function () {
if (this.value === "") return true;
else return /^(\+\d)?[0-9\-\(\) ]{5,}$/i.test(this.value);
},
});
for (var i = 0; i < elements.length; i++) {
var o = $(elements[i]),
v;
o.addClass("form-control-has-validation").after(
"<span class='form-validation'></span>"
);
v = o.parent().find(".form-validation");
if (v.is(":last-child")) o.addClass("form-control-last-child");
}
elements
.on("input change propertychange blur", function (e) {
var $this = $(this),
results;
if (e.type !== "blur")
if (!$this.parent().hasClass("has-error")) return;
if ($this.parents(".rd-mailform").hasClass("success")) return;
if ((results = $this.regula("validate")).length) {
for (i = 0; i < results.length; i++) {
$this
.siblings(".form-validation")
.text(results[i].message)
.parent()
.addClass("has-error");
}
} else {
$this
.siblings(".form-validation")
.text("")
.parent()
.removeClass("has-error");
}
})
.regula("bind");
var regularConstraintsMessages = [
{
type: regula.Constraint.Required,
newMessage: "The text field is required.",
},
{
type: regula.Constraint.Email,
newMessage: "The email is not a valid email.",
},
{
type: regula.Constraint.Numeric,
newMessage: "Only numbers are required",
},
{
type: regula.Constraint.Selected,
newMessage: "Please choose an option.",
},
];
for (var i = 0; i < regularConstraintsMessages.length; i++) {
var regularConstraint = regularConstraintsMessages[i];
regula.override({
constraintType: regularConstraint.type,
defaultMessage: regularConstraint.newMessage,
});
}
}
/**
* @desc Check if all elements pass validation
* @param {object} elements - object of items for validation
* @param {object} captcha - captcha object for validation
* @return {boolean}
*/
function isValidated(elements, captcha) {
var results,
errors = 0;
if (elements.length) {
for (var j = 0; j < elements.length; j++) {
var $input = $(elements[j]);
if ((results = $input.regula("validate")).length) {
for (k = 0; k < results.length; k++) {
errors++;
$input
.siblings(".form-validation")
.text(results[k].message)
.parent()
.addClass("has-error");
}
} else {
$input
.siblings(".form-validation")
.text("")
.parent()
.removeClass("has-error");
}
}
if (captcha) {
if (captcha.length) {
return validateReCaptcha(captcha) && errors === 0;
}
}
return errors === 0;
}
return true;
}
/**
* @desc Validate google reCaptcha
* @param {object} captcha - captcha object for validation
* @return {boolean}
*/
function validateReCaptcha(captcha) {
var captchaToken = captcha.find(".g-recaptcha-response").val();
if (captchaToken.length === 0) {
captcha
.siblings(".form-validation")
.html("Please, prove that you are not robot.")
.addClass("active");
captcha.closest(".form-wrap").addClass("has-error");
captcha.on("propertychange", function () {
var $this = $(this),
captchaToken = $this.find(".g-recaptcha-response").val();
if (captchaToken.length > 0) {
$this.closest(".form-wrap").removeClass("has-error");
$this.siblings(".form-validation").removeClass("active").html("");
$this.off("propertychange");
}
});
return false;
}
return true;
}
/**
* @desc Initialize Google reCaptcha
*/
window.onloadCaptchaCallback = function () {
for (var i = 0; i < plugins.captcha.length; i++) {
var $captcha = $(plugins.captcha[i]),
resizeHandler = function () {
var frame = this.querySelector("iframe"),
inner = this.firstElementChild,
inner2 = inner.firstElementChild,
containerRect = null,
frameRect = null,
scale = null;
inner2.style.transform = "";
inner.style.height = "auto";
inner.style.width = "auto";
containerRect = this.getBoundingClientRect();
frameRect = frame.getBoundingClientRect();
scale = containerRect.width / frameRect.width;
if (scale < 1) {
inner2.style.transform = "scale(" + scale + ")";
inner.style.height = frameRect.height * scale + "px";
inner.style.width = frameRect.width * scale + "px";
}
}.bind(plugins.captcha[i]);
grecaptcha.render($captcha.attr("id"), {
sitekey: $captcha.attr("data-sitekey"),
size: $captcha.attr("data-size")
? $captcha.attr("data-size")
: "normal",
theme: $captcha.attr("data-theme")
? $captcha.attr("data-theme")
: "light",
callback: function () {
$(".recaptcha").trigger("propertychange");
},
});
$captcha.after("<span class='form-validation'></span>");
if (plugins.captcha[i].hasAttribute("data-auto-size")) {
resizeHandler();
window.addEventListener("resize", resizeHandler);
}
}
};
/**
* @desc Initialize the gallery with set of images
* @param {object} itemsToInit - jQuery object
* @param {string} [addClass] - additional gallery class
*/
function initLightGallery(itemsToInit, addClass) {
if (!isNoviBuilder) {
$(itemsToInit).lightGallery({
thumbnail: $(itemsToInit).attr("data-lg-thumbnail") !== "false",
selector: "[data-lightgallery='item']",
autoplay: $(itemsToInit).attr("data-lg-autoplay") === "true",
pause:
parseInt($(itemsToInit).attr("data-lg-autoplay-delay")) || 5000,
addClass: addClass,
mode: $(itemsToInit).attr("data-lg-animation") || "lg-slide",
loop: $(itemsToInit).attr("data-lg-loop") !== "false",
});
}
}
/**
* @desc Initialize the gallery with dynamic addition of images
* @param {object} itemsToInit - jQuery object
* @param {string} [addClass] - additional gallery class
*/
function initDynamicLightGallery(itemsToInit, addClass) {
if (!isNoviBuilder) {
$(itemsToInit).on("click", function () {
$(itemsToInit).lightGallery({
thumbnail: $(itemsToInit).attr("data-lg-thumbnail") !== "false",
selector: "[data-lightgallery='item']",
autoplay: $(itemsToInit).attr("data-lg-autoplay") === "true",
pause:
parseInt($(itemsToInit).attr("data-lg-autoplay-delay")) || 5000,
addClass: addClass,
mode: $(itemsToInit).attr("data-lg-animation") || "lg-slide",
loop: $(itemsToInit).attr("data-lg-loop") !== "false",
dynamic: true,
dynamicEl:
JSON.parse($(itemsToInit).attr("data-lg-dynamic-elements")) || [],
});
});
}
}
/**
* @desc Initialize the gallery with one image
* @param {object} itemToInit - jQuery object
* @param {string} [addClass] - additional gallery class
*/
function initLightGalleryItem(itemToInit, addClass) {
if (!isNoviBuilder) {
$(itemToInit).lightGallery({
selector: "this",
addClass: addClass,
counter: false,
youtubePlayerParams: {
modestbranding: 1,
showinfo: 0,
rel: 0,
controls: 0,
},
vimeoPlayerParams: {
byline: 0,
portrait: 0,
},
});
}
}
// Google ReCaptcha
if (plugins.captcha.length) {
$.getScript(
"//www.google.com/recaptcha/api.js?onload=onloadCaptchaCallback&render=explicit&hl=en"
);
}
// Additional class on html if mac os.
if (navigator.platform.match(/(Mac)/i)) {
$html.addClass("mac-os");
}
// Adds some loosing functionality to IE browsers (IE Polyfills)
if (isIE) {
if (isIE === 12) $html.addClass("ie-edge");
if (isIE === 11) $html.addClass("ie-11");
if (isIE < 10) $html.addClass("lt-ie-10");
if (isIE < 11) $html.addClass("ie-10");
}
// Copyright Year (Evaluates correct copyright year)
if (plugins.copyrightYear.length) {
plugins.copyrightYear.text(initialDate.getFullYear());
}
// UI To Top
if (isDesktop && !isNoviBuilder) {
$().UItoTop({
easingType: "easeOutQuad",
containerClass: "ui-to-top fa fa-angle-up",
});
}
// RD Navbar
if (plugins.rdNavbar.length) {
var navbar = plugins.rdNavbar,
aliases = {
"-": 0,
"-sm-": 576,
"-md-": 768,
"-lg-": 992,
"-xl-": 1200,
"-xxl-": 1600,
},
responsive = {};
for (var alias in aliases) {
var link = (responsive[aliases[alias]] = {});
if (navbar.attr("data" + alias + "layout"))
link.layout = navbar.attr("data" + alias + "layout");
if (navbar.attr("data" + alias + "device-layout"))
link.deviceLayout = navbar.attr("data" + alias + "device-layout");
if (navbar.attr("data" + alias + "hover-on"))
link.focusOnHover =
navbar.attr("data" + alias + "hover-on") === "true";
if (navbar.attr("data" + alias + "auto-height"))
link.autoHeight =
navbar.attr("data" + alias + "auto-height") === "true";
if (navbar.attr("data" + alias + "stick-up-offset"))
link.stickUpOffset = navbar.attr("data" + alias + "stick-up-offset");
if (navbar.attr("data" + alias + "stick-up"))
link.stickUp = navbar.attr("data" + alias + "stick-up") === "true";
if (isNoviBuilder) link.stickUp = false;
else if (navbar.attr("data" + alias + "stick-up"))
link.stickUp = navbar.attr("data" + alias + "stick-up") === "true";
}
plugins.rdNavbar.RDNavbar({
anchorNav: !isNoviBuilder,
stickUpClone:
plugins.rdNavbar.attr("data-stick-up-clone") && !isNoviBuilder
? plugins.rdNavbar.attr("data-stick-up-clone") === "true"
: false,
responsive: responsive,
callbacks: {
onStuck: function () {
var navbarSearch = this.$element.find(".rd-search input");
if (navbarSearch) {
navbarSearch.val("").trigger("propertychange");
}
},
onDropdownOver: function () {
return !isNoviBuilder;
},
onUnstuck: function () {
if (this.$clone === null) return;
var navbarSearch = this.$clone.find(".rd-search input");
if (navbarSearch) {
navbarSearch.val("").trigger("propertychange");
navbarSearch.trigger("blur");
}
},
},
});
}
// Owl carousel
if (plugins.owl.length) {
for (var i = 0; i < plugins.owl.length; i++) {
var carousel = $(plugins.owl[i]);
plugins.owl[i].owl = carousel;
initOwlCarousel(carousel);
}
}
// WOW
if (
$html.hasClass("wow-animation") &&
plugins.wow.length &&
!isNoviBuilder &&
isDesktop
) {
new WOW().init();
}
// RD Input Label
if (plugins.rdInputLabel.length) {
plugins.rdInputLabel.RDInputLabel();
}
// Regula
if (plugins.regula.length) {
attachFormValidator(plugins.regula);
}
// RD Mailform
if (plugins.rdMailForm.length) {
var i,
j,
k,
msg = {
MF000: "Successfully sent!",
MF001: "Recipients are not set!",
MF002: "Form will not work locally!",
MF003: "Please, define email field in your form!",
MF004: "Please, define type of your form!",
MF254: "Something went wrong with PHPMailer!",
MF255: "Aw, snap! Something went wrong.",
};
for (i = 0; i < plugins.rdMailForm.length; i++) {
var $form = $(plugins.rdMailForm[i]),
formHasCaptcha = false;
$form.attr("novalidate", "novalidate").ajaxForm({
data: {
"form-type": $form.attr("data-form-type") || "contact",
counter: i,
},
beforeSubmit: function (arr, $form, options) {
if (isNoviBuilder) return;
var form = $(plugins.rdMailForm[this.extraData.counter]),
inputs = form.find("[data-constraints]"),
output = $("#" + form.attr("data-form-output")),
captcha = form.find(".recaptcha"),
captchaFlag = true;
output.removeClass("active error success");
if (isValidated(inputs, captcha)) {
// veify reCaptcha
if (captcha.length) {
var captchaToken = captcha.find(".g-recaptcha-response").val(),
captchaMsg = {
CPT001:
'Please, setup you "site key" and "secret key" of reCaptcha',
CPT002: "Something wrong with google reCaptcha",
};
formHasCaptcha = true;
$.ajax({
method: "POST",
url: "bat/reCaptcha.php",
data: {
"g-recaptcha-response": captchaToken,
},
async: false,
}).done(function (responceCode) {
if (responceCode !== "CPT000") {
if (output.hasClass("snackbars")) {
output.html(
'<p><span class="icon text-middle mdi mdi-check icon-xxs"></span><span>' +
captchaMsg[responceCode] +
"</span></p>"
);
setTimeout(function () {
output.removeClass("active");
}, 3500);
captchaFlag = false;
} else {
output.html(captchaMsg[responceCode]);
}
output.addClass("active");
}
});
}
if (!captchaFlag) {
return false;
}
form.addClass("form-in-process");
if (output.hasClass("snackbars")) {
output.html(
'<p><span class="icon text-middle fa fa-circle-o-notch fa-spin icon-xxs"></span><span>Sending</span></p>'
);
output.addClass("active");
}
} else {
return false;
}
},
error: function (result) {
if (isNoviBuilder) return;
var output = $(
"#" +
$(plugins.rdMailForm[this.extraData.counter]).attr(
"data-form-output"
)
),
form = $(plugins.rdMailForm[this.extraData.counter]);
output.text(msg[result]);
form.removeClass("form-in-process");
if (formHasCaptcha) {
grecaptcha.reset();
}
},
success: function (result) {
if (isNoviBuilder) return;
var form = $(plugins.rdMailForm[this.extraData.counter]),
output = $("#" + form.attr("data-form-output")),
select = form.find("select");
form.addClass("success").removeClass("form-in-process");
if (formHasCaptcha) {
grecaptcha.reset();
}
result = result.length === 5 ? result : "MF255";
output.text(msg[result]);
if (result === "MF000") {
if (output.hasClass("snackbars")) {
output.html(
'<p><span class="icon text-middle mdi mdi-check icon-xxs"></span><span>' +
msg[result] +
"</span></p>"
);
} else {
output.addClass("active success");
}
} else {
if (output.hasClass("snackbars")) {
output.html(
' <p class="snackbars-left"><span class="icon icon-xxs mdi mdi-alert-outline text-middle"></span><span>' +
msg[result] +
"</span></p>"
);
} else {
output.addClass("active error");
}
}
form.clearForm();
if (select.length) {
select.select2("val", "");
}
form.find("input, textarea").trigger("blur");
setTimeout(function () {
output.removeClass("active error success");
form.removeClass("success");
}, 3500);
},
});
}
}
// lightGallery
plugins.lightGallery = $('[data-lightgallery="group"]');
if (plugins.lightGallery.length) {
for (var i = 0; i < plugins.lightGallery.length; i++) {
initLightGallery(plugins.lightGallery[i]);
}
}
// lightGallery item
plugins.lightGalleryItem = $('[data-lightgallery="item"]');
if (plugins.lightGalleryItem.length) {
for (var i = 0; i < plugins.lightGalleryItem.length; i++) {
initLightGalleryItem(plugins.lightGalleryItem[i]);
}
}
// Dynamic lightGallery
plugins.lightDynamicGalleryItem = $('[data-lightgallery="dynamic"]');
if (plugins.lightDynamicGalleryItem.length) {
for (var i = 0; i < plugins.lightDynamicGalleryItem.length; i++) {
initDynamicLightGallery(plugins.lightDynamicGalleryItem[i]);
}
}
// Button Nuka
if (plugins.buttonNuka.length) {
plugins.buttonNuka
.on("mouseenter", function (e) {
var parentOffset = $(this).offset(),
relX = e.pageX - parentOffset.left,
relY = e.pageY - parentOffset.top;
$(this).find(".button-overlay").css({ top: relY, left: relX });
})
.on("mouseout", function (e) {
var parentOffset = $(this).offset(),
relX = e.pageX - parentOffset.left,
relY = e.pageY - parentOffset.top;
$(this).find(".button-overlay").css({ top: relY, left: relX });
});
}
});
})();

4636
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

23
package.json Normal file
View File

@ -0,0 +1,23 @@
{
"devDependencies": {
"gulp": "^5.0.0",
"gulp-autoprefixer": "8.0.0",
"gulp-clean": "^0.4.0",
"gulp-connect": "^5.7.0",
"gulp-csso": "^4.0.1",
"gulp-html-minimizer": "^2.0.1",
"gulp-livereload": "^4.0.2",
"gulp-purgecss": "^6.0.0",
"gulp-uglify": "^3.0.2",
"gulp-minify-css-names": "2.0.0"
},
"browserslist": [
"last 2 versions",
"> 5%",
"IE 10"
],
"scripts": {
"dev": "gulp dev",
"build": "gulp"
}
}