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
// Alerts | |
@include alert-variant($background, $border, $text-color); | |
// Background Variant | |
@include bg-variant($parent, $color); | |
// Border Radius | |
@include border-top-radius($radius); | |
@include border-right-radius($radius); | |
@include border-bottom-radius($radius); |
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
.region-header .page-element, | |
.region-header .block, | |
.page-width { | |
width: auto; | |
} | |
.block + .block, | |
.wrapper-content .block + .block, | |
.form-item, .form-actions, | |
.block .menu, | |
.views-row, |
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
module.exports = function(config) { | |
config.set({ | |
frameworks: ['mocha', 'chai', 'commonjs'], | |
files: [ | |
'test/**/*.+(spec|test).+(js|jsx|mjs)', | |
{ pattern: 'test/**/*', included: false, served: true } | |
], | |
browsers: ['Chrome'], | |
plugins: [ | |
'karma-*' |
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 createArrayOfObjects (len) { | |
let arr = [] | |
for (let i = 0; i < len; i++) { | |
arr.push({ | |
key: i | |
}); | |
} | |
return arr | |
} |
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 fadeIn(el, duration, callback) { | |
el.style.opacity = 0 | |
let last = +new Date() | |
function fade () { | |
el.style.opacity = +el.style.opacity + (+new Date() - last) / duration | |
last = +new Date() | |
if (+el.style.opacity < 1) { | |
(window.requestAnimationFrame && window.requestAnimationFrame(fade)) || setTimeout(fade, 250) | |
} else { | |
if (typeof callback === 'function') callback() |
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
const data = [ | |
{id: 0, parentId: 1}, | |
{id: 1, parentId: 1}, | |
{id: 2, parentId: 2}, | |
{id: 3, parentId: 2} | |
]; | |
const grouped = data.reduce((obj, node) => { | |
const key = node && node.parentId || node.id | |
obj[key] = obj[key] || [] |
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
const color = "rgb(0, 0, 0)" | |
const rgb = colour.match(/\d+/g) // rgb: [0: 0, 1: 0, 2: 0] | |
const getContrastColour = rgb => { | |
// http://www.w3.org/TR/AERT#color-contrast | |
const brightness = Math.round( | |
(parseInt(rgb[0], 10) * 299 + | |
parseInt(rgb[1], 10) * 587 + | |
parseInt(rgb[2], 10) * 114) / | |
1000 |
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
// jQuery dependency for cross-browser scroll (animate). | |
const scrollToInvalid = e => { | |
const navbarHeight = $(".navbar").height(); | |
const navbarOffset = navbarHeight + 30; | |
$(e.target).addClass("invalid"); | |
$('html, body').animate({scrollTop: $($(".invalid")[0]).offset().top - navbarOffset }, 0); | |
setTimeout(() => { | |
$(".invalid").removeClass("invalid"); |
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 custom(Drupal, $) { | |
Drupal.behaviors.customStickyHeader = { | |
attach(context) { | |
const header = document.getElementById(HEADER_ID); // Change HEADER_ID for valid selector. | |
const getHeaderHeight = () => header ? header.getBoundingClientRect().height : 0; | |
const setDisplaceLoggedIn = (event, offsets) => { | |
header.style.marginTop = `${offsets.top}px` || `0px`; | |
document.body.style.left = offsets.left; | |
document.body.style.paddingTop = `${offsets.top + getHeaderHeight()}px`; |
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
import * as THREE from "https://threejsfundamentals.org/threejs/resources/threejs/r125/build/three.module.js"; | |
import { OrbitControls } from "https://threejsfundamentals.org/threejs/resources/threejs/r125/examples/jsm/controls/OrbitControls.js"; | |
import { OBJLoader } from "https://threejsfundamentals.org/threejs/resources/threejs/r125/examples/jsm/loaders/OBJLoader.js"; | |
let camera, light, controls, scene, renderer; | |
init(); | |
animate(); | |
function init() { | |
scene = new THREE.Scene(); |
OlderNewer