<?php
/**
 * Go to top link template
 *
 * @package Multi
 */

?>
<?php
$multimagazine_gotop_classes   = 'go-top';
$multimagazine_gotop_position  = get_theme_mod( 'multi_go_top_position', MULTIMAGAZINE_GO_TOP_POSITION );
$multimagazine_gotop_icon      = get_theme_mod( 'multi_go_top_icon', MULTIMAGAZINE_GO_TOP_ICON );
$multimagazine_show_label      = get_theme_mod( 'multi_go_top_show_label', MULTIMAGAZINE_GO_TOP_SHOW_LABEL );
$multimagazine_gotop_animation = get_theme_mod( 'multi_go_top_animation', MULTIMAGAZINE_GO_TOP_ANIMATION );

if ( empty( $multimagazine_gotop_position ) ) {
	$multimagazine_gotop_position = 'right';
}
$multimagazine_gotop_classes .= ' position-' . $multimagazine_gotop_position;
$multimagazine_gotop_classes .= ' animation-' . $multimagazine_gotop_animation;

if ( get_theme_mod( 'multi_go_top_show_mobile', MULTIMAGAZINE_GO_TOP_SHOW_MOBILE ) ) {
	$multimagazine_gotop_classes .= ' show-mobile';
}

if ( get_theme_mod( 'multi_go_top_show_tablet', MULTIMAGAZINE_GO_TOP_SHOW_TABLET ) ) {
	$multimagazine_gotop_classes .= ' show-tablet';
}

if ( get_theme_mod( 'multi_go_top_show_desktop', MULTIMAGAZINE_GO_TOP_SHOW_DESKTOP ) ) {
	$multimagazine_gotop_classes .= ' show-desktop';
}

if ( get_theme_mod( 'multi_go_top_show_up', MULTIMAGAZINE_GO_TOP_SHOW_UP ) ) {
	$multimagazine_gotop_classes .= ' show-up';
} else {
	$multimagazine_gotop_classes .= ' show-down';
}

?>
<a href="#top" class="<?php echo esc_attr( $multimagazine_gotop_classes ); ?>" title="<?php esc_attr_e( 'Top of page', 'multimagazine' ); ?>">
	<span class="go-top-content">
		<i class="m-icon <?php echo esc_attr( 'm-icon-' . $multimagazine_gotop_icon ); ?>" aria-hidden="true"></i>
		<?php if ( $multimagazine_show_label ) : ?>
		<span class="go-top-label"><?php esc_html_e( 'Top', 'multimagazine' ); ?></span>
		<?php else : ?>
		<span class="screen-reader-text"><?php esc_html_e( 'Top', 'multimagazine' ); ?></span>
		<?php endif; ?>
	</span>
</a>
