-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c170cb
commit 37eb71d
Showing
25 changed files
with
360 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,27 +28,33 @@ | |
'web.language' => 'en-US', | ||
'web.name' => 'Web application basic', | ||
'web.params' => [ | ||
'app.languages.labels' => [ | ||
'de-DE' => 'German', | ||
'en-US' => 'English', | ||
'es-ES' => 'Spanish', | ||
'fr-FR' => 'French', | ||
'pt-BR' => 'Portuguese', | ||
'ru-RU' => 'Russian', | ||
'zh-CN' => 'Chinese', | ||
'app.localeurls.languages' => [ | ||
'de' => 'de-DE', | ||
'en' => 'en-US', | ||
'es' => 'es-ES', | ||
'fr' => 'fr-FR', | ||
'pt' => 'pt-BR', | ||
'ru' => 'ru-RU', | ||
'zh' => 'zh-CN', | ||
], | ||
'app.mailer.sender' => '[email protected]', | ||
'app.mailer.sender.name' => 'Web application basic', | ||
'app.menu.isguest' => [ | ||
[ | ||
'label' => 'Home', | ||
'link' => ['/site/index'], | ||
'order' => 0, | ||
'category' => 'app.basic', | ||
], | ||
[ | ||
'label' => 'About', | ||
'url' => ['/site/about'], | ||
'link' => ['/site/about'], | ||
'order' => 1, | ||
'category' => 'app.basic', | ||
], | ||
[ | ||
'label' => 'Contact', | ||
'url' => ['/contact/index'], | ||
'link' => ['/contact/index'], | ||
'order' => 2, | ||
'category' => 'app.basic', | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,42 @@ | ||
/*! | ||
* Color mode toggler for Bootstrap's docs (https://getbootstrap.com/) | ||
* Copyright 2011-2023 The Bootstrap Authors | ||
* Licensed under the Creative Commons Attribution 3.0 Unported License. | ||
*/ | ||
(() => { | ||
'use strict' | ||
|
||
const getStoredTheme = () => localStorage.getItem('theme') | ||
const setStoredTheme = theme => localStorage.setItem('theme', theme) | ||
|
||
const getPreferredTheme = () => { | ||
const storedTheme = getStoredTheme() | ||
if (storedTheme) { | ||
return storedTheme | ||
} | ||
|
||
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' | ||
} | ||
|
||
const setTheme = theme => { | ||
if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) { | ||
document.documentElement.setAttribute('data-bs-theme', 'dark') | ||
} else { | ||
document.documentElement.setAttribute('data-bs-theme', theme) | ||
} | ||
} | ||
|
||
setTheme(getPreferredTheme()) | ||
|
||
const showActiveTheme = (theme, focus = false) => { | ||
const themeSwitcher = document.querySelector('#toggle-theme') | ||
|
||
if (!themeSwitcher) { | ||
return | ||
} | ||
|
||
const themeSwitcherText = document.querySelector('#toggle-theme-text') | ||
const activeThemeIcon = document.querySelector('.theme-icon-active use') | ||
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`) | ||
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('.check'); | ||
activeCheckIcon.classList.remove('d-none'); | ||
|
||
document.querySelectorAll('[data-bs-theme-value]').forEach(element => { | ||
const checkIcon = element.querySelector('.check'); | ||
if (element === btnToActive) { | ||
checkIcon.classList.remove('d-none'); | ||
} else { | ||
checkIcon.classList.add('d-none'); | ||
} | ||
element.classList.remove('active') | ||
element.setAttribute('aria-pressed', 'false') | ||
}) | ||
|
||
btnToActive.classList.add('active') | ||
btnToActive.setAttribute('aria-pressed', 'true') | ||
activeThemeIcon.setAttribute('href', svgOfActiveBtn) | ||
const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})` | ||
themeSwitcher.setAttribute('aria-label', themeSwitcherLabel) | ||
|
||
if (focus) { | ||
themeSwitcher.focus() | ||
} | ||
} | ||
|
||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => { | ||
const storedTheme = getStoredTheme() | ||
if (storedTheme !== 'light' && storedTheme !== 'dark') { | ||
setTheme(getPreferredTheme()) | ||
} | ||
}) | ||
|
||
window.addEventListener('DOMContentLoaded', () => { | ||
showActiveTheme(getPreferredTheme()) | ||
|
||
document.querySelectorAll('[data-bs-theme-value]') | ||
.forEach(toggle => { | ||
toggle.addEventListener('click', () => { | ||
const theme = toggle.getAttribute('data-bs-theme-value') | ||
setStoredTheme(theme) | ||
setTheme(theme) | ||
showActiveTheme(theme, true) | ||
}) | ||
}) | ||
}) | ||
})() | ||
'use strict'; | ||
|
||
const getStoredTheme = () => localStorage.getItem('theme'); | ||
const setStoredTheme = theme => localStorage.setItem('theme', theme); | ||
|
||
const setTheme = theme => { | ||
document.documentElement.setAttribute('data-bs-theme', theme); | ||
}; | ||
|
||
const showActiveTheme = (theme, focus = false) => { | ||
const themeToggle = document.querySelector('#theme-toggle'); | ||
const moonIcon = themeToggle.querySelector('#theme-dark-icon'); | ||
const sunIcon = themeToggle.querySelector('#theme-light-icon'); | ||
|
||
if (!themeToggle || !moonIcon || !sunIcon) { | ||
return; | ||
} | ||
|
||
if (theme === 'dark') { | ||
moonIcon.classList.remove('d-none'); | ||
sunIcon.classList.add('d-none'); | ||
} else { | ||
moonIcon.classList.add('d-none'); | ||
sunIcon.classList.remove('d-none'); | ||
} | ||
}; | ||
|
||
window.addEventListener('DOMContentLoaded', () => { | ||
const storedTheme = getStoredTheme() || 'auto'; | ||
setTheme(storedTheme); | ||
showActiveTheme(storedTheme); | ||
|
||
document.getElementById('theme-toggle').addEventListener('click', () => { | ||
const currentTheme = getStoredTheme(); | ||
const newTheme = currentTheme === 'dark' ? 'light' : 'dark'; | ||
setStoredTheme(newTheme); | ||
setTheme(newTheme); | ||
showActiveTheme(newTheme); | ||
}); | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use UIAwesome\Html\{Graphic\Svg, Textual\A}; | ||
|
||
$linkIconDefinitions = [ | ||
'class()' => ['d-none d-sm-block d-md-block d-lg-block d-xl-block text-muted hover:text-dark text-decoration-none ms-3'], | ||
'rel()' => ['noopener'], | ||
'target()' => ['_blank'], | ||
]; | ||
|
||
$svgDefinitions = [ | ||
'fill()' => ['currentColor'], | ||
'height()' => ['32'], | ||
]; | ||
|
||
// Github icon | ||
echo A::widget($linkIconDefinitions) | ||
->class('md:block hidden') | ||
->content( | ||
Svg::widget($svgDefinitions) | ||
->filePath(Yii::getAlias('@npm/fortawesome--fontawesome-free/svgs/brands/github.svg')) | ||
) | ||
->href('https://github.com/yiisoft') | ||
->title('GitHub'); | ||
|
||
// Slack icon | ||
echo A::widget($linkIconDefinitions) | ||
->class('md:block hidden') | ||
->content( | ||
Svg::widget($svgDefinitions) | ||
->filePath(Yii::getAlias('@npm/fortawesome--fontawesome-free/svgs/brands//slack.svg')) | ||
) | ||
->href( | ||
'https://join.slack.com/t/yii/shared_invite/enQtMzQ4MDExMDcyNTk2LTc0NDQ2ZTZhNjkzZDgwYjE4YjZlNGQxZjFmZDBjZTU3NjViMDE4ZTMxNDRkZjVlNmM1ZTA1ODVmZGUwY2U3NDA' | ||
) | ||
->title('Slack'); | ||
|
||
// Facebook icon | ||
echo A::widget($linkIconDefinitions) | ||
->class('md:block hidden') | ||
->content( | ||
Svg::widget($svgDefinitions) | ||
->filePath(Yii::getAlias('@npm/fortawesome--fontawesome-free/svgs/brands//facebook.svg')) | ||
) | ||
->href('https://www.facebook.com/groups/yiitalk/') | ||
->title('Facebook'); | ||
|
||
// Twitter icon | ||
echo A::widget($linkIconDefinitions) | ||
->content( | ||
Svg::widget($svgDefinitions) | ||
->filePath(Yii::getAlias('@npm/fortawesome--fontawesome-free/svgs/brands//twitter.svg')) | ||
) | ||
->href('https://twitter.com/yiiframework') | ||
->title('Twitter'); | ||
|
||
// Telegram icon | ||
echo A::widget($linkIconDefinitions) | ||
->content( | ||
Svg::widget($svgDefinitions) | ||
->filePath(Yii::getAlias('@npm/fortawesome--fontawesome-free/svgs/brands//telegram.svg')) | ||
) | ||
->href('https://t.me/yii_framework_in_english') | ||
->title('Telegram'); |
Oops, something went wrong.