Better style for the articles list.

This commit is contained in:
Sergiotarxz 2023-05-07 05:15:22 +02:00
parent 39bab6ebee
commit 81d6a50ce8
3 changed files with 411 additions and 282 deletions

View File

@ -68,17 +68,31 @@ body {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: wrap; } flex-wrap: wrap; }
body div.page-contents div.description div.articles img { body div.page-contents div.description div.articles div.image-container {
border: solid 1px black; } margin-left: 2.5%;
margin-top: 10px;
height: 95%;
width: 95%;
display: flex;
min-height: 130px;
justify-content: center;
align-items: center; }
body div.page-contents div.description div.articles div.image-container img {
max-height: 100%;
max-width: 100%;
min-width: 277px;
border: solid 1px black; }
body div.page-contents div.description div.articles a { body div.page-contents div.description div.articles a {
min-height: 90%;
width: 100%; width: 100%;
display: block; display: block;
text-decoration: none; text-decoration: none;
text-overflow: ellipsis; text-overflow: ellipsis;
margin-bottom: 10px; } margin-bottom: 30px; }
body div.page-contents div.description div.articles a article { body div.page-contents div.description div.articles a article {
word-wrap: break-word; word-wrap: break-word;
width: 90%; width: 90%;
height: 90%;
padding: 5%; padding: 5%;
padding-top: 1%; padding-top: 1%;
background: #f2eb8c; background: #f2eb8c;
@ -87,6 +101,13 @@ body {
border: 3px solid black; } border: 3px solid black; }
body div.page-contents div.description div.articles a article p, body div.page-contents div.description div.articles a article h4, body div.page-contents div.description div.articles a article h3, body div.page-contents div.description div.articles a article h2 { body div.page-contents div.description div.articles a article p, body div.page-contents div.description div.articles a article h4, body div.page-contents div.description div.articles a article h3, body div.page-contents div.description div.articles a article h2 {
margin: 0px; } margin: 0px; }
body div.page-contents div.description div.articles a article p {
font-size: 0.9rem; }
body div.page-contents div.description div.articles a article div.article-up-part {
height: 12em; }
body div.page-contents div.description div.articles a article div.article-down-part {
margin-top: 2em;
height: 9em; }
body div.page-contents div.description div.articles a article:hover { body div.page-contents div.description div.articles a article:hover {
background: blueviolet; background: blueviolet;
color: #f2eb8c; } color: #f2eb8c; }
@ -201,9 +222,16 @@ body {
body div.page-contents nav.mobile-shortcuts { body div.page-contents nav.mobile-shortcuts {
display: none; } } display: none; } }
@media (min-width: 1222px) { @media (min-width: 694px) {
body div.page-contents div.description { body div.page-contents div.description {
margin-top: auto; } margin-top: auto; }
body div.page-contents div.description div.articles a { body div.page-contents div.description div.articles a {
width: 45%; width: 45%;
margin-left: 5%; } } margin-left: 5%; } }
@media (min-width: 1333px) {
body div.page-contents div.description {
margin-top: auto; }
body div.page-contents div.description div.articles a {
width: 30%;
margin-left: 3%; } }

View File

@ -10,295 +10,391 @@ $accent-secondary: #fde68f;
$primary-secondary: #590e11; $primary-secondary: #590e11;
html { html {
height: 100%; height: 100%;
} }
body { body {
p,h1,h2,h3,h4,a { p, h1, h2, h3, h4, a {
font-family: 'arial'; font-family: 'arial';
} }
margin: 0;
padding: 0; margin: 0;
overflow: hidden; padding: 0;
min-height: 100%; overflow: hidden;
width: 100%; min-height: 100%;
height: 100%; width: 100%;
div.site-wrapper { height: 100%;
display: table;
width: 100%; div.site-wrapper {
height: 100%; /* For at least Firefox */ display: table;
min-height: 100%; width: 100%;
color: $color; height: 100%;
background: $background;
filter: blur(10px); /* For at least Firefox */
background-size: cover; min-height: 100%;
overflow: hidden; color: $color;
} background: $background;
div.page-contents { filter: blur(10px);
position: absolute; background-size: cover;
position: fixed; overflow: hidden;
overflow-y: scroll; }
z-index: 2;
background: $background-page; div.page-contents {
color: $color-page; position: absolute;
top: 0%; position: fixed;
left: 0%; overflow-y: scroll;
height: 100%; z-index: 2;
div.child-categories-mobile a { background: $background-page;
padding-left: 2.5rem; color: $color-page;
top: 0%;
left: 0%;
height: 100%;
div.child-categories-mobile a {
padding-left: 2.5rem;
}
width: 100%;
img {
max-width: 100%;
margin-left: auto;
margin-right: auto;
display: block;
}
table {
color: $background_div;
background: $color_div;
border: 3px solid $background_div;
border-collapse: collapse;
width: 100%;
td, th {
font-size: 9px;
}
table-layout: fixed;
}
th, td {
border: 3px solid $background_div;
border-collapse: collapse;
padding-right: 10px;
margin: 0;
}
div.description {
input {
display: block;
}
word-wrap: break-word;
div.suscribirse-rss {
img {
max-height: 300px;
} }
width: 100%; }
img {
max-width: 100%; padding: 1%;
margin-left: auto; margin-left: 3%;
margin-right: auto; margin-right: 3%;
display: block; margin-bottom: 1%;
} margin-top: 10%;
table {
color: $background_div; div.articles {
background: $color_div; display: flex;
border: 3px solid $background_div; flex-direction: row;
border-collapse: collapse; flex-wrap: wrap;
width: 100%;
td,th { div.image-container {
font-size: 9px; margin-left: 2.5%;
margin-top: 10px;
height: 95%;
width: 95%;
display: flex;
min-height: 130px;
justify-content: center;
align-items: center;
img {
max-height: 100%;
max-width: 100%;
min-width: 277px;
border: solid 1px black;
} }
table-layout: fixed; }
}
th,td {
border: 3px solid $background_div;
border-collapse: collapse;
padding-right: 10px;
margin: 0;
}
div.description {
input {
display: block;
}
word-wrap: break-word;
div.suscribirse-rss {
img {
max-height: 300px;
}
}
padding: 1%;
margin-left: 3%;
margin-right: 3%;
margin-bottom: 1%;
margin-top: 10%;
div.articles {
display: flex;
flex-direction: row;
flex-wrap: wrap;
img {
border: solid 1px black;
}
a {
width: 100%;
display:block;
text-decoration: none;
text-overflow: ellipsis;
margin-bottom: 10px;
article {
word-wrap: break-word;
width: 90%;
p,h4,h3,h2 {
margin: 0px;
}
padding: 5%;;
padding-top: 1%;
background: $color_div;
color: $background_div;
box-shadow: 8px 8px 1px 0px #8ddfd6;
border: 3px solid black;
&:hover {
background: $background_div;
color: $color_div;
}
p.date {
text-align: right;
}
p.author {
text-align: right;
}
}
}
}
a.suscribe-category-rss {
background: $background_div;
width: 40px;
height: 40px;
padding: 10px;
border-radius: 5px;
display: inline-block;
img {
width: 40px;
height: 40px;
}
}
}
nav > a.menu-expand > img {
width: 30px;
height: 30px;
padding-top: 15px;
}
nav > a > img.index-image-menu {
vertical-align: middle;
width: 50px;
height: 50px;
padding-bottom: 10px;
}
nav.desktop {
display: none;
a {
vertical-align: middle;
background: $background_div;
}
}
nav {
overflow: auto;
display: block;
font-size: 25px;
margin: 0px;
a.go-to-index img {
margin-top: 5%;
}
a {
padding-left: 10px;
padding-right: 10px;
height: 100%;
text-decoration: none;
color: $color_div;
margin: 0;
&:hover {
background: $color_div;
color: $background_div;
}
&.selected {
background: $color_div;
color: $background_div;
}
}
a.menu-expand {
padding-bottom: 9px;
.open-menu-icon-hover {
display: none;
}
&:hover {
.open-menu-icon-hover {
display: block;
}
.open-menu-icon {
display: none;
}
}
}
}
nav.mobile-shortcuts { a {
position: fixed; min-height: 90%;
display: flex; width: 100%;
width: 100%; display: block;
background: $background_div; text-decoration: none;
height: 60px; text-overflow: ellipsis;
a { margin-bottom: 30px;
height: 100%;
width: (100% / 6);
}
div {
width: (100% * 4 / 6);
}
}
nav.mobile-foldable {
display: none;
background: $background_div;
color: $color_div;
a {
//background: $color_div;
//color: $background_div;
display: block;
}
}
nav.mobile-foldable.show {
display: block;
}
h1 { article {
text-align: center; word-wrap: break-word;
} width: 90%;
height: 90%;
div.footer { p, h4, h3, h2 {
p,h1,h2,h3,h4,a { margin: 0px;
font-size: initial; }
} p {
a.suscribe-category-rss { font-size: 0.9rem;
padding: 7px; }
}
a.suscribe-category-rss,a.suscribe-category-rss > img {
width: 20px;
height: 20px;
}
}
}
div.article-up-part {
height: 12em;
}
div.article-down-part {
margin-top: 2em;
height: 9em;
}
padding: 5%;
padding-top: 1%;
background: $color_div;
color: $background_div;
box-shadow: 8px 8px 1px 0px #8ddfd6;
border: 3px solid black;
&:hover {
background: $background_div;
color: $color_div;
}
p.date {
text-align: right;
}
p.author {
text-align: right;
}
}
}
}
a.suscribe-category-rss {
background: $background_div;
width: 40px;
height: 40px;
padding: 10px;
border-radius: 5px;
display: inline-block;
img {
width: 40px;
height: 40px;
}
}
}
nav > a.menu-expand > img {
width: 30px;
height: 30px;
padding-top: 15px;
}
nav > a > img.index-image-menu {
vertical-align: middle;
width: 50px;
height: 50px;
padding-bottom: 10px;
}
nav.desktop {
display: none;
a {
vertical-align: middle;
background: $background_div;
}
}
nav {
overflow: auto;
display: block;
font-size: 25px;
margin: 0px;
a.go-to-index img {
margin-top: 5%;
}
a {
padding-left: 10px;
padding-right: 10px;
height: 100%;
text-decoration: none;
color: $color_div;
margin: 0;
&:hover {
background: $color_div;
color: $background_div;
}
&.selected {
background: $color_div;
color: $background_div;
}
}
a.menu-expand {
padding-bottom: 9px;
.open-menu-icon-hover {
display: none;
}
&:hover {
.open-menu-icon-hover {
display: block;
}
.open-menu-icon {
display: none;
}
}
}
}
nav.mobile-shortcuts {
position: fixed;
display: flex;
width: 100%;
background: $background_div;
height: 60px;
a {
height: 100%;
width: (100% / 6);
}
div {
width: 100% * 4 / 6;
}
}
nav.mobile-foldable {
display: none;
background: $background_div;
color: $color_div;
a {
//background: $color_div;
//color: $background_div;
display: block;
}
}
nav.mobile-foldable.show {
display: block;
}
h1 {
text-align: center;
}
div.footer {
p, h1, h2, h3, h4, a {
font-size: initial;
}
a.suscribe-category-rss {
padding: 7px;
}
a.suscribe-category-rss, a.suscribe-category-rss > img {
width: 20px;
height: 20px;
}
}
}
} }
@media (min-width: 450px) { @media (min-width: 450px) {
body { body {
div.page-contents { div.page-contents {
table { table {
th, td { th, td {
font-size: 20px; font-size: 20px;
}
}
} }
}
} }
}
} }
@media (min-width: 1100px) { @media (min-width: 1100px) {
body { body {
div.page-contents { div.page-contents {
nav.mobile-foldable,nav.mobile-foldable.show { nav.mobile-foldable, nav.mobile-foldable.show {
display: none; display: none;
} }
div.description {
margin-left: 10%; div.description {
margin-right: 10%; margin-left: 10%;
margin-top: auto; margin-right: 10%;
} margin-top: auto;
nav.desktop { }
display: block;
height: auto; nav.desktop {
a { display: block;
display: table-cell; height: auto;
img.index-image-menu {
padding-top: 15px; a {
} display: table-cell;
}
} img.index-image-menu {
nav.mobile-shortcuts { padding-top: 15px;
display: none; }
} }
top: 0%; }
left: 5%;
height: 100%; nav.mobile-shortcuts {
width: 90%; display: none;
} }
}
top: 0%;
left: 5%;
height: 100%;
width: 90%;
}
}
} }
@media (min-width: 1222px) { @media (min-width: 694px) {
body { body {
div.page-contents { div.page-contents {
div.description { div.description {
margin-top: auto; margin-top: auto;
div.articles {
a { div.articles {
width: 45%; a {
margin-left: 5%; width: 45%;
} margin-left: 5%;
} }
} }
} }
} }
}
}
@media (min-width: 1333px) {
body {
div.page-contents {
div.description {
margin-top: auto;
div.articles {
a {
width: 30%;
margin-left: 3%;
}
}
}
}
}
} }

View File

@ -9,17 +9,22 @@
<article><% <article><%
my $date_article = DateTime::Format::ISO8601->parse_datetime($post->{date}); my $date_article = DateTime::Format::ISO8601->parse_datetime($post->{date});
$date_article->set_time_zone('Europe/Madrid'); $date_article->set_time_zone('Europe/Madrid');
%><p class="date"><%= ''.$date_article %></p><% %><div class="article-up-part">
<p class="date"><%= ''.$date_article %></p><%
if (defined $post->{image}) { if (defined $post->{image}) {
%><img alt="Portada de <%=$post->{title}%>" src="<%=$post->{image}%>"/><% %><div class="image-container">
} <img alt="Portada de <%=$post->{title}%>" src="<%=$post->{image}%>"/>
%><h3><%=$post->{title}%></h3><% </div><%
}
%></div><div class="article-down-part">
<h3><%=$post->{title}%></h3><%
my $xml = Mojo::DOM->new($post->{content}); my $xml = Mojo::DOM->new($post->{content});
my $text = $xml->all_text; my $text = $xml->all_text;
if (length($text) > 120) { if (length($text) > 120) {
$text = substr($text, 0, 100).'...'; $text = substr($text, 0, 100).'...';
} }
%><p><%=$text%></p><p class="author">Escrito por <%=$post->{author}%></p></article> %><p><%=$text%></p><p class="author">Escrito por <%=$post->{author}%></p>
</div></article>
</a> </a>
% } % }
</div> </div>