style tweaks (mainly for mobile)
This commit is contained in:
1 parent
b396728db8
commit
07437e7950
13 files changed
+216
-80
No files matched your search
@@ -1,14 +1,3 @@
|
||||
@keyframes fadeIn {
|
||||
0% {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
.height-container {
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
@@ -124,15 +113,16 @@ h1 {
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
::ng-deep img {
|
||||
.article-content img {
|
||||
max-width: 90%;
|
||||
padding: 15px;
|
||||
border-radius: 35px;
|
||||
height: auto;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
::ng-deep .gallery {
|
||||
.article-content .gallery {
|
||||
display: grid;
|
||||
max-width: 90vw;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
@@ -141,14 +131,14 @@ h1 {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
::ng-deep .gallery img {
|
||||
.article-content .gallery img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
border-radius: 20px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
::ng-deep .modal {
|
||||
.modal {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
@@ -158,22 +148,55 @@ h1 {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
animation: fadeIn 0.3s ease forwards;
|
||||
z-index: 1000;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
::ng-deep .modal img {
|
||||
.modal img {
|
||||
max-width: 80%;
|
||||
max-height: 80%;
|
||||
border-radius: 20px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
.modal-enter {
|
||||
animation: modalFadeIn 0.25s ease forwards;
|
||||
}
|
||||
|
||||
.modal-leave {
|
||||
animation: modalFadeOut 0.25s ease forwards;
|
||||
}
|
||||
|
||||
.modal-image-enter {
|
||||
animation: modalImageIn 0.25s ease forwards;
|
||||
}
|
||||
|
||||
.modal-image-leave {
|
||||
animation: modalImageOut 0.25s ease forwards;
|
||||
}
|
||||
|
||||
@keyframes modalFadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale(0.95); /* optional: slight zoom effect */
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes modalFadeOut {
|
||||
from {
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes modalImageIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale(0.95);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
@@ -181,6 +204,17 @@ h1 {
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes modalImageOut {
|
||||
from {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
to {
|
||||
opacity: 0;
|
||||
transform: scale(0.95);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
@@ -191,13 +225,13 @@ h1 {
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
::ng-deep .gallery img {
|
||||
.article-content .gallery img {
|
||||
flex: 1 1 calc(50% - 15px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
::ng-deep .gallery img {
|
||||
.article-content .gallery img {
|
||||
gap: 0;
|
||||
padding: 0;
|
||||
flex: 1 1 100%;
|
||||
@@ -205,13 +239,13 @@ h1 {
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
::ng-deep img {
|
||||
.article-content img {
|
||||
max-width: 98%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
::ng-deep .modal img {
|
||||
.modal img {
|
||||
max-width: 95%;
|
||||
max-height: 95%;
|
||||
}
|
||||
|
||||
@@ -6,16 +6,24 @@
|
||||
">
|
||||
</app-parallax>
|
||||
<div class="height-container">
|
||||
@if (!loading && article) {
|
||||
<!-- Loading State-->
|
||||
@if (loading) {
|
||||
<div class="loading-container">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
} @else if (article) {
|
||||
<!-- Article -->
|
||||
<div class="article-container">
|
||||
<div>
|
||||
<!-- Article Title -->
|
||||
<h1>{{ article.title }}</h1>
|
||||
<div class="content-container">
|
||||
<!-- Article Content -->
|
||||
<div #articleContent class="article-content" [innerHTML]="article.content"></div>
|
||||
<div
|
||||
#articleContent
|
||||
class="article-content"
|
||||
[innerHTML]="article.content"
|
||||
(click)="onArticleContentClick($event)"
|
||||
></div>
|
||||
<a href="/blog"><button>{{ 'ARTICLE_BACK' | translate }}</button></a>
|
||||
<!-- Article Metadata -->
|
||||
<div class="article-meta">
|
||||
<p><strong>Author:</strong> {{ article.authorName}}</p>
|
||||
<p><strong>Views:</strong> {{ article.views }}</p><br><button (click)="copyLink()" [ngStyle]="{'background-color':copied ? '#22b34b' : ''}">{{ copied ? 'Copied' : 'Share' }}</button>
|
||||
@@ -23,27 +31,30 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<!-- Image Modal -->
|
||||
@if (selectedImage) {
|
||||
<div class="modal" (click)="closePreview()">
|
||||
<img [src]="selectedImage" alt="Full Preview" />
|
||||
<div
|
||||
class="modal"
|
||||
animate.enter="modal-enter"
|
||||
animate.leave="modal-leave"
|
||||
(click)="closePreview()"
|
||||
>
|
||||
<img
|
||||
[src]="selectedImage"
|
||||
alt="Full Preview"
|
||||
class="modal-image"
|
||||
animate.enter="modal-image-enter"
|
||||
animate.leave="modal-image-leave"
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
} @else {
|
||||
@if (!loading && error) {
|
||||
<div class="error-message">
|
||||
<h1>404</h1>
|
||||
<p>{{ 'ARTICLE_NOTFOUND' | translate }}</p>
|
||||
<a href="/blog"><button>{{ 'ARTICLE_BACK' | translate }}</button></a>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<!-- Loading State-->
|
||||
@if (loading) {
|
||||
<div class="loading-container">
|
||||
<div class="spinner"></div>
|
||||
} @else if (error) {
|
||||
<!-- Error Message -->
|
||||
<div class="error-message">
|
||||
<h1>404</h1>
|
||||
<p>{{ 'ARTICLE_NOTFOUND' | translate }}</p>
|
||||
<a href="/blog"><button>{{ 'ARTICLE_BACK' | translate }}</button></a>
|
||||
</div>
|
||||
}
|
||||
<!-- Error Message -->
|
||||
</div>
|
||||
Reference in new issue
Block a user