Skip to content

Commit 7d7fecb

Browse files
committed
Inverted color class plus introduction card refactor
1 parent 8871b8a commit 7d7fecb

File tree

8 files changed

+69
-52
lines changed

8 files changed

+69
-52
lines changed

LinkDotNet.Blog.Web/Pages/Index.razor

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,21 @@
1010
<OgData Title="@(Markdown.ToPlainText(appConfiguration.BlogName))"
1111
AbsolutePreviewImageUrl="@GetAbsolutePreviewImageUrl()"
1212
Description="@(Markdown.ToPlainText(appConfiguration.Introduction.Description))"></OgData>
13-
<section class="background-image" style="background-image: url(@appConfiguration.Introduction.BackgroundUrl);">
14-
</section>
15-
1613
<section class="introduction">
1714
<IntroductionCard Introduction="appConfiguration.Introduction"></IntroductionCard>
1815
</section>
1916

2017
<section>
21-
<div class="blogpost-cards">
22-
<header>
23-
<div class="recent-posts">
24-
<h1>Recent Posts</h1>
25-
</div>
26-
</header>
27-
<div>
28-
@for (var i = 0; i < currentPage.Count; i++)
29-
{
30-
<ShortBlogPost BlogPost="currentPage[i]" UseAlternativeStyle="@(i % 2 != 0)"></ShortBlogPost>
31-
}
18+
<header>
19+
<div class="recent-posts">
20+
<h1>Recent Posts</h1>
3221
</div>
22+
</header>
23+
<div class="content px-4">
24+
@for (var i = 0; i < currentPage.Count; i++)
25+
{
26+
<ShortBlogPost BlogPost="currentPage[i]" UseAlternativeStyle="@(i % 2 != 0)"></ShortBlogPost>
27+
}
3328
</div>
3429
<BlogPostNavigation CurrentPage="@currentPage" OnPageChanged="@GetPage"></BlogPostNavigation>
3530
</section>
Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.blogpost-cards {
2+
/* TODO: Do not use the color directly, this will interfere with dark mode */
23
background-color: var(--big-stone);
34
margin: 1rem auto 1.6%;
45
}
@@ -9,18 +10,9 @@
910
}
1011

1112
.recent-posts h1 {
12-
color: var(--header1-inverted);
13-
font-size: 1.75em;
13+
font-size: 2.5em;
1414
vertical-align:middle;
1515
margin: auto;
16-
}
17-
18-
.background-image {
19-
background-repeat: no-repeat;
20-
background-size: cover;
21-
min-height:55vh;
22-
}
23-
24-
.introduction {
25-
padding-top: 35px;
16+
padding-top: 75px;
17+
padding-bottom: 20px;
2618
}

LinkDotNet.Blog.Web/Shared/IntroductionCard.razor

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
@using LinkDotNet.Domain
22
@inherits MarkdownComponentBase
33

