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> | |
<style> | |
body { | |
margin: 0; | |
padding: 0; | |
} | |
.nav { | |
position: fixed; | |
background: #FFF; |
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
const myBtnSelector = '.wp-block-button__link' | |
const initFancyButtons = () => { | |
$(myBtnSelector).prepend('<span class="circle"></span>') | |
$(myBtnSelector).each( function() { | |
const $circle = $(this).find('.circle') | |
$(this).on('mouseenter tap', function( evt ) { | |
const $target = $(this) | |
const x = evt.clientX - $target.offset().left | |
const y = evt.clientY - $target.offset().top |
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
//https://davidwalsh.name/javascript-debounce-function | |
function debounce(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { | |
timeout = null; | |
if (!immediate) func.apply(context, args); | |
}; | |
var callNow = immediate && !timeout; |
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
// The below JSON object is an example of all the necessary information | |
// for adding a location to the tour map. This specific example can be | |
// found in the live code at lines 845 - 880. I have annotated this object | |
// to explain what each property does. | |
// If you need to add an entirely new location to the map, follow these instructions: | |
// 1. Highlight & copy the below JSON object | |
// 2. In the code (index.html), find the last JSON location, currently located at line 1240 | |
// 3. Place your cursor after the "}," and hit Enter, then paste in the new JSON object | |
// 4. Edit the JSON object as needed |