PageSourceSearch

https://leejaewook.jp/assets/js/main.js

js leejaewook.jp collected 2026-10-05 20:51:59 UTC 30,366 bytes, 851 lines download raw bytes

1console.log('%c Proudly Crafted with ZiOn.', 'background: #222; color: #bada55');
2
3/* ---------------------------------------------- /*
4 * Preloader
5 /* ---------------------------------------------- */
6(function(){
7    $(window).on('load', function() {
8        $('.loader').fadeOut();
9        $('.page-loader').delay(350).fadeOut('slow');
10    });
11
12    $(document).ready(function() {
13
14        /* ---------------------------------------------- /*
15         * WOW Animation When You Scroll
16         /* ---------------------------------------------- */
17
18        wow = new WOW({
19            mobile: false
20        });
21        wow.init();
22
23
24        /* ---------------------------------------------- /*
25         * Scroll top
26         /* ---------------------------------------------- */
27
28        $(window).scroll(function() {
29            if ($(this).scrollTop() > 100) {
30                $('.scroll-up').fadeIn();
31            } else {
32                $('.scroll-up').fadeOut();
33            }
34        });
35
36        $('a[href="#totop"]').click(function() {
37            $('html, body').animate({ scrollTop: 0 }, 'slow');
38            return false;
39        });
40
41
42        /* ---------------------------------------------- /*
43         * Initialization General Scripts for all pages
44         /* ---------------------------------------------- */
45
46        var homeSection = $('.home-section'),
47            navbar      = $('.navbar-custom'),
48            navHeight   = navbar.height(),
49            worksgrid   = $('#works-grid'),
50            width       = Math.max($(window).width(), window.innerWidth),
51            mobileTest  = false;
52
53        if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
54            mobileTest = true;
55        }
56
57        buildHomeSection(homeSection);
58        navbarAnimation(navbar, homeSection, navHeight);
59        navbarSubmenu(width);
60        hoverDropdown(width, mobileTest);
61
62        $(window).resize(function() {
63            var width = Math.max($(window).width(), window.innerWidth);
64            buildHomeSection(homeSection);
65            hoverDropdown(width, mobileTest);
66        });
67
68        $(window).scroll(function() {
69            effectsHomeSection(homeSection, this);
70            navbarAnimation(navbar, homeSection, navHeight);
71        });
72
73        /* ---------------------------------------------- /*
74         * Set sections backgrounds
75         /* ---------------------------------------------- */
76
77        var module = $('.home-section, .module, .module-small, .side-image');
78        module.each(function(i) {
79            if ($(this).attr('data-background')) {
80                $(this).css('background-image', 'url(' + $(this).attr('data-background') + ')');
81            }
82        });
83
84        /* ---------------------------------------------- /*
85         * Home section height
86         /* ---------------------------------------------- */
87
88        function buildHomeSection(homeSection) {
89            if (homeSection.length > 0) {
90                if (homeSection.hasClass('home-full-height')) {
91                    homeSection.height($(window).height());
92                } else {
93                    homeSection.height($(window).height() * 0.85);
94                }
95            }
96        }
97
98
99        /* ---------------------------------------------- /*
100         * Home section effects
101         /* ---------------------------------------------- */
102
103        function effectsHomeSection(homeSection, scrollTopp) {
104            if (homeSection.length > 0) {
105                var homeSHeight = homeSection.height();
106                var topScroll = $(document).scrollTop();
107                if ((homeSection.hasClass('home-parallax')) && ($(scrollTopp).scrollTop() <= homeSHeight)) {
108                    homeSection.css('top', (topScroll * 0.55));
109                }
110                if (homeSection.hasClass('home-fade') && ($(scrollTopp).scrollTop() <= homeSHeight)) {
111                    var caption = $('.caption-content');
112                    caption.css('opacity', (1 - topScroll/homeSection.height() * 1));
113                }
114            }
115        }
116
117        /* ---------------------------------------------- /*
118         * Intro slider setup
119         /* ---------------------------------------------- */
120
121        if( $('.hero-slider').length > 0 ) {
122            $('.hero-slider').flexslider( {
123                animation: "fade",
124                animationSpeed: 1000,
125                animationLoop: true,
126                prevText: '',
127                nextText: '',
128                before: function(slider) {
129                    $('.titan-caption').fadeOut().animate({top:'-80px'},{queue:false, easing: 'swing', duration: 700});
130                    slider.slides.eq(slider.currentSlide).delay(500);
131                    slider.slides.eq(slider.animatingTo).delay(500);
132                },
133                after: function(slider) {
134                    $('.titan-caption').fadeIn().animate({top:'0'},{queue:false, easing: 'swing', duration: 700});
135                },
136                useCSS: true
137            });
138        }
139
140
141        /* ---------------------------------------------- /*
142         * Rotate
143         /* ---------------------------------------------- */
144
145        $(".rotate").textrotator({
146            animation: "dissolve",
147            separator: "|",
148            speed: 3000
149        });
150
151
152        /* ---------------------------------------------- /*
153         * Transparent navbar animation
154         /* ---------------------------------------------- */
155
156        function navbarAnimation(navbar, homeSection, navHeight) {
157            var topScroll = $(window).scrollTop();
158            if (navbar.length > 0 && homeSection.length > 0) {
159                if(topScroll >= navHeight) {
160                    navbar.removeClass('navbar-transparent');
161                } else {
162                    navbar.addClass('navbar-transparent');
163                }
164            }
165        }
166
167        /* ---------------------------------------------- /*
168         * Navbar submenu
169         /* ---------------------------------------------- */
170
171        function navbarSubmenu(width) {
172            if (width > 767) {
173                $('.navbar-custom .navbar-nav > li.dropdown').hover(function() {
174                    var MenuLeftOffset  = $('.dropdown-menu', $(this)).offset().left;
175                    var Menu1LevelWidth = $('.dropdown-menu', $(this)).width();
176                    if (width - MenuLeftOffset < Menu1LevelWidth * 2) {
177                        $(this).children('.dropdown-menu').addClass('leftauto');
178                    } else {
179                        $(this).children('.dropdown-menu').removeClass('leftauto');
180                    }
181                    if ($('.dropdown', $(this)).length > 0) {
182                        var Menu2LevelWidth = $('.dropdown-menu', $(this)).width();
183                        if (width - MenuLeftOffset - Menu1LevelWidth < Menu2LevelWidth) {
184                            $(this).children('.dropdown-menu').addClass('left-side');
185                        } else {
186                            $(this).children('.dropdown-menu').removeClass('left-side');
187                        }
188                    }
189                });
190            }
191        }
192
193        /* ---------------------------------------------- /*
194         * Navbar hover dropdown on desctop
195         /* ---------------------------------------------- */
196
197        function hoverDropdown(width, mobileTest) {
198            if ((width > 767) && (mobileTest !== true)) {
199                $('.navbar-custom .navbar-nav > li.dropdown, .navbar-custom li.dropdown > ul > li.dropdown').removeClass('open');
200                var delay = 0;
201                var setTimeoutConst;
202                $('.navbar-custom .navbar-nav > li.dropdown, .navbar-custom li.dropdown > ul > li.dropdown').hover(function() {
203                        var $this = $(this);
204                        setTimeoutConst = setTimeout(function() {
205                            $this.addClass('open');
206                            $this.find('.dropdown-toggle').addClass('disabled');
207                        }, delay);
208                    },
209                    function() {
210                        clearTimeout(setTimeoutConst);
211                        $(this).removeClass('open');
212                        $(this).find('.dropdown-toggle').removeClass('disabled');
213                    });
214            } else {
215                $('.navbar-custom .navbar-nav > li.dropdown, .navbar-custom li.dropdown > ul > li.dropdown').unbind('mouseenter mouseleave');
216                $('.navbar-custom [data-toggle=dropdown]').not('.binded').addClass('binded').on('click', function(event) {
217                    event.preventDefault();
218                    event.stopPropagation();
219                    $(this).parent().siblings().removeClass('open');
220                    $(this).parent().siblings().find('[data-toggle=dropdown]').parent().removeClass('open');
221                    $(this).parent().toggleClass('open');
222                });
223            }
224        }
225
226        /* ---------------------------------------------- /*
227         * Navbar collapse on click
228         /* ---------------------------------------------- */
229
230        $(document).on('click','.navbar-collapse.in',function(e) {
231            if( $(e.target).is('a') && $(e.target).attr('class') != 'dropdown-toggle' ) {
232                $(this).collapse('hide');
233            }
234        });
235
236
237        /* ---------------------------------------------- /*
238         * Video popup, Gallery
239         /* ---------------------------------------------- */
240
241        $('.video-pop-up').magnificPopup({
242            type: 'iframe'
243        });
244
245        $(".gallery-item").magnificPopup({
246            delegate: 'a',
247            type: 'image',
248            gallery: {
249                enabled: true,
250                navigateByImgClick: true,
251                preload: [0,1]
252            },
253            image: {
254                titleSrc: 'title',
255                tError: 'The image could not be loaded.'
256            }
257        });
258
259
260        /* ---------------------------------------------- /*
261         * Portfolio
262         /* ---------------------------------------------- */
263
264        var worksgrid   = $('#works-grid'),
265            worksgrid_mode;
266
267        if (worksgrid.hasClass('works-grid-masonry')) {
268            worksgrid_mode = 'masonry';
269        } else {
270            worksgrid_mode = 'fitRows';
271        }
272
273        worksgrid.imagesLoaded(function() {
274            worksgrid.isotope({
275                layoutMode: worksgrid_mode,
276                itemSelector: '.work-item'
277            });
278        });
279
280        $('#filters a').click(function() {
281            $('#filters .current').removeClass('current');
282            $(this).addClass('current');
283            var selector = $(this).attr('data-filter');
284
285            worksgrid.isotope({
286                filter: selector,
287                animationOptions: {
288                    duration: 750,
289                    easing: 'linear',
290                    queue: false
291                }
292            });
293
294            return false;
295        });
296
297
298        /* ---------------------------------------------- /*
299         * Testimonials
300         /* ---------------------------------------------- */
301
302        if ($('.testimonials-slider').length > 0 ) {
303            $('.testimonials-slider').flexslider( {
304                animation: "slide",
305                smoothHeight: true
306            });
307        }
308
309
310        /* ---------------------------------------------- /*
311         * Post Slider
312         /* ---------------------------------------------- */
313
314        if ($('.post-images-slider').length > 0 ) {
315            $('.post-images-slider').flexslider( {
316                animation: "slide",
317                smoothHeight: true,
318            });
319        }
320
321
322        /* ---------------------------------------------- /*
323         * Progress bar animations
324         /* ---------------------------------------------- */
325
326        $('.progress-bar').each(function(i) {
327            $(this).appear(function() {
328                var percent = $(this).attr('aria-valuenow');
329                $(this).animate({'width' : percent + '%'});
330                $(this).find('span').animate({'opacity' : 1}, 900);
331                $(this).find('span').countTo({from: 0, to: percent, speed: 900, refreshInterval: 30});
332            });
333        });
334
335
336        /* ---------------------------------------------- /*
337         * Funfact Count-up
338         /* ---------------------------------------------- */
339
340        $('.count-item').each(function(i) {
341            $(this).appear(function() {
342                var number = $(this).find('.count-to').data('countto');
343                $(this).find('.count-to').countTo({from: 0, to: number, speed: 1200, refreshInterval: 30});
344            });
345        });
346
347
348        /* ---------------------------------------------- /*
349         * Youtube video background
350         /* ---------------------------------------------- */
351
352        $(function(){
353            $(".video-player").mb_YTPlayer();
354        });
355
356        $('#video-play').click(function(event) {
357            event.preventDefault();
358            if ($(this).hasClass('fa-play')) {
359                $('.video-player').playYTP();
360            } else {
361                $('.video-player').pauseYTP();
362            }
363            $(this).toggleClass('fa-play fa-pause');
364            return false;
365        });
366
367        $('#video-volume').click(function(event) {
368            event.preventDefault();
369            if ($(this).hasClass('fa-volume-off')) {
370                $('.video-player').YTPUnmute();
371            } else {
372                $('.video-player').YTPMute();
373            }
374            $(this).toggleClass('fa-volume-off fa-volume-up');
375            return false;
376        });
377
378
379        /* ---------------------------------------------- /*
380         * Owl Carousel
381         /* ---------------------------------------------- */
382
383        $('.owl-carousel').each(function(i) {
384
385            // Check items number
386            if ($(this).data('items') > 0) {
387                items = $(this).data('items');
388            } else {
389                items = 4;
390            }
391
392            // Check pagination true/false
393            if (($(this).data('pagination') > 0) && ($(this).data('pagination') === true)) {
394                pagination = true;
395            } else {
396                pagination = false;
397            }
398
399            // Check navigation true/false
400            if (($(this).data('navigation') > 0) && ($(this).data('navigation') === true)) {
401                navigation = true;
402            } else {
403                navigation = false;
404            }
405
406            // Build carousel
407            $(this).owlCarousel( {
408                navText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'],
409                nav: navigation,
410                dots: pagination,
411                loop: true,
412                dotsSpeed: 400,
413                items: items,
414                navSpeed: 300,
415                autoplay: 2000
416            });
417
418        });
419
420
421        /* ---------------------------------------------- /*
422         * Blog masonry
423         /* ---------------------------------------------- */
424
425        $('.post-masonry').imagesLoaded(function() {
426            $('.post-masonry').masonry();
427        });
428
429
430        /* ---------------------------------------------- /*
431         * Scroll Animation
432         /* ---------------------------------------------- */
433
434        $('.section-scroll').bind('click', function(e) {
435            var anchor = $(this);
436            $('html, body').stop().animate({
437                scrollTop: $(anchor.attr('href')).offset().top - 50
438            }, 1000);
439            e.preventDefault();
440        });
441
442        /*===============================================================
443         Working Contact Form
444         ================================================================*/
445
446        $("#contactForm").submit(function (e) {
447
448            e.preventDefault();
449            var $ = jQuery;
450
451            var postData = $(this).serializeArray(),
452                formURL = $(this).attr("action"),
453                $cfResponse = $('#contactFormResponse'),
454                $cfsubmit = $("#cfsubmit"),
455                cfsubmitText = $cfsubmit.text();
456
457            $cfsubmit.text("Sending...");
458
459
460            $.ajax(
461                {
462                    url: formURL,
463                    type: "POST",
464                    data: postData,
465                    success: function (data) {
466                        $cfResponse.html(data);
467                        $cfsubmit.text(cfsubmitText);
468                        $('#contactForm input[name=name]').val('');
469                        $('#contactForm input[name=email]').val('');
470                        $('#contactForm textarea[name=message]').val('');
471                    },
472                    error: function (data) {
473                        alert("Error occurd! Please try again");
474                    }
475                });
476
477            return false;
478
479        });
480
481
482        /*===============================================================
483         Working Request A Call Form
484         ================================================================*/
485
486        $("#requestACall").submit(function (e) {
487
488            e.preventDefault();
489            var $ = jQuery;
490
491            var postData = $(this).serializeArray(),
492                formURL = $(this).attr("action"),
493                $cfResponse = $('#requestFormResponse'),
494                $cfsubmit = $("#racSubmit"),
495                cfsubmitText = $cfsubmit.text();
496
497            $cfsubmit.text("Sending...");
498
499
500            $.ajax(
501                {
502                    url: formURL,
503                    type: "POST",
504                    data: postData,
505                    success: function (data) {
506                        $cfResponse.html(data);
507                        $cfsubmit.text(cfsubmitText);
508                        $('#requestACall input[name=name]').val('');
509                        $('#requestACall input[name=subject]').val('');
510                        $('#requestACall textarea[name=phone]').val('');
511                    },
512                    error: function (data) {
513                        alert("Error occurd! Please try again");
514                    }
515                });
516
517            return false;
518
519        });
520
521
522        /*===============================================================
523         Working Reservation Form
524         ================================================================*/
525
526        $("#reservationForm").submit(function (e) {
527
528            e.preventDefault();
529            var $ = jQuery;
530
531            var postData = $(this).serializeArray(),
532                formURL = $(this).attr("action"),
533                $cfResponse = $('#reservationFormResponse'),
534                $cfsubmit = $("#rfsubmit"),
535                cfsubmitText = $cfsubmit.text();
536
537            $cfsubmit.text("Sending...");
538
539
540            $.ajax(
541                {
542                    url: formURL,
543                    type: "POST",
544                    data: postData,
545                    success: function (data) {
546                        $cfResponse.html(data);
547                        $cfsubmit.text(cfsubmitText);
548                        $('#reservationForm input[name=date]').val('');
549                        $('#reservationForm input[name=time]').val('');
550                        $('#reservationForm textarea[name=people]').val('');
551                        $('#reservationForm textarea[name=email]').val('');
552                    },
553                    error: function (data) {
554                        alert("Error occurd! Please try again");
555                    }
556                });
557
558            return false;
559
560        });
561
562
563        /* ---------------------------------------------- /*
564         * Subscribe form ajax
565         /* ---------------------------------------------- */
566
567        $('#subscription-form').submit(function(e) {
568
569            e.preventDefault();
570            var $form           = $('#subscription-form');
571            var submit          = $('#subscription-form-submit');
572            var ajaxResponse    = $('#subscription-response');
573            var email           = $('input#semail').val();
574
575            $.ajax({
576                type: 'POST',
577                url: 'assets/php/subscribe.php',
578                dataType: 'json',
579                data: {
580                    email: email
581                },
582                cache: false,
583                beforeSend: function(result) {
584                    submit.empty();
585                    submit.append('<i class="fa fa-cog fa-spin"></i> Wait...');
586                },
587                success: function(result) {
588                    if(result.sendstatus == 1) {
589                        ajaxResponse.html(result.message);
590                        $form.fadeOut(500);
591                    } else {
592                        ajaxResponse.html(result.message);
593                    }
594                }
595            });
596
597        });
598
599
600        /* ---------------------------------------------- /*
601         * Google Map
602         /* ---------------------------------------------- */
603
604        if($("#map").length == 0 || typeof google == 'undefined') return;
605
606        // When the window has finished loading create our google map below
607        google.maps.event.addDomListener(window, 'load', init);
608
609        var mkr = new google.maps.LatLng(40.6700, -74.2000);
610        var cntr = (mobileTest) ? mkr : new google.maps.LatLng(40.6700, -73.9400);
611
612        function init() {
613            // Basic options for a simple Google Map
614            // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions
615            var mapOptions = {
616                // How zoomed in you want the map to start at (always required)
617                zoom: 11,
618                scrollwheel: false,
619                // The latitude and longitude to center the map (always required)
620                center: cntr, // New York
621
622                // How you would like to style the map.
623                // This is where you would paste any style found on Snazzy Maps.
624                styles: [
625                    {
626                        "featureType": "all",
627                        "elementType": "geometry.fill",
628                        "stylers": [
629                            {
630                                "visibility": "on"
631                            },
632                            {
633                                "saturation": "-11"
634                            }
635                        ]
636                    },
637                    {
638                        "featureType": "administrative",
639                        "elementType": "geometry.fill",
640                        "stylers": [
641                            {
642                                "saturation": "22"
643                            }
644                        ]
645                    },
646                    {
647                        "featureType": "administrative",
648                        "elementType": "geometry.stroke",
649                        "stylers": [
650                            {
651                                "saturation": "-58"
652                            },
653                            {
654                                "color": "#cfcece"
655                            }
656                        ]
657                    },
658                    {
659                        "featureType": "administrative",
660                        "elementType": "labels.text",
661                        "stylers": [
662                            {
663                                "color": "#f8f8f8"
664                            }
665                        ]
666                    },
667                    {
668                        "featureType": "administrative",
669                        "elementType": "labels.text.fill",
670                        "stylers": [
671                            {
672                                "color": "#999999"
673                            },
674                            {
675                                "visibility": "on"
676                            }
677                        ]
678                    },
679                    {
680                        "featureType": "administrative",
681                        "elementType": "labels.text.stroke",
682                        "stylers": [
683                            {
684                                "visibility": "on"
685                            }
686                        ]
687                    },
688                    {
689                        "featureType": "administrative.country",
690                        "elementType": "geometry.fill",
691                        "stylers": [
692                            {
693                                "color": "#f9f9f9"
694                            },
695                            {
696                                "visibility": "simplified"
697                            }
698                        ]
699                    },
700                    {
701                        "featureType": "landscape",
702                        "elementType": "all",
703                        "stylers": [
704                            {
705                                "color": "#f2f2f2"
706                            }
707                        ]
708                    },
709                    {
710                        "featureType": "landscape",
711                        "elementType": "geometry",
712                        "stylers": [
713                            {
714                                "saturation": "-19"
715                            },
716                            {
717                                "lightness": "-2"
718                            },
719                            {
720                                "visibility": "on"
721                            }
722                        ]
723                    },
724                    {
725                        "featureType": "poi",
726                        "elementType": "all",
727                        "stylers": [
728                            {
729                                "visibility": "off"
730                            }
731                        ]
732                    },
733                    {
734                        "featureType": "road",
735                        "elementType": "all",
736                        "stylers": [
737                            {
738                                "saturation": -100
739                            },
740                            {
741                                "lightness": 45
742                            }
743                        ]
744                    },
745                    {
746                        "featureType": "road.highway",
747                        "elementType": "all",
748                        "stylers": [
749                            {
750                                "visibility": "simplified"
751                            }
752                        ]
753                    },
754                    {
755                        "featureType": "road.arterial",
756                        "elementType": "labels.icon",
757                        "stylers": [
758                            {
759                                "visibility": "off"
760                            }
761                        ]
762                    },
763                    {
764                        "featureType": "transit",
765                        "elementType": "all",
766                        "stylers": [
767                            {
768                                "visibility": "off"
769                            }
770                        ]
771                    },
772                    {
773                        "featureType": "water",
774                        "elementType": "all",
775                        "stylers": [
776                            {
777                                "color": "#d8e1e5"
778                            },
779                            {
780                                "visibility": "on"
781                            }
782                        ]
783                    },
784                    {
785                        "featureType": "water",
786                        "elementType": "geometry.fill",
787                        "stylers": [
788                            {
789                                "color": "#dedede"
790                            }
791                        ]
792                    },
793                    {
794                        "featureType": "water",
795                        "elementType": "labels.text",
796                        "stylers": [
797                            {
798                                "color": "#cbcbcb"
799                            }
800                        ]
801                    },
802                    {
803                        "featureType": "water",
804                        "elementType": "labels.text.fill",
805                        "stylers": [
806                            {
807                                "color": "#9c9c9c"
808                            }
809                        ]
810                    },
811                    {
812                        "featureType": "water",
813                        "elementType": "labels.text.stroke",
814                        "stylers": [
815                            {
816                                "visibility": "off"
817                            }
818                        ]
819                    }
820                ]
821            };
822
823            // Get the HTML DOM element that will contain your map
824            // We are using a div with id="map" seen below in the <body>
825            var mapElement = document.getElementById('map');
826
827            // Create the Google Map using our element and options defined above
828            var map = new google.maps.Map(mapElement, mapOptions);
829
830            // Let's also add a marker while we're at it
831            var image = new google.maps.MarkerImage('assets/images/map-icon.png',
832                new google.maps.Size(59, 65),
833                new google.maps.Point(0, 0),
834                new google.maps.Point(24, 42)
835            );
836
837            var marker = new google.maps.Marker({
838                position: mkr,
839                icon: image,
840                title: 'Titan',
841                infoWindow: {
842                    content: '<p><strong>Rival</strong><br/>121 Somewhere Ave, Suite 123<br/>P: (123) 456-7890<br/>Australia</p>'
843                },
844                map: map,
845            });
846        }
847
848    });
849})(jQuery);
850
851

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.