Skip to content

Instantly share code, notes, and snippets.

View akopcz2's full-sized avatar
👾
workin

akopcz2

👾
workin
View GitHub Profile
https://codesandbox.io/s/71z47kpl90
@akopcz2
akopcz2 / gist:d019789c8e87c9317841473678fd6906
Created January 10, 2019 00:29
after element for flex
.box__container:after{
content: "";
flex: auto;
}
@akopcz2
akopcz2 / gist:b89dd27b89b6d4509f117951b0b152f7
Created January 3, 2019 18:44
year change in footer snippet
<span className="ml-2">&copy; {new Date().getYear() + 1900}.</span>
@akopcz2
akopcz2 / gist:22885b1369fd2e31a84e61a344379b2f
Created December 10, 2018 18:22
Remove Polyfill for IE
// Remove Polyfill
// Create Element.remove() function if not exist
if (!('remove' in Element.prototype)) {
Element.prototype.remove = function () {
if (this.parentNode) {
this.parentNode.removeChild(this);
}
};
}
resizeBtns() {
const bodyWidth = document.body.clientWidth;
const img = this.element.querySelector(`.${this.settings.imgClassname}`);
const imgCR = img.getBoundingClientRect();
const imgRatio = imgCR.height / imgCR.width;
var sheet = document.createElement('style')
sheet.innerHTML = `${this.settings.prevButtonSelector}, ${this.settings.nextButtonSelector} {
height: calc(${100 * imgRatio}vw - ${(bodyWidth - imgCR.width + this.getScrollbarWidth()) * imgRatio}px);
}
class RMIPopup{
constructor(element){
this.element = element;
this.close = '.updated-rmi__form-close';
this.init();
}
init(){
let clickAnchor = this.element.querySelector('a');
this.attachListener(clickAnchor);
// place the above breakpoints into a list in order to build scalable font sizes
$breakpoints: (
xs: (
min: null,
max: 479px
),
sm: (
min: 480px,
max: 767px
),
gulp.task('dui', () =>{
return glob("deployment/public/services/print-at-your-service.html", function(er, files) {
let totalFiles = [];
let imageCount = 0;
let currentWorkingDirectory = process.env.PWD + '/';
if(er){
throw(er);
return;
}
function scrollIt(destination, duration = 200, easing = 'linear', offsetAdjustment, callback) {
const easings = {
easeOutQuad(t) {
return t * (2 - t);
}
};
const start = window.pageYOffset;
const startTime = 'now' in window.performance ? performance.now() : new Date().getTime();
function isAnyPartOfElementInViewport(el) {
const rect = el.getBoundingClientRect();
// DOMRect { x: 8, y: 8, width: 100, height: 100, top: 8, right: 108, bottom: 108, left: 8 }
const windowHeight = (window.innerHeight || document.documentElement.clientHeight);
const windowWidth = (window.innerWidth || document.documentElement.clientWidth);
// http://stackoverflow.com/questions/325933/determine-whether-two-date-ranges-overlap
const vertInView = (rect.top <= windowHeight) && ((rect.top + rect.height) >= 0);
const horInView = (rect.left <= windowWidth) && ((rect.left + rect.width) >= 0);