-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
155 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[ | ||
{ | ||
"name": "Linux Foundation Offerings", | ||
"logo": "../../../../images/linuxfoundation.png", | ||
"description": "Use the coupon KUBEFLEX30 to get 30% off on ANY Linux Foundation training or certification", | ||
"category": "Education", | ||
"url": "https://shareasale.com/r.cfm?b=734319&u=4386404&m=59485&urllink=&afftrack=", | ||
"promotion": "30% off", | ||
"affiliate": true | ||
} | ||
] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
document$.subscribe(function () { | ||
const container = document.getElementById("certifications-container"); | ||
const filter = document.getElementById("filter"); | ||
const baseURL = window.location.origin + "/"; | ||
|
||
fetch(baseURL + "certifications.json") | ||
.then(response => response.json()) | ||
.then(grantors => { | ||
function displaygrantors(filteredgrantors) { | ||
container.innerHTML = ""; | ||
filteredgrantors.forEach(grantor => { | ||
const tile = document.createElement("div"); | ||
tile.className = "grantor-tile"; | ||
|
||
const logo = document.createElement("img"); | ||
logo.src = baseURL + grantor.logo; | ||
logo.alt = `${grantor.name} logo`; | ||
|
||
const name = document.createElement("h3"); | ||
name.textContent = grantor.name; | ||
|
||
const description = document.createElement("p"); | ||
description.textContent = grantor.description; | ||
|
||
const promotion = document.createElement("div"); | ||
promotion.className = "offer"; | ||
promotion.textContent = grantor.promotion; | ||
|
||
const seeMore = document.createElement("div"); | ||
seeMore.className = "see-more"; | ||
|
||
// Create heart icon if the grantor is an affiliate | ||
if (grantor.affiliate) { | ||
const heartIcon = document.createElement("span"); | ||
heartIcon.className = "heart"; | ||
heartIcon.innerHTML = `❤️`; // Use an emoji or a heart icon | ||
seeMore.appendChild(heartIcon); | ||
} | ||
|
||
const seeMoreLink = document.createElement("a"); | ||
seeMoreLink.href = grantor.url; | ||
seeMoreLink.textContent = "See more"; | ||
seeMore.appendChild(seeMoreLink); | ||
|
||
tile.appendChild(logo); | ||
tile.appendChild(name); | ||
tile.appendChild(description); | ||
tile.appendChild(promotion); | ||
tile.appendChild(seeMore); | ||
|
||
container.appendChild(tile); | ||
}); | ||
} | ||
|
||
filter.addEventListener("change", function () { | ||
const selectedCategory = filter.value; | ||
const filteredgrantors = selectedCategory === "All" ? grantors : grantors.filter(grantor => grantor.category === selectedCategory); | ||
displaygrantors(filteredgrantors); | ||
}); | ||
|
||
// Initial display | ||
displaygrantors(grantors); | ||
}) | ||
.catch(error => console.error("Error fetching grantors:", error)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
document$.subscribe(function () { | ||
const container = document.getElementById("trainings-container"); | ||
const filter = document.getElementById("filter"); | ||
const baseURL = window.location.origin + "/"; | ||
|
||
fetch(baseURL + "trainings.json") | ||
.then(response => response.json()) | ||
.then(grantors => { | ||
function displaygrantors(filteredgrantors) { | ||
container.innerHTML = ""; | ||
filteredgrantors.forEach(grantor => { | ||
const tile = document.createElement("div"); | ||
tile.className = "grantor-tile"; | ||
|
||
const logo = document.createElement("img"); | ||
logo.src = baseURL + grantor.logo; | ||
logo.alt = `${grantor.name} logo`; | ||
|
||
const name = document.createElement("h3"); | ||
name.textContent = grantor.name; | ||
|
||
const description = document.createElement("p"); | ||
description.textContent = grantor.description; | ||
|
||
const promotion = document.createElement("div"); | ||
promotion.className = "offer"; | ||
promotion.textContent = grantor.promotion; | ||
|
||
const seeMore = document.createElement("div"); | ||
seeMore.className = "see-more"; | ||
|
||
// Create heart icon if the grantor is an affiliate | ||
if (grantor.affiliate) { | ||
const heartIcon = document.createElement("span"); | ||
heartIcon.className = "heart"; | ||
heartIcon.innerHTML = `❤️`; // Use an emoji or a heart icon | ||
seeMore.appendChild(heartIcon); | ||
} | ||
|
||
const seeMoreLink = document.createElement("a"); | ||
seeMoreLink.href = grantor.url; | ||
seeMoreLink.textContent = "See more"; | ||
seeMore.appendChild(seeMoreLink); | ||
|
||
tile.appendChild(logo); | ||
tile.appendChild(name); | ||
tile.appendChild(description); | ||
tile.appendChild(promotion); | ||
tile.appendChild(seeMore); | ||
|
||
container.appendChild(tile); | ||
}); | ||
} | ||
|
||
filter.addEventListener("change", function () { | ||
const selectedCategory = filter.value; | ||
const filteredgrantors = selectedCategory === "All" ? grantors : grantors.filter(grantor => grantor.category === selectedCategory); | ||
displaygrantors(filteredgrantors); | ||
}); | ||
|
||
// Initial display | ||
displaygrantors(grantors); | ||
}) | ||
.catch(error => console.error("Error fetching grantors:", error)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[ | ||
{ | ||
"name": "Linux Foundation Offerings", | ||
"logo": "../../../../images/linuxfoundation.png", | ||
"description": "Use the coupon KUBEFLEX30 to get 30% off on ANY Linux Foundation training or certification", | ||
"category": "Education", | ||
"url": "https://shareasale.com/r.cfm?b=734319&u=4386404&m=59485&urllink=&afftrack=", | ||
"promotion": "30% off", | ||
"affiliate": true | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters