<?php
$enable = $this->getExtensionenable();
if ($enable) {
    $imghtml = $text = $img = $path = '';

    $bgclr = $this->getBtnbackgroundcolor();
    $textclr = $this->getBtntextcolor();
    $display = $this->getDisplayoptions();
    $text = $this->getBtntext();
    $img = $this->getBtnimage();
    $position = $this->getPosition();
    if ($img != '') {
        $path = $this->getBaseUrl() . 'pub/media/scrolltotop/' . $img;
        $imghtml = '<img class="scroll_img" src="' . $path . '" alt="top" />';
    }
    ?>
    <div id="scroll-to-top">
        <a class="scrollup" href="#" title="Scroll to Top" style="<?php if($position == 1) { ?> right:10px; <?php } else { ?> left:10px; <?php } ?>color:<?php echo $textclr; ?> !important; background-color: <?php echo $bgclr; ?>; border-color: <?php echo $bgclr; ?>; ">
            <?php
            if ($display == 2 || $display == 3) {
                echo $imghtml;
            }
            ?>
            <?php if ($display == 1 || $display == 3) { ?>
            <span style="<?php if($display == 3) { ?> padding: 0 0 5px;display: block; <?php } else { ?> float: left;padding: 10px 0;text-align: center;width: 100%; <?php } ?>"><?php echo $text; ?></span>
            <?php } ?>
        </a>
    </div>
    <?php
}
?>
<style>
    .scrollup:hover {
        opacity: 0.7;
    }
</style>
