align recent post height via css

This commit is contained in:
Aaron Qian 2022-11-11 11:08:02 -08:00 committed by Aaron Qian
parent a06ee73c4a
commit 954507a20d
No known key found for this signature in database
GPG key ID: BF1A987C395B5B0E
2 changed files with 5 additions and 21 deletions

View file

@ -8,6 +8,11 @@
display: block;
}
.recent-posts-section .card {
height: 100%;
min-height: 100%;
}
.recent-posts-section .card .card-footer span {
font-size: 10pt;
color: #6c757d !important;

View file

@ -73,27 +73,6 @@ var projectCards, publicationCards;
}
showGithubStars();
// ==================== Adjust height of the recent-posts card =============
function adjustRecentPostsHeight() {
if (!isMobile) { // no need to adjust height for mobile devices
let recentPostCards = document.getElementById("recent-post-cards")
if (recentPostCards != null) {
let el = recentPostCards.children;
let maxHeight = 0;
for (let i = 0; i < el.length; i++) {
if (el[i].children[1].clientHeight > maxHeight) {
maxHeight = el[i].children[1].clientHeight;
}
}
for (let i = 0; i < el.length; i++) {
el[i].children[1].setAttribute("style", "min-height: " + maxHeight + "px;")
}
}
}
}
adjustRecentPostsHeight();
// =============== Achievements ===========
function fourColumRow(gallery, entries, i) {