4-
<div>
5-
<div class="profile-picture" style="background-image: url(@Introduction.ProfilePictureUrl)">
6-
</div>
7-
<div class="profile-text">
8-
@RenderMarkupString(Introduction.Description)
4+
<div style="background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url(@Introduction.BackgroundUrl);"
5+
class="inverted-colors">
6+
<div class="introduction-container">
7+
<div class="profile-picture" style="background-image: url(@Introduction.ProfilePictureUrl)">
8+
9+
</div>
10+
<div class="profile-text">
11+
@RenderMarkupString(Introduction.Description)
12+
</div>
913
</div>
1014
</div>
11-
1215
@code {
1316
[Parameter]
1417
public Introduction Introduction { get; set; }
Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,48 @@
1-
.profile-picture {
1+
.introduction-container {
2+
padding-top: 78px;
3+
background-repeat: no-repeat;
4+
background-size: cover;
5+
height: 438px;
6+
display: grid;
7+
grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr 1fr;
8+
grid-template-rows: 1fr 1fr 1fr;
9+
gap: 10px;
10+
grid-template-areas: ". . . . . ." ". profile-picture profile-text profile-text profile-text ." ". . . . . .";
11+
}
12+
13+
.profile-picture {
14+
grid-area: profile-picture;
215
width: 175px;
316
height: 175px;
417
border-radius: 50%;
518
border: white;
6-
margin: auto;
19+
margin: 4px 0 0 4px;
720
box-shadow: 0 0 0 4px white;
821
background-repeat: no-repeat;
922
background-position: center center;
1023
background-size: cover;
1124
}
1225

1326
.profile-text {
14-
padding-top: 15px;
15-
width: 60%;
16-
margin: auto;
17-
font-size: 1.5em;
18-
line-height: 1.5em;
27+
grid-area: profile-text;
28+
font-size: clamp(1rem, 0.6479rem + 1.1268vw, 1.5rem);
29+
color: var(--text-color-inverted);
30+
line-height: clamp(1.5em, 0.6479rem + 1.1268vw, 2.25em);
31+
}
32+
33+
@media only screen and (max-width: 700px) {
34+
.introduction-container {
35+
grid-template-columns: .5fr 1fr 1fr 1fr 1fr .5fr;
36+
grid-template-rows: 1fr 1fr 1fr 1fr;
37+
grid-template-areas:
38+
". . . . ."
39+
". . profile-picture profile-picture . ."
40+
". profile-text profile-text profile-text profile-text ."
41+
". profile-text profile-text profile-text profile-text .";
42+
}
43+
44+
.introduction-container .profile-picture {
45+
margin-top: 10px;
46+
margin-left: 0;
47+
}
1948
}

LinkDotNet.Blog.Web/Shared/NavMenu.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@inject AppConfiguration configuration
22
@inject NavigationManager navigationManager
33

4-
<nav class="navbar navbar-expand-lg position-absolute navbar-background" style="width: 100%">
4+
<nav class="navbar navbar-expand-lg position-absolute navbar-background inverted-colors" style="width: 100%">
55
<div class="container-fluid">
66
<a class="nav-brand barcode ms-5" href="#">@configuration.BlogName</a>
77
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">

LinkDotNet.Blog.Web/Shared/NavMenu.razor.css

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@
1414
font-size: 3rem;
1515
}
1616

17-
.navbar a {
18-
font-weight: 500;
19-
color: var(--active-link-inverted) !important;
20-
}
21-
22-
.navbar a:hover {
23-
color: var(--link-hover-inverted) !important;
24-
}
25-
2617
::deep .navbar-nav li {
2718
padding-left: 1.25rem;
2819
white-space: nowrap;

LinkDotNet.Blog.Web/Shared/ShortBlogPost.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<article>
66
<div class="blog-card @AltCssClass">
77
<div class="meta">
8+
<div class="photo" style="background-image: url(@BlogPost.PreviewImageUrl)"></div>
89
<ul class="details">
910
<li class="date">@BlogPost.UpdatedDate.ToString("dd/MM/yyyy")</li>
1011
@if (BlogPost.Tags != null)
@@ -13,7 +14,7 @@
1314
<ul>
1415
@foreach (var tag in BlogPost.Tags.Select(t => t.Content))
1516
{
16-
<li><a class="goto-tag inverse" href="/searchByTag/@(Uri.EscapeDataString(tag))">@tag</a></li>
17+
<li><a class="goto-tag" href="/searchByTag/@(Uri.EscapeDataString(tag))">@tag</a></li>
1718
}
1819
</ul>
1920
</li>

LinkDotNet.Blog.Web/wwwroot/css/basic.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
--header1-inverted: var(--ceramic);
2424
--header2: var(--pewter);
2525
--text-color: var(--big-stone);
26+
--text-color-inverted: var(--ceramic);
2627

2728
--navbar-background: #f4f4f4d0;
2829

@@ -50,6 +51,7 @@ body {
5051
}
5152

5253
a {
54+
transition: 0.3s ease-in-out !important;
5355
font-weight: 500;
5456
color: var(--active-link) !important;
5557
}
@@ -63,15 +65,19 @@ a:hover {
6365
color: var(--disabled-link) !important;
6466
}
6567

66-
a.inverse {
68+
.inverted-colors a {
6769
font-weight: 400;
6870
color: var(--active-link-inverted) !important;
6971
}
7072

71-
a.inverse:hover {
73+
.inverted-colors a:hover {
7274
color: var(--link-hover-inverted) !important;
7375
}
7476

77+
.inverted-colors p {
78+
color: var(--text-color-inverted) !important;
79+
}
80+
7581
h1 {
7682
color: var(--header1);
7783
}

0 commit comments

Comments
 (0)