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
if (matchMedia) { | |
const mq = window.matchMedia("(min-width: 800px)"); | |
mq.addListener(WidthChange); | |
WidthChange(mq); | |
} | |
// media query change | |
function WidthChange(mq) { | |
if (mq.matches) { | |
console.log( 'window width is at least 800px' ); |
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
# ---------------------------------------------------------------------- | |
# Password protect | |
# ---------------------------------------------------------------------- | |
AuthType Basic | |
AuthName "Password Protected Area" | |
AuthUserFile /dir/to/root/.htpasswd | |
Require valid-user |
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
######################################################################## | |
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2020 | |
# ---------------------------------------------------------------------- | |
# @Author: Andreas Hecht | |
# @Author URI: https://seoagentur-hamburg.com | |
# License: GNU General Public License v2 or later | |
# License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
######################################################################## | |
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
$( 'body' ).bind( 'mousewheel', function( e ) { | |
if ( e.originalEvent.wheelDelta / 120 > 0 ) { | |
console.log( 'Scrolling up' ); | |
} | |
else { | |
console.log( 'Scrolling down' ); | |
} | |
} ); |
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
/************************************************************** | |
* Scroll to ID (hash links) | |
**************************************************************/ | |
function fnScrollToID( oEvent ) { | |
// Prevent default anchor behaviour | |
oEvent.preventDefault(); | |
// Get offset value (optional) |
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
/************************************************************** | |
* Browser detection and output | |
**************************************************************/ | |
function fnShowBrowserVersion() { | |
var sDomainName = window.location.hostname; | |
// Restrict to non-production sites | |
if ( sDomainName.search( ".local" ) >= 1 || sDomainName.search( ".flywheelsites" ) >= 1 ) { |
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
scroll.on( 'call', ( value ) => { | |
if ( value === 'exampleNameOne' ) { | |
console.log( 'Example #1' ); | |
} | |
if ( value === 'exampleNameTwo' ) { | |
console.log( 'Example #1' ); | |
} |
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
/************************************ | |
* Include SVG file. | |
* @param string $sFilePath The path of the SVG file | |
* @param boolean $bReturn Return the output instead of echoing (optional) | |
************************************/ | |
function get_svg( $sFilePath = NULL, $bReturn = false ) { | |
$sFileContents = NULL; | |
$sSvgPath = THEME_DIR_FILEPATH . '/media/dist/img/' . $sFilePath . '.svg'; |
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
/************************************ | |
* Include Imgix image | |
* @param array $aImageScope The image settings | |
* @param array $aClasses Apply classes to the image (optional) | |
* Sandbox: https://sandbox.imgix.com/ | |
* API Reference: https://docs.imgix.com/apis/rendering | |
* Notes: | |
- Do not include `dpr` param in `settings`, instead set a maximum DPR support in `max_dpr` parameter. |
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
/*************** | |
* Includes the page builder file | |
* @param string $sFilePath The builder to include | |
* @param string $sFieldName ACF field name | |
* @param array $aScopeVariables An array of variables to make available in the component | |
***************/ | |
function get_builder( $sFilePath, $sFieldName = 'blocks', $aScopeVariables = [] ) { | |
ob_start(); |