resize skillcards by CSS instead of JS
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
.skills-section .card {
|
.skills-section .card {
|
||||||
margin-top: 0.5rem;
|
margin-top: 0.5rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skills-section .card .card-body {
|
.skills-section .card .card-body {
|
||||||
|
|||||||
@@ -63,28 +63,6 @@ var projectCards;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==================== Adjust height of the skills card =============
|
|
||||||
function adjustSkillCardsHeight() {
|
|
||||||
if (!isMobile) { // no need to adjust height for mobile devices
|
|
||||||
// primary skills
|
|
||||||
var skillCards = document.getElementById("primary-skills");
|
|
||||||
if (skillCards != null) {
|
|
||||||
var cardElems = skillCards.getElementsByClassName("card");
|
|
||||||
var maxHeight = 0;
|
|
||||||
for (let i = 0; i < cardElems.length; i++) {
|
|
||||||
if (cardElems.item(i).clientHeight > maxHeight) {
|
|
||||||
maxHeight = cardElems.item(i).clientHeight;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let i = 0; i < cardElems.length; i++) {
|
|
||||||
cardElems.item(i).setAttribute("style", "min-height: " + maxHeight + "px;");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(window).on("load", function () {
|
|
||||||
adjustSkillCardsHeight();
|
|
||||||
});
|
|
||||||
|
|
||||||
// ================== Project cards =====================
|
// ================== Project cards =====================
|
||||||
// Add click action on project category selector buttons
|
// Add click action on project category selector buttons
|
||||||
|
|||||||
Reference in New Issue
Block a user