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
| <script> | |
| export default { | |
| props: ['offset', 'trigger'], | |
| methods: { | |
| checkPos() { | |
| let current_top = this.$el.getBoundingClientRect().top; | |
| if (current_top <= this.reveal_point) { |
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
| getPercentage(){ | |
| let wh = window.innerHeight, | |
| scroll = window.pageYOffset, | |
| height = this.$el.offsetHeight, | |
| top = this.$el.getBoundingClientRect().top + scroll; | |
| let distance = (scroll) - top; | |
| let percentage = distance / ((height - wh - 180) / 100); | |
| return Math.max(Math.min(Math.round(percentage), 100), 0); |
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
| <script> | |
| import { TweenMax, ScrollToPlugin } from 'gsap/all'; | |
| export default { | |
| props: ['offset'], | |
| name: 'ScrollTo', | |
| mounted(){ | |
| this.$el.addEventListener('click', this.scroll); |
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
| <?php | |
| $prev_id = get_adjacent_post(false, '', true)->ID; | |
| $previous_post_title = get_the_title( $prev_id ); | |
| $previous_post_url = get_permalink( $prev_id ); | |
| $next_id = get_adjacent_post(false, '', false)->ID; | |
| $next_post_title = get_the_title( $next_id ); | |
| $next_post_url = get_permalink( $next_id ); | |
| ?> | |
| <?php if ($prev_id !== $product->ID && $previous_post_url): ?> |
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
| /** | |
| * Add Join to search query | |
| * Part 1 of 3 part functions to add ACF fields to search page results | |
| * | |
| * @param $join | |
| * @return mixed | |
| */ | |
| function acf_search_join( $join ) { | |
| global $wpdb; | |
| if ( is_search() && is_main_query() ) { |
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
| function time_ago($time) { | |
| $time = isValidTimeStamp($time) ? $time : strtotime($time); | |
| $periods = array("second", "min", "hr", "d", "w", "m", "y", "decade"); | |
| $lengths = array("60","60","24","7","4.35","12","10"); | |
| $now = time(); | |
| $difference = $now - $time; | |
| $tense = "ago"; |
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
| // NoScroll https://github.com/davidtheclark/no-scroll | |
| (function(root) { | |
| var scrollbarSize; | |
| function getScrollbarSize() { | |
| if (typeof scrollbarSize !== 'undefined') return scrollbarSize; | |
| var doc = document.documentElement; | |
| var dummyScroller = document.createElement('div'); | |
| dummyScroller.setAttribute('style', 'width:99px;height:99px;' |
NewerOlder