36 lines
1.4 KiB
PHP
36 lines
1.4 KiB
PHP
<?php
|
|
/**
|
|
* Template for the Wheel of Fortune shortcode.
|
|
*
|
|
* This template is included from the shortcode function and has access to:
|
|
* @var int $wheel_id
|
|
* @var array $prizes
|
|
* @var int $spins_left
|
|
*/
|
|
if (!defined('ABSPATH')) exit;
|
|
?>
|
|
|
|
<div class="wheel-container">
|
|
<div class="wheel-wrapper">
|
|
<div class="wheel-svg">
|
|
<?php echo $this->generate_wheel_svg($prizes); ?>
|
|
</div>
|
|
<div class="wheel-pointer">
|
|
<!-- SVG za puščico je lahko tukaj ali v CSS kot background-image -->
|
|
<svg width="60" height="70" viewBox="0 0 60 70" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M30 70L58.286 17.5H1.714L30 70Z" fill="#D9D9D9"/><path d="M30 70L58.286 17.5H1.714L30 70Z" stroke="black" stroke-width="2"/><circle cx="30" cy="15" r="15" fill="#C4C4C4" stroke="black" stroke-width="2"/></svg>
|
|
</div>
|
|
<div class="wheel-button-container">
|
|
<button class="wheel-button" <?php echo ($spins_left <= 0) ? 'disabled' : ''; ?>>
|
|
<?php echo ($spins_left > 0) ? esc_html($l10n['spin_button']) : esc_html($l10n['no_spins_left']); ?>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="wheel-info">
|
|
<div class="wheel-spins-counter">
|
|
<?php _e('Spins left:', 'wheel-of-fortune'); ?> <span><?php echo esc_html($spins_left); ?></span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="wheel-result" style="display: none;"></div>
|
|
</div>
|