Selector tema off. Correccion menus. Traduccions.

This commit is contained in:
Laegnur 2022-03-14 14:56:35 +01:00
parent 8fc39ad438
commit 620f390e20
21 changed files with 1775 additions and 262 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,15 @@
{
"file": "site\/templates\/_foot.php",
"textdomain": "site--templates--_foot-php",
"translations": {
"0c7c073ba4d9912cd6a408247a71d95a": {
"text": "Pie"
},
"d63d94f43418f66bd27ee27a62ec88ef": {
"text": "Todos los derechos reservados"
},
"4e72c9aec0195278fac9b0abfa52bc45": {
"text": "Dise\u00f1ado y desarrollado por"
}
}
}

View file

@ -0,0 +1,15 @@
{
"file": "site\/templates\/_head.php",
"textdomain": "site--templates--_head-php",
"translations": {
"7679c0bdbd87c1984bd611c24b3cd0cb": {
"text": "es"
},
"01bea08b9a838113ed66226778ce6108": {
"text": "Saltar al contenido"
},
"6772cbe29a38577eeabce0d6ca81817d": {
"text": "Men\u00fa"
}
}
}

View file

@ -0,0 +1,9 @@
{
"file": "site\/templates\/_main.php",
"textdomain": "site--templates--_main-php",
"translations": {
"f1dddc5e3960cacd0918485f6f60f96e": {
"text": "Contenido"
}
}
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,15 @@
{
"file": "site\/templates\/_foot.php",
"textdomain": "site--templates--_foot-php",
"translations": {
"0c7c073ba4d9912cd6a408247a71d95a": {
"text": "P\u00e9"
},
"d63d94f43418f66bd27ee27a62ec88ef": {
"text": "Todos os dereitos reservados"
},
"4e72c9aec0195278fac9b0abfa52bc45": {
"text": "Dese\u00f1ada e desenvolvida por"
}
}
}

View file

@ -0,0 +1,15 @@
{
"file": "site\/templates\/_head.php",
"textdomain": "site--templates--_head-php",
"translations": {
"7679c0bdbd87c1984bd611c24b3cd0cb": {
"text": "gl"
},
"01bea08b9a838113ed66226778ce6108": {
"text": "Ir ao contido"
},
"6772cbe29a38577eeabce0d6ca81817d": {
"text": "Men\u00fa"
}
}
}

View file

@ -0,0 +1,9 @@
{
"file": "site\/templates\/_main.php",
"textdomain": "site--templates--_main-php",
"translations": {
"f1dddc5e3960cacd0918485f6f60f96e": {
"text": "Contido"
}
}
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,15 @@
{
"file": "site\/templates\/_foot.php",
"textdomain": "site--templates--_foot-php",
"translations": {
"0c7c073ba4d9912cd6a408247a71d95a": {
"text": "Footer"
},
"d63d94f43418f66bd27ee27a62ec88ef": {
"text": "All rights reserved"
},
"4e72c9aec0195278fac9b0abfa52bc45": {
"text": "Designed and Developed by"
}
}
}

View file

@ -0,0 +1,15 @@
{
"file": "site\/templates\/_head.php",
"textdomain": "site--templates--_head-php",
"translations": {
"7679c0bdbd87c1984bd611c24b3cd0cb": {
"text": "en"
},
"01bea08b9a838113ed66226778ce6108": {
"text": "Skip to content"
},
"6772cbe29a38577eeabce0d6ca81817d": {
"text": "Menu"
}
}
}

View file

@ -0,0 +1,9 @@
{
"file": "site\/templates\/_main.php",
"textdomain": "site--templates--_main-php",
"translations": {
"f1dddc5e3960cacd0918485f6f60f96e": {
"text": "Content"
}
}
}

View file

@ -1,5 +1,6 @@
<?php namespace ProcessWire; ?>
<footer id="pe">
<h2 class="visually-hidden"><?php echo _x('Footer', 'Page footer');?></h2>
<div class="contedor">
<p>&copy;2022 <?php echo $configuracion['nome_sitio']
. ' ' . $configuracion['descripcion_sitio']; ?>.</p>

View file

@ -1,13 +1,4 @@
<?php namespace ProcessWire;
if(!empty($_COOKIE['tema']))
{
$tema = $_COOKIE['tema'];
}
else
{
$tema = 'light.css';
}
?><!DOCTYPE html>
<?php namespace ProcessWire;?><!DOCTYPE html>
<html lang="<?php echo _x('en', 'HTML language code'); ?>">
<head>
<title><?php echo $titulo; ?></title>
@ -24,7 +15,7 @@ else
<link rel="alternate" hreflang="<?php echo $inicio->getLanguageValue($idioma, 'name'); ?>" href="<?php echo $page->localHttpUrl($idioma); ?>" />
<?php endforeach; ?>
</head>
<body class="<?php echo $tema; ?>">
<body>
<a href="#contido" class="visually-hidden element-focusable bypass-to-main"><?php echo _x('Skip to content', 'bypass'); ?></a>
<header id="cabeceira">
<div class="contedor">
@ -40,8 +31,7 @@ else
</div>
<nav id="menu">
<h2 class="visually-hidden"><?php echo _x('Menu', 'Navigation menu');?></h2>
<div id="axustes">
<ul id="idiomas" class="contenedor columna separado fin">
<ul id="idiomas" class="contenedor columna separado fin">
<?php
foreach($languages as $idioma)
{
@ -50,34 +40,15 @@ foreach($languages as $idioma)
continue;
}
?>
<li <?php echo $idioma->id == $user->language->id ? 'class="activo"' : ''; ?>>
<li <?php echo $idioma->id == $user->language->id ? 'class="activo"' : ''; ?>>
<?php
$url = $page->localUrl($idioma);
$hreflang = $inicio->getLanguageValue($idioma, 'name');
?>
<a title="<?php echo $idioma->title; ?>" hreflang="<?php echo $hreflang;?>" href="<?php echo $url; ?>"><?php echo $hreflang; ?></a>
</li>
<a title="<?php echo $idioma->title; ?>" hreflang="<?php echo $hreflang;?>" href="<?php echo $url; ?>"><?php echo $hreflang; ?></a>
</li>
<?php } ?>
</ul>
<div class="tema">
<label for='selector_tema'>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="icono_dia" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<g id="sol">
<g>
<path style="fill-rule:evenodd;clip-rule:evenodd;" d="M6,17.5C6,16.672,5.328,16,4.5,16h-3C0.672,16,0,16.672,0,17.5 S0.672,19,1.5,19h3C5.328,19,6,18.328,6,17.5z M7.5,26c-0.414,0-0.789,0.168-1.061,0.439l-2,2C4.168,28.711,4,29.086,4,29.5 C4,30.328,4.671,31,5.5,31c0.414,0,0.789-0.168,1.06-0.44l2-2C8.832,28.289,9,27.914,9,27.5C9,26.672,8.329,26,7.5,26z M17.5,6 C18.329,6,19,5.328,19,4.5v-3C19,0.672,18.329,0,17.5,0S16,0.672,16,1.5v3C16,5.328,16.671,6,17.5,6z M27.5,9 c0.414,0,0.789-0.168,1.06-0.439l2-2C30.832,6.289,31,5.914,31,5.5C31,4.672,30.329,4,29.5,4c-0.414,0-0.789,0.168-1.061,0.44 l-2,2C26.168,6.711,26,7.086,26,7.5C26,8.328,26.671,9,27.5,9z M6.439,8.561C6.711,8.832,7.086,9,7.5,9C8.328,9,9,8.328,9,7.5 c0-0.414-0.168-0.789-0.439-1.061l-2-2C6.289,4.168,5.914,4,5.5,4C4.672,4,4,4.672,4,5.5c0,0.414,0.168,0.789,0.439,1.06 L6.439,8.561z M33.5,16h-3c-0.828,0-1.5,0.672-1.5,1.5s0.672,1.5,1.5,1.5h3c0.828,0,1.5-0.672,1.5-1.5S34.328,16,33.5,16z M28.561,26.439C28.289,26.168,27.914,26,27.5,26c-0.828,0-1.5,0.672-1.5,1.5c0,0.414,0.168,0.789,0.439,1.06l2,2 C28.711,30.832,29.086,31,29.5,31c0.828,0,1.5-0.672,1.5-1.5c0-0.414-0.168-0.789-0.439-1.061L28.561,26.439z M17.5,29 c-0.829,0-1.5,0.672-1.5,1.5v3c0,0.828,0.671,1.5,1.5,1.5s1.5-0.672,1.5-1.5v-3C19,29.672,18.329,29,17.5,29z M17.5,7 C11.71,7,7,11.71,7,17.5S11.71,28,17.5,28S28,23.29,28,17.5S23.29,7,17.5,7z M17.5,25c-4.136,0-7.5-3.364-7.5-7.5 c0-4.136,3.364-7.5,7.5-7.5c4.136,0,7.5,3.364,7.5,7.5C25,21.636,21.636,25,17.5,25z" />
</g>
</g>
</svg>
</label>
<input class='toggle' id='selector_tema' type='checkbox'>
<label class='toggle-button' for='selector_tema'></label>
<label for='selector_tema'>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="icono_noche" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<path d="M96.76,66.458c-0.853-0.852-2.15-1.064-3.23-0.534c-6.063,2.991-12.858,4.571-19.655,4.571 C62.022,70.495,50.88,65.88,42.5,57.5C29.043,44.043,25.658,23.536,34.076,6.47c0.532-1.08,0.318-2.379-0.534-3.23 c-0.851-0.852-2.15-1.064-3.23-0.534c-4.918,2.427-9.375,5.619-13.246,9.491c-9.447,9.447-14.65,22.008-14.65,35.369 c0,13.36,5.203,25.921,14.65,35.368s22.008,14.65,35.368,14.65c13.361,0,25.921-5.203,35.369-14.65 c3.872-3.871,7.064-8.328,9.491-13.246C97.826,68.608,97.611,67.309,96.76,66.458z" />
</svg>
</label>
</div>
</div>
</ul>
<?php echo $menu; ?>
</nav>
</div>

View file

@ -1,13 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><?php echo $page->title; ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/main.css" />
</head>
<body>
<h1><?php echo $page->title; ?></h1>
<?php if($page->editable()) echo "<p><a href='$page->editURL'>Edit</a></p>"; ?>
</body>
</html>

13
site/templates/blog.php Normal file
View file

@ -0,0 +1,13 @@
<?php namespace ProcessWire;
$mantemento = $inicio->mantemento;
if($mantemento && !$user->isLoggedin())
{
$session->redirect('/praiadeseselle');
}
else
{
$menu = renderMenu($inicio->and($inicio->children), 0, 'paxinas');
$contido = '';
}

View file

@ -0,0 +1,15 @@
<?php namespace ProcessWire;
$mantemento = $inicio->mantemento;
if($mantemento && !$user->isLoggedin())
{
$session->redirect('/praiadeseselle');
}
else
{
$menu = renderMenu($inicio->and($inicio->children), 0, 'paxinas');
$contido = '';
$contido .= '<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d683.7895035822396!2d-8.223894611883049!3d43.43175437259117!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0xd2e77df3b9b18d5%3A0x80036ce3d85c27cf!2sLugar%20de%20Sesella%2C%2034%2C%2015623%20Ares%2C%20La%20Coru%C3%B1a!5e1!3m2!1ses!2ses!4v1647252009787!5m2!1ses!2ses" style="border:0;" allowfullscreen="" loading="lazy"></iframe>';
}

View file

@ -6,6 +6,11 @@
:root
{
font-size: 16px;
--color_principal: 255, 255, 255;
--color_realce: 43, 44, 38;
--color-pe: 43, 44, 38;
--texto_realce: 189, 186, 178;
}
body
@ -24,22 +29,6 @@ body
background-color: rgb(var(--color_principal));
}
body.light
{
--color_principal: 255, 255, 255;
--color_realce: 43, 44, 38;
--color-pe: 43, 44, 38;
--texto_realce: 189, 186, 178;
}
body.dark
{
--color_principal: 43, 44, 38;
--color_realce: 255, 255, 255;
--color-pe: 24, 24, 18;
--texto_realce: 189, 186, 178;
}
h1, h2, h3, h4, h5, h6
{
margin-top: 0;
@ -194,12 +183,6 @@ nav#menu a
color: rgb(var(--color_realce));
}
div#axustes
{
display: flex;
flex-direction: column;
}
ul#idiomas
{
display: flex;
@ -309,105 +292,6 @@ header#cabeceira div.contedor
justify-content: center;
}
div.tema
{
display: flex;
flex-direction: row;
justify-content: center;
margin-top: 20px;
}
.toggle
{
display: none;
}
.toggle::selection,
.toggle:after::selection,
.toggle:before::selection,
.toggle *::selection,
.toggle *:after::selection,
.toggle *:before::selection,
.toggle + .toggle-button::selection
{
background: none;
}
.toggle + .toggle-button
{
display: inline-block;
position: relative;
width: 4em;
height: 2em;
padding: 2px;
border: 2px solid rgb(var(--color_realce));
border-radius: 2em;
outline: 0;
cursor: pointer;
user-select: none;
transition: all .2s ease;
}
.toggle + .toggle-button:after,
.toggle + .toggle-button:before
{
display: block;
position: relative;
width: 50%;
height: 100%;
content: "";
}
.toggle + .toggle-button:after
{
left: 0;
border-radius: 1em;
background: rgba(var(--color_realce, 0.27));
content: "";
transition: all .2s ease;
}
.toggle + .toggle-button:before
{
display: none;
}
.toggle:checked + .toggle-button:after
{
left: 50%;
}
#icono_dia, #icono_noche
{
position: relative;
top: -3px;
width: 32px;
height: 32px;
margin: 0 7px;
cursor: pointer;
fill: rgb(var(--color_realce));
}
main#contido
{
flex: 1 0 auto;
@ -504,7 +388,57 @@ footer#pe a
color: #fff;
}
@media (min-width: 48rem)
@media (max-height: 767px) and (orientation: landscape)
{
nav#menu
{
height: 50vh;
width: 100%;
border-right: none;
border-bottom: 2px solid rgb(var(--color_realce));
transform: translateX(0%);
transform: translateY(-100%);
transition: transform 0.5s;
}
ul#idiomas
{
margin-top: 20px;
margin-left: 70px;
}
ul#paxinas
{
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
gap: 20px;
}
ul#paxinas li
{
border-left: 0;
}
ul#paxinas li:hover, ul#paxinas li.activo
{
border-left: 0;
}
ul#paxinas li a
{
padding: 0;
}
ul#paxinas li:hover a, ul#paxinas li.activo a
{
text-decoration: underline;
}
}
@media (min-width: 1024px)
{
header#cabeceira div.contedor
{
@ -514,23 +448,17 @@ footer#pe a
justify-content: space-between;
}
header#cabeceira div.contedor > *
{
width: 50%;
}
header#cabeceira input#interruptor,
header#cabeceira .interruptor
{
display: none;
}
div#axustes
{
flex-direction: row;
gap: 20px;
}
div.tema
{
margin-top: 5px;
}
nav#menu
{
position: initial;
@ -550,6 +478,10 @@ footer#pe a
ul#idiomas
{
justify-content: flex-end;
width: 100%;
margin: 0;
}
@ -557,6 +489,12 @@ footer#pe a
{
flex-direction: row;
justify-content: flex-end;
flex-wrap: wrap;
}
ul#paxinas li
{
border-left: 0;
}
ul#paxinas li:hover, ul#paxinas li.activo
@ -573,4 +511,12 @@ footer#pe a
{
max-width: 70.5rem;
}
}
@media (min-width: 1025px)
{
header#cabeceira div.contedor > *
{
width: unset;
}
}

View file

@ -1,80 +0,0 @@
const selector_tema = document.querySelector("#selector_tema");
const preferencia_escura = window.matchMedia("(prefers-color-scheme: dark)");
function getCookie()
{
let name = "tema=";
let spli = document.cookie.split(';');
for(var j = 0; j < spli.length; j++)
{
let char = spli[j];
while (char.charAt(0) == ' ')
{
char = char.substring(1);
}
if(char.indexOf(name) == 0)
{
return char.substring(name.length, char.length);
}
}
return "";
}
function checkCookie()
{
var tema = getCookie();
if(tema != "")
{
switch(tema)
{
case 'dark':
selector_tema.checked = true;
document.body.classList.add("dark");
document.body.classList.remove("light");
break;
case 'light':
document.body.classList.add("light");
document.body.classList.remove("dark");
break;
}
document.cookie = "tema=" + tema + ";samesite=lax;path=/";
}
else
{
if(preferencia_escura.matches)
{
selector_tema.checked = true;
document.body.classList.add("dark");
document.body.classList.remove("light");
document.cookie = "tema=dark;samesite=lax;path=/";
}
}
}
checkCookie();
selector_tema.addEventListener("change", function()
{
var tema = '';
switch(selector_tema.checked)
{
case true:
tema = 'dark';
document.body.classList.add("dark");
document.body.classList.remove("light");
break;
case false:
tema = 'light';
document.body.classList.add("light");
document.body.classList.remove("dark");
break;
}
document.cookie = "tema=" + tema + ";samesite=lax;path=/";
});

13
site/templates/pagina.php Normal file
View file

@ -0,0 +1,13 @@
<?php namespace ProcessWire;
$mantemento = $inicio->mantemento;
if($mantemento && !$user->isLoggedin())
{
$session->redirect('/praiadeseselle');
}
else
{
$menu = renderMenu($inicio->and($inicio->children), 0, 'paxinas');
$contido = $page->title;
}