Skip to content

Commit 830c7d1

Browse files
committed
feat: move js to scriptt
1 parent 749fa29 commit 830c7d1

File tree

2 files changed

+49
-52
lines changed

2 files changed

+49
-52
lines changed

index.html

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -285,37 +285,6 @@ <h5>Working Hours</h5>
285285
<script src="js/swiper.min.js"></script>
286286
<script src="js/main.js"></script>
287287

288-
<script>
289-
// Email encryption to prevent spam
290-
function decryptEmail() {
291-
var encoded = "vasb@fxljbex.va"; // ROT13 encoded email
292-
var decoded = "";
293-
for (var i = 0; i < encoded.length; i++) {
294-
var c = encoded.charCodeAt(i);
295-
if (c >= 97 && c <= 122) { // a-z
296-
decoded += String.fromCharCode((c - 97 + 13) % 26 + 97);
297-
} else if (c >= 65 && c <= 90) { // A-Z
298-
decoded += String.fromCharCode((c - 65 + 13) % 26 + 65);
299-
} else {
300-
decoded += encoded.charAt(i);
301-
}
302-
}
303-
window.location.href = "mailto:" + decoded;
304-
}
305-
306-
// Phone encryption to prevent spam
307-
function decryptPhone() {
308-
var encoded = "+91 9029208698".split('').map(function (c) {
309-
if (c >= '0' && c <= '9') {
310-
return String.fromCharCode(((c.charCodeAt(0) - 48 + 5) % 10) + 48);
311-
}
312-
return c;
313-
}).join('');
314-
var decoded = "+91 9029208698";
315-
window.location.href = "tel:" + decoded.replace(/\s/g, '');
316-
}
317-
</script>
318-
319288
<!-- Mobile Call Button -->
320289
<a href="#" id="phoneLink" onclick="decryptPhone(); return false;" class="mobile-call-button d-md-none">
321290
<i class="la la-phone"></i>

js/main.js

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
1-
(function() {
1+
(function () {
22

33
'use strict';
44

55
// preloader
6-
$(window).on('load', function() {
6+
$(window).on('load', function () {
77
$('.loader').fadeOut('slow');
88
});
99

1010
// smooth scroll
11-
$("a").on("click", function(event) {
11+
$("a").on("click", function (event) {
1212

13-
if (this.hash !== "") {
14-
event.preventDefault();
13+
if (this.hash !== "") {
14+
event.preventDefault();
1515

16-
var hash = this.hash;
16+
var hash = this.hash;
1717

18-
$("html, body").animate({
18+
$("html, body").animate({
1919

20-
scrollTop: $(hash).offset().top - 50
20+
scrollTop: $(hash).offset().top - 50
2121

22-
}, 850);
22+
}, 850);
2323

24-
}
24+
}
2525

2626
});
2727

28-
2928
// swiper slider
3029
$(document).ready(function () {
3130
var swiper = new Swiper(".mySwiper", {
@@ -55,21 +54,50 @@
5554

5655
// navbar hide on click
5756
$(".navbar li a").on("click", function () {
58-
$(".navbar-collapse").collapse("hide");
57+
$(".navbar-collapse").collapse("hide");
5958
});
6059

6160
// navbar on scroll
62-
$(window).on("scroll", function() {
61+
$(window).on("scroll", function () {
6362

64-
var onScroll = $(this).scrollTop();
63+
var onScroll = $(this).scrollTop();
6564

66-
if( onScroll > 50) {
67-
$(".navbar").addClass("navbar-fixed");
68-
}
69-
else {
70-
$(".navbar").removeClass("navbar-fixed");
71-
}
65+
if (onScroll > 50) {
66+
$(".navbar").addClass("navbar-fixed");
67+
}
68+
else {
69+
$(".navbar").removeClass("navbar-fixed");
70+
}
7271

7372
});
7473

75-
})();
74+
})();
75+
76+
// Email encryption to prevent spam
77+
function decryptEmail() {
78+
var encoded = "vasb@fxljbex.va"; // ROT13 encoded email
79+
var decoded = "";
80+
for (var i = 0; i < encoded.length; i++) {
81+
var c = encoded.charCodeAt(i);
82+
if (c >= 97 && c <= 122) { // a-z
83+
decoded += String.fromCharCode((c - 97 + 13) % 26 + 97);
84+
} else if (c >= 65 && c <= 90) { // A-Z
85+
decoded += String.fromCharCode((c - 65 + 13) % 26 + 65);
86+
} else {
87+
decoded += encoded.charAt(i);
88+
}
89+
}
90+
window.location.href = "mailto:" + decoded;
91+
}
92+
93+
// Phone encryption to prevent spam
94+
function decryptPhone() {
95+
var encoded = "+91 9029208698".split('').map(function (c) {
96+
if (c >= '0' && c <= '9') {
97+
return String.fromCharCode(((c.charCodeAt(0) - 48 + 5) % 10) + 48);
98+
}
99+
return c;
100+
}).join('');
101+
var decoded = "+91 9029208698";
102+
window.location.href = "tel:" + decoded.replace(/\s/g, '');
103+
}

0 commit comments

Comments
 (0)