This file contains 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
/** | |
* Focus field on page edit screen if hash contains "field=fieldName", | |
* or focus previously edited field using sessionStorage. | |
* Eg. /admin/page/edit/?id=1051#focus=title | |
*/ | |
// need to set before document.ready() | |
var focusFieldNameFromHash = getFocusFieldNameFromHash(); | |
This file contains 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
<div class="container" id="top"> | |
<h1>Pure CSS scroll-to-top</h1> | |
<div class="intro"> | |
<p> | |
A CSS-only solution to reveal a scroll-to-top link on scrolling down the page + animated scroll back to top. | |
</p> |
This file contains 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 loadAsset(path, callback, o) { | |
var selector = getUrlParameter('selector', path).replace(/['"]+/g, '').trim(), | |
async = getUrlParameter('async', path) === 'true', | |
version = getUrlParameter('v', path), | |
assetType = 'js', | |
assetTag = 'script', | |
assetSrc = 'src', | |
needAsset = true; |
This file contains 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
lightGallery(document.body, { | |
selector: '[data-editlink]', | |
iframeMaxWidth: '95%', | |
preload: false, | |
controls: false, | |
closable: true, | |
download: false, | |
counter: false | |
}); |
This file contains 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
@mixin fill($offset: 0) { | |
// get a list with 4 numbers | |
@if type_of($offset) == 'number' { | |
$offset: ($offset $offset $offset $offset); | |
} @else if type_of($offset) == 'list' { | |
@if length($offset) == 2 { | |
$offset: join($offset, $offset); | |
} @else if length($offset) == 3 { |
This file contains 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
/* Usage | |
pass columns list or column number and optionally gutter and padding | |
columns list: 1 2 1 => 4 columns altogether: | |
col 1/4 (25%), then col 2/4 (50%) and finally 1/4 (25%) | |
@include _fg_grid(1 2 1); | |
@include _fg_grid(1 2, 32, 24); | |
@include _fg_grid(1 2, $gutter: 32, $padding: 24); | |
if a number is passed instead of a list the mixin is equivalent to _fg() mixin | |
*/ | |
@mixin _fg_grid($colList, $gutter: $_fg_gutter, $padding: $_fg_padding) { |
This file contains 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
/** | |
Smooth scroll to element | |
gotoByScroll({ | |
target: $(targetID), | |
speed: 700, | |
vOffset: 0, | |
easing: "easeInOutQuad", | |
onStart: function (trg) { | |
// your function... |
This file contains 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
/* | |
* add extra Uikit grid sizes | |
* | |
* usage: | |
* set custom breakpoint (1480px) and name ("xlarge-x") | |
* @media (min-width: 1480px) { | |
* .add-grid-sizes(xlarge-x); | |
* } | |
*/ |