Skip to content

Commit

Permalink
More rework code.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Oct 10, 2023
1 parent a692cba commit 9d135c9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/Framework/resource/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
const svgOfActiveBtn = btnToActive.querySelector('svg use').getAttribute('href')

// Añade las siguientes líneas para mostrar el icono de verificación en el botón activo.
const activeCheckIcon = btnToActive.querySelector('.bi');
const activeCheckIcon = btnToActive.querySelector('.check');
activeCheckIcon.classList.remove('d-none');

document.querySelectorAll('[data-bs-theme-value]').forEach(element => {
const checkIcon = element.querySelector('.bi');
const checkIcon = element.querySelector('.check');
if (element === btnToActive) {
checkIcon.classList.remove('d-none');
} else {
Expand Down
24 changes: 15 additions & 9 deletions src/Framework/resource/layout/component/toggle_dark.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@
) ?>
<?= Icon::renderIcon('solid', 'sun', ['class' => 'me-2 fa-solid theme-icon']) ?>
Light
<?= Html::beginTag('svg', ['class' => 'bi ms-auto d-none', 'width' => '1em', 'height' => '1em']) ?>
<?= Html::tag('use', '', ['href' => '#check2']) ?>
<?= Html::endTag('svg') ?>
<?= Icon::renderIcon(
'solid',
'check',
['class' => 'check ms-auto d-none', 'width' => '1em', 'height' => '1em'],
) ?>
<?= Html::endTag('button') ?>
<?= Html::endTag('li') ?>
<?= Html::beginTag('li') ?>
Expand All @@ -53,9 +55,11 @@
) ?>
<?= Icon::renderIcon('solid', 'moon', ['class' => 'me-2 fa-solid theme-icon']) ?>
Dark
<?= Html::beginTag('svg', ['class' => 'bi ms-auto d-none', 'width' => '1em', 'height' => '1em']) ?>
<?= Html::tag('use', '', ['href' => '#check2']) ?>
<?= Html::endTag('svg') ?>
<?= Icon::renderIcon(
'solid',
'check',
['class' => 'check ms-auto d-none', 'width' => '1em', 'height' => '1em'],
) ?>
<?= Html::endTag('button') ?>
<?= Html::endTag('li') ?>
<?= Html::beginTag('li') ?>
Expand All @@ -69,9 +73,11 @@
) ?>
<?= Icon::renderIcon('solid', 'circle-half-stroke', ['class' => 'me-2 fa-solid theme-icon']) ?>
Auto
<?= Html::beginTag('svg', ['class' => 'bi ms-auto d-none', 'width' => '1em', 'height' => '1em']) ?>
<?= Html::tag('use', '', ['href' => '#check2']) ?>
<?= Html::endTag('svg') ?>
<?= Icon::renderIcon(
'solid',
'check',
['class' => 'check ms-auto d-none', 'width' => '1em', 'height' => '1em'],
) ?>
<?= Html::endTag('button') ?>
<?= Html::endTag('li') ?>
<?= Html::endTag('ul') ?>
Expand Down
5 changes: 0 additions & 5 deletions src/Framework/resource/layout/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
<?= $this->render('head') ?>
<?= Html::beginTag('body') ?>
<?php $this->beginBody() ?>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="check2" viewBox="0 0 16 16">
<path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"/>
</symbol>
</svg>
<?= Html::beginTag('wrapper', ['class' => 'd-flex flex-column']) ?>
<?= $this->render('component/menu') ?>
<?= Html::beginTag(
Expand Down

0 comments on commit 9d135c9

Please sign in to comment.