Skip to content

Commit 92131b9

Browse files
committed
fix widths of logos and status
1 parent 0e733e4 commit 92131b9

File tree

1 file changed

+48
-32
lines changed

1 file changed

+48
-32
lines changed

custom/layouts/open-source.njk

Lines changed: 48 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
margin: 0;
1717
padding: 0;
1818
}
19-
2019
.project {
2120
width: 48%; /* Full width for each project */
2221
padding: 15px;
@@ -33,69 +32,87 @@
3332
flex-direction: column;
3433
gap: 10px;
3534
}
36-
3735
.project:hover {
3836
cursor: pointer;
3937
border-color: #bbb;
4038
}
41-
4239
.project-header {
4340
display: flex;
4441
align-items: center;
4542
justify-content: space-between;
4643
margin-bottom: 10px;
4744
}
48-
45+
.logo-container {
46+
width: 120px;
47+
height: 50px;
48+
display: flex;
49+
align-items: center;
50+
justify-content: flex-end; /* Right align the logo */
51+
flex-shrink: 0; /* Prevent logo container from shrinking */
52+
margin-left: 10px; /* Add some space between text and logo */
53+
}
4954
.project-logo {
50-
max-height: 50px;
55+
max-width: 100%;
56+
max-height: 100%;
5157
object-fit: contain;
52-
margin-right: 2px;
5358
}
5459
60+
.project-info {
61+
flex-grow: 1;
62+
overflow: hidden; /* Prevent text from overflowing */
63+
}
5564
.project-name {
5665
font-size: 20px;
5766
font-weight: bold;
58-
flex-grow: 1;
67+
white-space: nowrap;
68+
overflow: hidden;
69+
text-overflow: ellipsis;
5970
}
60-
6171
.project-description {
6272
font-size: 14px;
6373
}
64-
6574
.project-details {
6675
display: flex;
6776
justify-content: flex-start;
6877
gap: 20px; /* Add space between details */
6978
font-size: 12px;
7079
color: #666;
7180
}
72-
7381
/* Fixed widths for consistent vertical alignment */
7482
.project-details .language {
7583
width: 50px; /* Fixed width for language */
7684
}
77-
78-
.project-details .stars, .project-details .forks {
85+
.project-details .stars {
7986
width: 30px; /* Fixed width for stars and forks */
8087
}
81-
88+
.project-details .forks {
89+
width: 30px; /* Fixed width for stars and forks */
90+
justify-content: flex-start;
91+
}
8292
.project-details span {
8393
display: flex;
8494
align-items: center;
8595
gap: 5px;
8696
justify-content: space-between;
8797
}
88-
98+
/* Only change the styles for the fork count text */
99+
.project-details .forks span {
100+
justify-content: flex-start; /* Left-align the text */
101+
padding-left: 2px; /* Add a bit of padding */
102+
}
103+
.project-details .forks span span {
104+
text-align: left;
105+
}
89106
.project-details i {
90107
color: #333;
108+
width: 12px; /* Fixed width for icons */
109+
text-align: center; /* Center the icon */
91110
}
92-
93111
@media (max-width: 800px) {
94112
.project {
95113
width: calc(100% - 20px); /* Full width on smaller screens */
96114
margin: 0 auto;
97115
}
98-
99116
/* Remove fixed widths on smaller screens for flexibility */
100117
.project-details .language,
101118
.project-details .stars,
@@ -116,27 +133,26 @@
116133
{% if section.description %}
117134
<p>{{ section.description }}</p>
118135
{% endif %}
119-
120136
<div class="project-container">
121137
{% for item in section.items %}
122138
<a href="{{ item.url or item.github_url }}" class="project" data-repo="{{ item.github_url }}">
123139
<div class="project-header">
124-
<span>
125-
<div class="project-name">{{ item.name }}</div>
126-
{% if item.github_url %}
127-
<div class="project-details">
128-
<!-- Fixed width for consistent alignment, using FontAwesome icons -->
129-
<span class="language"><i class="fas fa-code"></i> <span id="{{ item.name | lower | replace(' ', '-') }}-language">...</span></span>
130-
<span class="stars"><i class="far fa-star"></i> <span id="{{ item.name | lower | replace(' ', '-') }}-stars">...</span></span>
131-
<span class="forks"><i class="fas fa-code-branch"></i> <span id="{{ item.name | lower | replace(' ', '-') }}-forks">...</span></span>
140+
<div class="project-info">
141+
<div class="project-name">{{ item.name }}</div>
142+
{% if item.github_url %}
143+
<div class="project-details">
144+
<!-- Fixed width for consistent alignment, using FontAwesome icons -->
145+
<span class="language"><i class="fas fa-code"></i> <span id="{{ item.name | lower | replace(' ', '-') }}-language">...</span></span>
146+
<span class="stars"><i class="far fa-star"></i> <span id="{{ item.name | lower | replace(' ', '-') }}-stars">...</span></span>
147+
<span class="forks"><i class="fas fa-code-branch"></i> <span id="{{ item.name | lower | replace(' ', '-') }}-forks">...</span></span>
148+
</div>
149+
{% endif %}
132150
</div>
133-
{% endif %}
134-
</span>
135-
{% if item.logo %}
136-
<span style="width: {{ item.logo_scale or '100%' }}">
137-
<img src="{{ item.logo }}" alt="{{ item.name }} logo" class="project-logo">
138-
</span>
139-
{% endif %}
151+
{% if item.logo %}
152+
<div class="logo-container">
153+
<img src="{{ item.logo }}" alt="{{ item.name }} logo" class="project-logo">
154+
</div>
155+
{% endif %}
140156
</div>
141157
<div class="project-description">{{ item.description }}</div>
142158
</a>

0 commit comments

Comments
 (0)