Skip to content

Instantly share code, notes, and snippets.

@damiencarbery
Created September 21, 2017 15:24
Show Gist options
  • Save damiencarbery/cb82df65213f5b942d6e36a2767b0cb2 to your computer and use it in GitHub Desktop.
Save damiencarbery/cb82df65213f5b942d6e36a2767b0cb2 to your computer and use it in GitHub Desktop.
<?php
// Use scrollreveal from https://github.com/jlmakes/scrollreveal
add_action( 'wp_footer', 'afp_scrollreveal_init' );
function afp_scrollreveal_init() {
?>
<style>
.home .widget-wrap { visibility: visible; }
.site-inner .widget-wrap, .entry-content { visibility: hidden; }
</style>
<script>
window.sr = ScrollReveal( { origin: 'left', duration: 500, viewOffset: { top: 70, right: 0, bottom: 0, left: 0 } } );
//sr.reveal('.textwidget');
sr.reveal('.site-inner .widget-wrap');
sr.reveal('.entry-content', { viewFactor: 0.01 } );
</script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment