<?php

$primary_color = laniakea_option('primary_color', '#5f68dd');
$stickybar_top = laniakea_option('stickybar_top', '30%');

?>

<div class="sticky-preview">
    <div class="laniakea-stickybar" style="position:absolute;right:0px;top : <?php echo $stickybar_top; ?>%;">
        <div class="laniakea-stickybar-container">
            <ul>
                <?php for ($i = 1; $i < 4; $i++) : ?>
                    <?php
                    $slot_icon = laniakea_option('stickybar_slot' . $i . '_icon');
                    if ($slot_icon) :
                        $slot_title = laniakea_option('stickybar_slot' . $i . '_title');
                    ?>
                        <li style="margin-bottom:1px;list-style-type: none">
                            <a style="background-color:<?php echo $primary_color; ?>;color:white;padding:15px;display:block" title="<?php echo $slot_title ?>">
                                <span class="icon <?php echo $slot_icon; ?>" style="font-size:22px"></span>
                            </a>
                        </li>
                    <?php endif; ?>
                <?php endfor; ?>

            </ul>
        </div>
    </div>
</div>

<div class="field-group">
    <h3><label><?php laniakea_input('show_stickybar', 'checkbox'); ?> Mostra Sticky Bar</label></h3>
</div>

<div class="field-group">
    <h3>Aggancia a </h3>
    <select name="stickybar_side">
        <option value="right" <?php selected(laniakea_option('stickybar_side'), "right", true) ?>>Destra</option>
        <option value="left" <?php selected(laniakea_option('stickybar_side'), "left", true) ?>>Sinistra</option>
    </select>
</div>

<div class="field-group">
    <h3>Altezza %</h3>
    <?php laniakea_input('stickybar_top', 'number') ?>
</div>


<?php for ($i = 1; $i < 4; $i++) : ?>
    <h3>Slot <?php echo $i; ?></h3>
    <table>
        <tr>
            <th>Classe Icona</th>
            <td>
                <?php laniakea_input('stickybar_slot' . $i . '_icon', 'text'); ?>
                &nbsp;<i class="<?php echo laniakea_option('stickybar_slot' . $i . '_icon') ?>"></i>
            </td>
        </tr>
        <tr>
            <th>Link</th>
            <td>
                <?php laniakea_input('stickybar_slot' . $i . '_link', 'text'); ?>
            </td>
        </tr>
        <tr>
            <th>Titolo</th>
            <td>
                <?php laniakea_input('stickybar_slot' . $i . '_title', 'text'); ?>
            </td>
        </tr>
    </table>
<?php endfor; ?>

icone : <a target="_blank" href="https://fontawesome.com/v6/search">https://fontawesome.com/v6/search</a>