Skip to content

Instantly share code, notes, and snippets.

Roland Toth Pal rolandtoth

Block or report user

Report or block rolandtoth

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rolandtoth
rolandtoth / pwFocusField.js
Created Nov 3, 2018
Focus field if hash contains a field name, or focus previously edited field (ProcessWire admin)
View pwFocusField.js
/**
* 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();
@rolandtoth
rolandtoth / index.html
Created Apr 19, 2018
Pure CSS scroll-to-top
View index.html
<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>
@rolandtoth
rolandtoth / loadAsset.js
Created Oct 26, 2017
loadAsset.js CSS/Js loader
View loadAsset.js
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;
View TemplateLatteReplace-editlink-lightbox.js
View _mixins.scss
@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 {
@rolandtoth
rolandtoth / _fg_grid_mixin.scss
Last active Jan 27, 2017
simplest-flexbox-grid _fg_grid() mixin
View _fg_grid_mixin.scss
/* 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) {
View gotoByScroll.js
/**
Smooth scroll to element
gotoByScroll({
target: $(targetID),
speed: 700,
vOffset: 0,
easing: "easeInOutQuad",
onStart: function (trg) {
// your function...
@rolandtoth
rolandtoth / uikit-extra-grid-sizes-mixin
Last active Aug 29, 2015
add extra Uikit grid sizes
View uikit-extra-grid-sizes-mixin
/*
* add extra Uikit grid sizes
*
* usage:
* set custom breakpoint (1480px) and name ("xlarge-x")
* @media (min-width: 1480px) {
* .add-grid-sizes(xlarge-x);
* }
*/
You can’t perform that action at this time.