<div class="phpbbad-slide-up">
	<div class="phpbbad-slide-up-center"><i class="phpbbad-slide-up-close icon fa-chevron-down fa-fw" title="{{ lang('HIDE_AD') }}"></i></div>
	{% include '@phpbb_ads/phpbb_ads_default.html' %}
</div>

<script>
	(function($, window, document) {
		'use strict';

		var $slider = $('.phpbbad-slide-up');

		$(window).on('scroll', function() {
			if ($(window).scrollTop() + $(window).height() >= $(document).height()) {
				// Display ad (slide it up)
				$slider.css({transform: 'translateY(0)'});
			} else {
				// Hide ad (slide it down)
				$slider.css({transform: 'translateY(100%)'});
			}
		});

		$('.phpbbad-slide-up-close').on('click', function() {
			// Hide ad (slide it down)
			$slider.css({transform: 'translateY(100%)'});
		});
	})(jQuery, window, document);
</script>
