Use CSS Grid layout for projects

This commit is contained in:
Cameron Cordes
2020-08-30 20:58:44 -04:00
parent 496df11df7
commit 9717c2c332
3 changed files with 34 additions and 10 deletions

View File

@@ -1,6 +1,28 @@
@media (max-width: 768px) {
img {
max-width: 40%;
margin: 0 0 1em 0;
.grid {
display: grid;
grid-gap: 1em;
grid-template-columns: repeat(auto-fill, minmax(480px, 1fr) );
align-content: start;
margin: 1rem;
}
:host /deep/ a {
color: var(--nord13);
}
:host /deep/ a:hover {
color: var(--nord11);
-webkit-transition: color 300ms;
-moz-transition: color 300ms;
-ms-transition: color 300ms;
-o-transition: color 300ms;
transition: color 300ms;
text-decoration: none;
}
@media(max-width: 576px) {
.grid {
grid-template-columns: 1fr;
margin: 0.5rem;
}
}

View File

@@ -1,9 +1,11 @@
<div class="row">
<div class="col col-lg-6 col-md-9 text-center mx-auto mt-5">
<div class="mb-5" *ngFor="let project of projects">
<div class="row dark-bg h-100">
<div class="grid">
<div *ngFor="let project of projects"
class="text-center shadow d-flex flex-column justify-content-around p-3 h-100"
style="background-color: var(--nord1)">
<img *ngIf="project.imgLocation" src={{project.imgLocation}} class="mx-auto mb-3 w-25" alt="{{project.title}} icon">
<h4>{{project.title}}</h4>
<img *ngIf="project.imgLocation" src={{project.imgLocation}} class="w-25" alt="{{project.title}} icon">
<p class="subtitle" style="margin: 0">{{project.applicationType}}</p>
<span class="subtitle">{{project.applicationType}}</span>
<p class="thin-subtitle" [innerHTML]="project.description | projectKeyword"></p>
</div>
</div>