PageSourceSearch

https://webdevcat.com/js/stylish-portfolio.js

js webdevcat.com collected 2026-10-05 07:34:28 UTC 2,479 bytes, 89 lines download raw bytes

1document.addEventListener("DOMContentLoaded", function(event) {
2  var links = document.links;
3  for (var i = 0, linksLength = links.length; i < linksLength; i++) {
4    if (links[i].hostname != window.location.hostname) {
5      links[i].target = "_blank";
6      // links[i].setAttribute("rel", "noopener noreferrer");
7      links[i].className += " external-link";
8    } else {
9      links[i].className += " local-link";
10    }
11  }
12});
13
14
15(function($) {
16  "use strict"; // Start of use strict
17
18  // Closes the sidebar menu
19  $(".menu-toggle").click(function(e) {
20    e.preventDefault();
21    $("#sidebar-wrapper").toggleClass("active");
22    $(".menu-toggle > .fa-bars, .menu-toggle > .fa-times").toggleClass("fa-bars fa-times");
23    $(this).toggleClass("active");
24  });
25
26  // Closes responsive menu when a scroll trigger link is clicked
27  $('#sidebar-wrapper a').click(function() {
28    $("#sidebar-wrapper").removeClass("active");
29    $(".menu-toggle").removeClass("active");
30    $(".menu-toggle > .fa-bars, .menu-toggle > .fa-times").toggleClass("fa-bars fa-times");
31  });
32
33  // Scroll to top button appear
34  $(document).scroll(function() {
35    var scrollDistance = $(this).scrollTop();
36    if (scrollDistance > 100) {
37      $('.scroll-to-top').show();
38    } else {
39      $('.scroll-to-top').hide();
40    }
41  });
42
43  // Changes portfolio caption according to screen size
44  function screenClass() {
45    if($(window).innerWidth() > 992) {
46      // Show and hide caption-content
47      $(".caption-content").each(function() {
48        $(this).hide();
49      })
50
51      $(".portfolio-item").hover(
52        function (){
53          $(this).children().children().show();
54        }, function() {
55          $(this).children().children().hide();
56        }
57      );
58    } else {
59      // Show and hide caption-content
60      $(".caption-content").each(function() {
61        $(this).show();
62      })
63
64      $(".portfolio-item").each(function() {
65        $(this).show();
66      })
67    }
68  }
69
70  // Fire.
71  screenClass();
72
73  // And recheck when window gets resized.
74  $(window).bind('resize',function(){
75    screenClass();
76  });
77
78  $(document).ready(function() {
79    // Show contact message when submitted
80    if (window.location.href.indexOf("submission-received") > -1) {
81      $('#submission-received').show();
82    }
83    // Show review message when submitted
84    if (window.location.href.indexOf("review-received") > -1) {
85      $('#review-received').show();
86    }
87  });
88
89})(jQuery); // End of use strict

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.