projects.js 661 B

12345678910111213141516171819
  1. import Filterizr from 'filterizr'
  2. import { insertScript } from '../core'
  3. document.addEventListener('DOMContentLoaded', () => {
  4. // ================== Project cards =====================
  5. // setup project filter buttons
  6. const projectCardHolder = document.getElementById('project-card-holder')
  7. if (projectCardHolder != null && projectCardHolder.children.length !== 0) {
  8. // eslint-disable-next-line no-new
  9. new Filterizr('.filtr-projects', {
  10. layout: 'sameWidth',
  11. controlsSelector: '.project-filtr-control'
  12. })
  13. }
  14. })
  15. // dynamically insert github buttons script.
  16. insertScript('github-buttons', 'https://buttons.github.io/buttons.js')