Fix home page design.
This commit is contained in:
@@ -5,7 +5,7 @@ import java.util.UUID;
|
|||||||
public record Author(
|
public record Author(
|
||||||
UUID id,
|
UUID id,
|
||||||
String name,
|
String name,
|
||||||
String image
|
String photoId
|
||||||
) {
|
) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ public record AuthorDto(
|
|||||||
this(
|
this(
|
||||||
author.id(),
|
author.id(),
|
||||||
author.name(),
|
author.name(),
|
||||||
author.image()
|
author.photoId()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,17 +24,17 @@ public class AuthorEntity {
|
|||||||
private UUID id;
|
private UUID id;
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
private String pseudo;
|
private String pseudo;
|
||||||
// private String illustrationId;
|
private String photoId;
|
||||||
|
|
||||||
public AuthorEntity(Author author) {
|
public AuthorEntity(Author author) {
|
||||||
this(
|
this(
|
||||||
author.id(),
|
author.id(),
|
||||||
author.name()
|
author.name(),
|
||||||
// author.illustrationId()
|
author.photoId()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Author toDomain() {
|
public Author toDomain() {
|
||||||
return new Author(id, pseudo, "image");
|
return new Author(id, pseudo, photoId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
<h1>Last articles</h1>
|
<h1>Last publications</h1>
|
||||||
<div class="publication-container">
|
<div class="publication-container">
|
||||||
<a *ngFor="let publication of publications$ | async" [routerLink]="['']" class="publication">
|
<a *ngFor="let publication of publications$ | async" [routerLink]="['/publications/' + publication.id]" class="publication">
|
||||||
<img src="/pictures/{{publication.illustrationId}}"/>
|
<img src="/pictures/{{ publication.illustrationId }}"/>
|
||||||
<h1>{{publication.title}}</h1>
|
<div class="body">
|
||||||
<h2>{{publication.description}}</h2>
|
<h1>{{publication.title}}</h1>
|
||||||
|
<h2>{{publication.description}}</h2>
|
||||||
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<img src="/pictures/{{publication.author.image}}" [matTooltip]="publication.author.name"/>
|
<img src="/pictures/{{ publication.author.image }}" [matTooltip]="publication.author.name"/>
|
||||||
Publication posted by {{publication.author.name}}
|
Publication posted by {{publication.author.name}}
|
||||||
<span class="publication-date">
|
<span class="publication-date">
|
||||||
({{publication.creationDate}})
|
({{ publication.creationDate | date: 'short' : 'fr-Fr' }})
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
$cardBorderRadius: .5em;
|
||||||
|
|
||||||
:host {
|
:host {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -8,40 +10,69 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 2em;
|
gap: 2em;
|
||||||
max-width: 40em;
|
max-width: 50em;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
|
||||||
.publication {
|
.publication {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
border-radius: .5em;
|
border-radius: $cardBorderRadius;
|
||||||
box-shadow: 0 2px 5px 0 rgba(0,0,0,.16),0 2px 10px 0 rgba(0,0,0,.12);
|
box-shadow: 0 2px 5px 0 rgba(0,0,0,.16),0 2px 10px 0 rgba(0,0,0,.12);
|
||||||
|
transition: box-shadow .2s ease-in-out;
|
||||||
|
text-decoration: none;
|
||||||
|
color: black;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
box-shadow: 0 4px 8px 0 rgba(0,0,0,.24),0 4px 14px 0 rgba(0,0,0,.16);
|
||||||
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
height: 25em;
|
height: 32em;
|
||||||
border-radius: .5em .5em 0 0;
|
border-radius: $cardBorderRadius $cardBorderRadius 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
.body {
|
||||||
font-size: 2.4em;
|
display: flex;
|
||||||
}
|
flex-direction: column;
|
||||||
|
padding: 1.5em 2em;
|
||||||
|
|
||||||
h2 {
|
h1 {
|
||||||
font-size: 1.6em;
|
font-size: 1.8em;
|
||||||
|
margin-bottom: .5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 1em;
|
||||||
|
line-height: 1.4em;
|
||||||
|
margin: 0;
|
||||||
|
color: #747373;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
border-radius: 0 0 $cardBorderRadius $cardBorderRadius;
|
||||||
|
padding: 1em 2em;
|
||||||
|
gap: 1em;
|
||||||
|
color: #6c757d;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
|
$imageSize: 4em;
|
||||||
border-radius: 10em;
|
border-radius: 10em;
|
||||||
width: 5em;
|
width: $imageSize;
|
||||||
height: 5em;
|
height: $imageSize;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.publication-date {
|
||||||
|
font-style: italic;
|
||||||
|
color: #bdbdbd;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user