Skip to content

Commit 005a766

Browse files
committed
Adjust styling to improve responsiveness
- Making athlete/activity cards work better on smaller screens - Updating background color (light) to match strava.com - Moving around some stuff in activity cards
1 parent 593a33d commit 005a766

File tree

7 files changed

+28
-23
lines changed

7 files changed

+28
-23
lines changed

Tevling/Components/ActivityCard.razor

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
@if (Activity is not null)
44
{
5-
<div class="activity-card px-4 py-3 d-flex flex-row flex-wrap">
6-
<div class="activity-card-content d-flex flex-column">
7-
8-
<div class="activity-card-header d-flex flex-row align-items-center flex-wrap-reverse row-gap-1">
9-
<div class="d-flex align-items-center flex-row column-gap-2 athlete-name-container me-1">
10-
<Avatar Url="@Activity.Athlete?.ImgUrl" Size="40" />
11-
<span class="athlete-name">@Activity.Athlete?.Name</span>
12-
</div>
5+
<div class="activity-card px-3 py-2 d-flex flex-row flex-wrap">
6+
<div class="activity-card-content pb-1 d-flex flex-column">
7+
<div class="activity-card-header mb-2 d-flex flex-row align-items-center flex-wrap-reverse row-gap-1">
138
<span class="activity-time">@ActivityTime</span>
149
<div class="d-flex flex-row align-items-end ms-auto strava-link column-gap-1">
1510
<a target="_blank" href="https://www.strava.com/activities/@Activity.StravaId">@Loc["ViewOnStrava"]</a>
1611
<i class="bi bi-box-arrow-up-right pb-1" aria-hidden="true"></i>
1712
</div>
1813
</div>
1914

15+
<div class="d-flex align-items-center flex-row column-gap-2 athlete-name-container me-1">
16+
<Avatar Url="@Activity.Athlete?.ImgUrl" Size="40" />
17+
<span class="athlete-name">@Activity.Athlete?.Name</span>
18+
</div>
19+
2020
<div class="activity-card-body d-flex flex-column row-gap-2">
2121
<div>
2222
<span class="badge bg-primary">@ActivityTypeTranslator.Translate(Activity.Details.Type)</span>

Tevling/Components/ActivityCard.razor.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
.activity-card {
22
display: flex;
33
flex-direction: row;
4-
border-radius: 1.5rem;
4+
border-radius: .5rem;
55
width: 34rem;
6-
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
6+
max-width: 100%;
7+
box-shadow: 2px 2px 5px 0 rgba(0, 0, 0, 0.15);
78
transition: box-shadow 0.2s, max-height 1s ease-in-out;
89
column-gap: 1em;
910
margin-bottom: 1rem;
@@ -17,7 +18,7 @@
1718

1819
@media (max-width: 500px) {
1920
.activity-card {
20-
width: 21rem;
21+
min-width: 21rem;
2122
}
2223

2324
.activity-time,

Tevling/Components/AthleteCard.razor.css

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
.athlete-card {
22
display: flex;
33
flex-direction: row;
4-
border-radius: 1rem;
4+
border-radius: .5rem;
55
width: 44rem;
6-
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
6+
max-width: 100%;
7+
box-shadow: 2px 2px 5px 0 rgba(0, 0, 0, 0.15);
78
transition: box-shadow 0.2s, max-height 1s ease-in-out;
89
column-gap: 1em;
910
}
1011

1112
@media (max-width: 500px) {
1213
.athlete-card {
13-
max-width: 22rem;
14+
min-width: 21rem;
1415
}
1516

1617
.athlete-name {
@@ -35,18 +36,18 @@
3536
}
3637

3738
.athlete-name {
38-
width: 15rem;
39+
max-width: 15rem;
3940
}
4041

4142
.strava-link {
4243
font-size: smaller;
4344
font-weight: 300;
44-
width: 7rem;
45+
max-width: 7rem;
4546
}
4647

4748
.unfollow-button,
4849
.follow-button {
49-
width: 8rem;
50+
max-width: 8rem;
5051
}
5152

5253
.page[data-bs-theme="dark"] .athlete-card {

Tevling/Pages/Activities.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<h1 class="mb-3 title">@Loc["Activities"]</h1>
88

99
<div class="d-flex column-gap-3 mb-3 flex-wrap-reverse flex-row">
10-
<div class="activities me-5">
10+
<div class="activities" style="width:100%">
1111
@{
1212
int step = 0;
1313
}

Tevling/Pages/Profile.razor.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ button {
1919
}
2020

2121
.profile-info {
22+
width: 100%;
2223
margin-right: 13rem;
2324
}
2425

Tevling/Shared/MainLayout.razor.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,25 @@
33
display: flex;
44
flex-direction: column;
55
min-height: 100vh;
6+
min-width: 380px;
67
background-color: var(--bs-body-bg);
78
color: var(--bs-body-color);
89
}
910

1011
.page[data-bs-theme="light"] {
11-
background-color: #eff6fe;
12+
background-color: #fafafa;
1213
}
1314

1415
main {
1516
flex: 1;
17+
overflow: hidden;
1618
}
1719

1820
.sidebar {
1921
background-color: #222;
2022
}
2123

22-
@media (min-width: 641px) {
24+
@media (min-width: 801px) {
2325
.page {
2426
flex-direction: row;
2527
}
@@ -37,7 +39,7 @@ main {
3739
}
3840
}
3941

40-
@media (max-width: 640px) {
42+
@media (max-width: 800px) {
4143
.sidebar {
4244
position: -webkit-sticky;
4345
position: sticky;

Tevling/Shared/NavMenu.razor.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
color: white;
5959
}
6060

61-
@media (min-width: 641px) {
61+
@media (min-width: 801px) {
6262
.navbar-toggler {
6363
display: none;
6464
}
@@ -73,7 +73,7 @@
7373
}
7474
}
7575

76-
@media (max-width: 641px) {
76+
@media (max-width: 801px) {
7777
.top-row {
7878
padding-left: 1rem;
7979
}

0 commit comments

Comments
 (0)