Files
sam-kd/js/script.js
hskwon aca1767eb9 초기 커밋: 5130 레거시 시스템
- URL 하드코딩 → .env APP_URL 기반 동적 URL로 변경
- DB 연결 하드코딩 → .env 기반으로 변경
- MySQL strict mode DATE 오류 수정
2025-12-10 20:14:31 +09:00

112 lines
2.2 KiB
JavaScript

/**
* WEBSITE: https://themefisher.com
* TWITTER: https://twitter.com/themefisher
* FACEBOOK: https://www.facebook.com/themefisher
* GITHUB: https://github.com/themefisher/
*/
(function ($) {
'use strict';
$(window).scroll(function () {
if ($('.navigation').offset().top > 100) {
$('.navigation').addClass('fixed-nav');
} else {
$('.navigation').removeClass('fixed-nav');
}
});
$('.portfolio-gallery').each(function () {
$(this).find('.popup-gallery').magnificPopup({
type: 'image',
gallery: {
enabled: true
}
});
});
$('#contact-form').validate({
rules: {
user_name: {
required: true,
minlength: 4
},
user_email: {
required: true,
email: true
},
// user_subject: {
// required: false
// },
user_message: {
required: true
}
},
messages: {
user_name: {
required: 'Come on, you have a name don\'t you?',
minlength: 'Your name must consist of at least 2 characters'
},
user_email: {
required: 'Please put your email address'
},
user_message: {
required: 'Put some messages here?',
minlength: 'Your name must consist of at least 2 characters'
}
},
submitHandler: function (form) {
$(form).ajaxSubmit({
type: 'POST',
data: $(form).serialize(),
url: 'sendmail.php',
success: function () {
$('#contact-form #success').fadeIn();
},
error: function () {
$('#contact-form #error').fadeIn();
}
});
}
});
$('.testimonial-slider').slick({
slidesToShow: 1,
infinite: true,
arrows: false,
autoplay: true,
autoplaySpeed: 5000,
dots: true
});
// Init Magnific Popup
$('.portfolio-popup').magnificPopup({
delegate: 'a',
type: 'image',
gallery: {
enabled: true
},
mainClass: 'mfp-with-zoom',
navigateByImgClick: true,
arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
tPrev: 'Previous (Left arrow key)',
tNext: 'Next (Right arrow key)',
tCounter: '<span class="mfp-counter">%curr% of %total%</span>',
zoom: {
enabled: true,
duration: 300,
easing: 'ease-in-out',
opener: function (openerElement) {
return openerElement.is('img') ? openerElement : openerElement.find('img');
}
}
});
})(jQuery);