nabu/assets/styles/pages/article/article.css
2022-03-11 13:45:34 -06:00

647 lines
11 KiB
CSS

/*
* Este archivo es parte de Nabu.
*
* Nabu es software libre: puedes redistribuirlo y/o modificarlo
* bajo los términos de la Licencia Pública General de GNU Affero publicada por
* la Free Software Foundation, ya sea la versión 3 de la Licencia, o
* (a su elección) cualquier versión posterior.
*
* Nabu se distribuye con la esperanza de que sea de utilidad,
* pero SIN NINGUNA GARANTÍA; incluso sin la garantía implícita de
* COMERCIABILIDAD o APTITUD PARA UN PROPÓSITO PARTICULAR. Consulte la
* Licencia Pública General de GNU Affero para obtener más detalles.
*
* Debería haber recibido una copia de la Licencia Pública General de GNU Affero
* junto con este programa. De lo contrario, consulte <https://www.gnu.org/licenses/>.
*/
/*
* Orden de los estilos
* 1. Posicionamiento
* 2. Modelo de caja
* 3. Tipografía
* 4. Visuales
* 5. Otros
* Metodología => BEM
*/
body {
background-color: var(--color-background);
}
/* Estilos del header */
.nav__burger-icon {
color: white;
}
header {
min-width: 320px;
width: 100%;
position: relative;
box-shadow: inset 0 0 0 100vh rgba(0,0,0,0.2);
}
header::before {
content: "";
position: absolute;
z-index: 1;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0, 0, 0, .5);
}
.post__back-image {
position: absolute;
width: 100%;
height: 100%;
object-fit: cover;
}
/* Sobrescribe los estilos del componente nav */
.nav {
background-color: initial;
padding-bottom: 50px;
width: 90%;
margin: 0 auto;
position: relative;
z-index: 2;
}
.overlay {
z-index: 2;
}
/* Listón del navbar */
.nav__polygon {
display: initial;
width: 80px;
height: 85px;
position: absolute;
top: 0;
z-index: -1;
clip-path: polygon(100% 100%, 100% 0%, 0% 0%, 0% 100%, 50% 75%);
background: rgba(255,255,255,0.8);
}
.nav__logo-wrapper {
width: 80px;
}
.nav__logo-wrapper > a {
display: block;
width: 80%;
margin: 0 auto;
}
.nav__logo {
width: 100%;
}
/* Estilos del texto del post */
.post__head {
width: 90%;
margin: 0 auto;
padding-bottom: 30px;
color: #FFF;
position: relative;
z-index: 1;
}
.post__title {
margin-top: 0;
font-size: 2.4rem;
font-weight: 700;
line-height: 2.8rem;
}
.post__details {
display: flex;
align-items: center;
}
.post__profile {
display: inline-block;
min-width: 40px;
width: 50px;
height: 50px;
border-radius: 100%;
overflow: hidden;
}
.post__img-author {
width: 100%;
}
.post__info {
margin-left: 8px;
}
.post__author-name a {
font-size: 1.2rem;
font-weight: 400;
text-decoration: none;
color: #FFF;
}
.post__date {
font-size: 1rem;
font-weight: 300;
}
/* Post text */
.post__body {
width: 100%;
padding-top: 10px;
min-width: 320px;
display: flex;
flex-direction: column;
/* position: relative; */
}
.post__aside {
width: 90%;
margin: 0 auto;
position: relative;
}
/* Heart toggle animation */
.heart {
position: absolute;
z-index: 1;
top: -90px;
right: 0;
}
.post__aside [for='toggle__heart'] {
font-size: 4rem;
color: #aab8c2;
cursor: pointer;
}
.heart > a {
display: inline-block;
text-decoration: none;
color: #aab8c2;
}
.post__aside [id='toggle__heart'] {
visibility: hidden;
}
.post__aside [id='toggle__heart']:checked + label{
color: #e2264d;
animation: heart 1s cubic-bezier(.17, .89, .32, 1.49);
}
@keyframes heart {
0%,
15% {
font-size: 0;
}
}
/* Estilos para el copy */
.post__copy {
padding: 20px 0;
width: 90%;
margin: 0 auto;
}
/* Estilos para el like */
.icon {
width: 30px;
height: 30px;
opacity: 1;
/* position: fixed;
top: 50%;
left: 50%; */
/* transform: translateX(-100%); */
}
#icon-heart > path {
fill: var(--color-primary-red);
}
.icon.beat {
animation: 2s beat-heart ease-in-out forwards;
}
@keyframes beat-heart {
0% {
opacity: 0.9;
transform: scale(0.7);
}
20% {
transform: scale(1.8);
}
40% {
transform: scale(1.2);
}
80% {
opacity: 0;
transform: scale(0.7);
}
}
/* Estilos generales de las etiquetas */
/* Estilos para los heads */
.post__copy h1,
.post__copy h2,
.post__copy h3,
.post__copy h4,
.post__copy h5,
.post__copy h6 {
margin: 0;
margin-top: 2.2rem;
word-wrap: break-word;
}
/* Estilos para los parrafos */
.post__copy > p:not(p:first-child, h2 + p, h3 + p) {
margin-top: 2.8rem;
}
.post__body .post__copy > h3 + p {
margin-top: 1rem;
}
.post__copy > p {
font-size: 1.6rem;
line-height: 2.6rem;
font-weight: normal;
letter-spacing: -0.03px;
word-wrap: break-word;
}
/* Estilos para las imagenes */
.post__copy img {
width: 100%;
height: 100%;
object-fit: cover;
}
/* Acomodar las imagenes en medio, se agrega esta clasea al contenedor de la imagen desde JS */
.post__container-img {
text-align: center;
}
/* Estilos para los enlaces */
.post__copy a {
color: var(--color-black);
text-decoration: none;
}
/* Estilos para el blockquote */
.post__copy blockquote {
font-style: italic;
font-size: 1.4rem;
line-height: 1.8rem;
margin: 1.5em 0;
padding: 0.5em 10px;
border-left: 4px solid var(--color-secondary-purple);
quotes: "\00BB""\201C""\201D""\2018""\2019";
}
.post__copy blockquote p {
display: inline;
}
/* Estilos para el codigo incrustado */
.hljs {
background: transparent;
}
.post__copy pre {
padding: 20px;
background-color: #383A59;
color: white;
}
.post__copy pre[data-lang]::before {
content: attr(data-lang);
display: block;
}
.post__copy pre code {
max-width: 100%;
min-width: 100px;
padding: 0;
display: block;
white-space: pre;
overflow-x: auto;
font-size: 1rem;
-webkit-overflow-scrolling: touch;
}
/* Estilos para las listas */
.post__copy ul, .post__copy ol {
padding-left: 20px;
margin: 10px 0;
}
.post__copy ul ::marker {
color: var(--color-black);
}
.post__copy li:not(:last-child) {
margin: 10px 0;
}
.post__copy li {
font-size: 1.4rem;
line-height: 2.6rem;
letter-spacing: -.25px;
}
.post__body table {
width: 100%;
margin: 15px 0;
border-collapse: collapse;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
}
.post__body table td, table th {
padding: 8px;
color: var(--color-black);
}
.post__body table th{
font-size: 1.4rem;
font-weight: 700;
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
border: 1px solid var(--color-secondary-purple);
color: var(--color-background);
background-color: var(--color-secondary-purple);
}
.post__body table td{
font-size: 1.2rem;
border: 1px solid #ddd;
}
.post__body tbody tr:nth-child(odd){
background-color: #eee;
}
.post__body tbody tr:nth-child(even){
background-color: #fff;
}
/* Estilos de la sección de otros post para mostrar */
.popular-posts {
width: 100%;
min-width: 320px;
padding: 23px 0;
text-align: center;
background-color: var(--color-secundary-background);
}
.popular-posts__title,
.recent-posts__title {
margin-bottom: 11px;
font-size: 2.4rem;
font-weight: 500;
line-height: 3.6rem;
color: #000;
}
.popular-cards__container {
width: 100%;
display: flex;
gap: 0 20px;
padding: 15px 20px;
overflow-x: scroll;
margin-left: auto;
scroll-snap-type: x mandatory;
}
/* Estilos de la barra de scroll */
.pupular-cards__container::-webkit-scrollbar {
width: 2px;
height: 2px;
}
.popular-cards__container::-webkit-scrollbar-thumb {
background-color: var(--color-secondary-purple);
}
/* Estilos para la seccion del autor */
.author-info {
min-width: 320px;
}
.author-info__container {
width: 90%;
margin: 0 auto;
padding: 30px 0;
text-align: center;
}
.author-info__image {
display: inline-block;
width: 100px;
border-radius: 100%;
}
.comment__user-image{
width: 100%;
border-radius: inherit;
}
.author-info__text {
margin-top: 7px;
}
.author-info__title {
font-size: 2rem;
line-height: 2.8rem;
font-weight: 600;
}
.author-info__title a {
text-decoration: none;
color: #000;
cursor: pointer;
}
.author-info__description {
font-weight: 400;
font-size: 1.2rem;
line-height: 1.4rem;
}
/* Estilos de la caja de comentarios */
.comments {
width: 100%;
padding: 40px 0;
min-width: 320px;
}
.comments__container {
width: 90%;
margin: 0 auto;
text-align: center;
}
.comments__title {
font-size: 1.8rem;
font-weight: 500;
line-height: 3.6rem;
color: #000;
}
.comments__box {
margin-top: 5px;
display: flex;
justify-content: center;
align-items: center;
}
.comment__user-image-container {
display: inline-block;
overflow: hidden;
width: 45px;
height: 45px;
margin-right: 10px;
}
.comments__form {
width: 100%;
max-width: 370px;
text-align: right;
}
.comments__textarea {
resize: none;
min-width: 180px;
width: 100%;
height: 100px;
padding: 10px;
font-size: 1.2rem;
border: 0;
outline-color: var(--color-secondary-purple);
}
.comments__button {
min-width: 80px;
margin-top: 10px;
padding: 10px;
border-radius: 10px;
border: 0;
font-size: 1.2rem;
background-color: var(--color-secondary-purple);
color: #FFF;
cursor: pointer;
}
.comments__button:active {
transform: scale(1.1);
}
/* Estilos a las respuestas de comentarios */
.comments__list {
margin-top: 50px;
}
.comments__item {
max-width: 425px;
margin: 0 auto;
margin-bottom: 20px;
display: grid;
gap: 8px 0;
grid-template-columns: 0.3fr 0.7fr;
grid-template-rows: 2fr 0.5fr;
align-items: center;
padding: 10px;
padding-left: 0;
border-radius: 10px;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.25);
background-color:#fff;
}
.comments__item .comment__user-image-container {
margin: 0;
}
.comments__user-link {
display: inline-block;
text-decoration: none;
grid-row: 1 / 3;
}
.commnets__text {
text-align: left;
font-size: 1rem;
font-weight: 400;
color: var(--color-black);
}
.comments__info {
grid-column: 2 / 3;
padding-right: 5px;
display: flex;
justify-content: space-between;
align-items: center;
text-align: left;
}
.comments__data {
font-size: 0.8rem;
text-decoration: wavy;
text-decoration-line: underline;
text-decoration-thickness: 0.5px;
text-decoration-color: var(--color-secondary-purple);
}
.comments__user-name {
text-decoration: none;
text-decoration-color: var(--color-secondary-purple);
}
.comments__delete-btn {
padding: 2px 4px;
text-decoration: none;
font-weight: 500;
background-color: var(--color-primary-red);
color: var(--color-secundary-background);
}
.comments__delete-btn:hover {
background-color: rgba(242, 120, 130, 0.8);
}
.comments__delete-btn:active {
transform: scale(1.1);
}
/* Estilos del footer */
.footer {
background-color: var(--color-black);
}
.footer .rights {
color: var(--color-background);
}
.footer .media svg path {
fill: var(--color-background);
}