WowPress-Tailwind/theme/components/toggle-button.php

25 lines
1.2 KiB
PHP
Raw Normal View History

2024-04-16 15:25:22 +02:00
<?php
use WoWPress\Frontend\Icon;
?>
<div>
<label style="" for="tb_<?= $this->id ?>" class="w-full flex <?= $this->row ? 'flex-row gap-2' : 'flex-col' ?> items-center justify-center h-auto select-none cursor-pointer border py-3 px-6
font-bold border-<?=$this->color_no?> transition-colors duration-200 ease-in-out has-[:checked]:bg-<?=$this->color_yes?> has-[:checked]:text-black has-[:checked]:border-<?=$this->color_yes?> ">
2024-04-23 00:44:42 +02:00
<input type="<?= $this->type ?>" value="<?=$this->value?>" id="tb_<?= $this->id ?>" name="<?= $this->name ?>" class="peer group hidden" <?= $this->disabled ? 'disabled' : '' ?> <?= $this->checked ? 'checked' : '' ?> />
2024-04-16 15:25:22 +02:00
<div class="peer-checked:block hidden">
<?php
if ($this->icons) : ?>
<?= Icon::get($this->icon_yes) ?>
<?php else : ?>
Ja
<?php endif; ?>
</div>
<div class="peer-checked:hidden block">
<?php if ($this->icons) : ?>
<?= Icon::get($this->icon_no) ?>
<?php else : ?>
Nein
<?php endif; ?>
</div>
<?= $this->text ?>
</label>
</div>