This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function stickySharingIcons() { | |
if (window.innerWidth > 768) { | |
const stickyIcons = document.querySelectorAll(".sticky-sharing-icons"); | |
if (stickyIcons.length > 0) { | |
for (var i = 0; i < stickyIcons.length; i++) { | |
makeIconsSticky(stickyIcons[i], document.querySelector(".article-page-content")); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var browserify = require('browserify'); | |
var gulp = require("gulp"); | |
var sass = require("gulp-sass"); | |
var rename = require("gulp-rename"); | |
var autoprefixer = require("gulp-autoprefixer"); | |
var cssnano = require("gulp-cssnano"); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var babel = require('gulp-babel'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function polyfill() { | |
// allow using el.querySelectorAll(...).forEach(...) for looping through nodeLists | |
if (!NodeList.prototype.forEach) { | |
NodeList.prototype.forEach = Array.prototype.forEach; | |
} | |
// allow using [].findIndex(...) in all browsers | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex | |
// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm install --save-dev w3cjs | |
var w3cjs = require('w3cjs'); | |
var timer = 0; | |
var takeTime = setInterval(function() { | |
timer = timer + 1; | |
}, 1); | |
const validationService = (target) => { | |
return new Promise((resolve, reject) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
@Styles.Render("~/Bundles/CSS") | |
... | |
@Scripts.Render("~/Bundles/JS") | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "skuld-frontend", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "backstop test", | |
"approve-tests": "backstop approve", | |
"build": "set NODE_ENV=production && webpack -p", | |
"watch": "webpack --cache=false --watch" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm install --save-dev gulp babelify browserify babel-preset-es2015 gulp-connect vinyl-source-stream vinyl-buffer gulp-uglify gulp-sourcemaps | |
/* | |
folder structure: | |
build | |
src/js/index.js | |
static/index.html | |
package.json | |
gulpfile.js | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// classlist helper for better browser compat | |
var hasClass = function (el, className) { | |
if (el.classList) { | |
return el.classList.contains(className); | |
} else { | |
return new RegExp('(^| )' + className + '( |$)', 'gi').test(el.className); | |
} | |
} | |
// helper for setting multiple attributes to same element |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// classlist helper for better browser compat | |
var hasClass = function(el, className){ | |
if (el.classList){ | |
return el.classList.contains(className); | |
} else { | |
return new RegExp('(^| )' + className + '( |$)', 'gi').test(el.className); | |
} | |
} |