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
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" /> | |
<title>AR Quick Look Example</title> | |
<script> | |
/* from Apple's AR Quick Look Gallery */ | |
(function () { | |
var isRelAR = false; | |
var a = document.createElement('a'); | |
if (a.relList.supports('ar')) { |
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
return "<img width='$width' height='$height' src='https://api.mapbox.com/styles/v1/mapbox/streets-v10/static/$lnglat,9.67,0.00,0.00/{$width}x{$height}@2x?access_token=$mapboxkey'>"; |
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
// IntersectionObserver | |
// Used with Rubious plugin and lazy load images | |
var images = document.querySelectorAll('[data-lazy-src]'); | |
var config = { | |
rootMargin: '0px 0px 400px 0px', | |
threshold: 0 }; | |
var loaded = 0; |
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
// Include intersection-observer-polyfill.js for older browsers | |
// https://github.com/w3c/IntersectionObserver/tree/master/polyfill | |
// JS: | |
// Get scroll direction | |
var lastScrollTop = 0, delta = 5; | |
var lastScrollDirection = null; | |
$(window).scroll(function(event){ |
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
// Need to add "frontend" class to the site - this is to prevent this stuff happening on the WYSIWYG editor | |
html.frontend { | |
@media only screen and (min-width: 1920px) { // Correct size for large screens | |
font-size: 62.5%; | |
} | |
@media only screen and (max-width: 1289px) { // Slightly larger size for small screens | |
font-size: 0.6vw; | |
} |
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
// To easily view how a site looks when CSS Grid is not available, use this in the SASS file. | |
// First you need this variable: | |
$cssgrid: "(grid-template-rows:initial)"; | |
// Then you can uncomment the below to re-declare the variable and so disable the @supports for every browser: | |
// $cssgrid: "(display:no-css-grid-support)"; | |
// Wrap every usage of CSS Grid in this: | |
@supports(#{$cssgrid}) { |
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
// License: GPLv2+ | |
var el = wp.element.createElement, | |
registerBlockType = wp.blocks.registerBlockType, | |
ServerSideRender = wp.components.ServerSideRender, | |
TextControl = wp.components.TextControl, | |
InspectorControls = wp.editor.InspectorControls; | |
/* | |
* Here's where we register the block in JavaScript. |
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
<?php | |
/* ========================================================================== | |
Holiday Message Hooks | |
============================================================================= */ | |
if(function_exists('holiday_messages')) { | |
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
// PHP: | |
add_filter( 'gform_file_upload_markup', 'change_upload_markup', 10, 4 ); | |
function change_upload_markup( $file_upload_markup, $file_info, $form_id, $field_id ) { | |
return '<strong>' . esc_html( $file_info['uploaded_filename'] ) . "</strong > <img class='gform_delete' src='" . GFCommon::get_base_url() . "/images/delete.png' onclick='gformDeleteUploadedFile({$form_id}, {$id}, this);' />"; | |
} | |
// JS: |
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
<?php | |
/** | |
* Filters default image arguments for TSF. | |
* | |
* @param array $defaults The image defaults. | |
* @param array $args The image callback arguments. | |
*/ | |
add_filter( 'the_seo_framework_og_image_args', function( $defaults, $args = array() ) { |
NewerOlder