diff --git a/docs/javascripts/cookbooks-card.js b/docs/javascripts/cookbooks-card.js index 596798ba..f2f244ff 100644 --- a/docs/javascripts/cookbooks-card.js +++ b/docs/javascripts/cookbooks-card.js @@ -28,16 +28,15 @@ document.addEventListener("DOMContentLoaded", function () { }, {}); - async function renderCard(element, elementIndex) { - const url = element.getAttribute('data-url'); - const name = element.getAttribute('data-name'); - const labels = element.getAttribute('data-labels'); - const version = element.getAttribute('data-version'); - const authors = element.getAttribute('data-author'); + async function renderCard(element, elementIndex) { + const name = element.getAttribute('data-name'); + const labels = element.getAttribute('data-labels'); + const version = element.getAttribute('data-version'); + const authors = element.getAttribute('data-author'); - const labelHTML = labels ? labels.split(',').filter(label => label !== '').map((label, index) => { - const color = labelToColor[label.trim()]; - return ` + const labelHTML = labels ? labels.split(',').filter(label => label !== '').map((label, index) => { + const color = labelToColor[label.trim()]; + return ` `; - }).join(' ') : ''; + }).join(' ') : ''; - const authorArray = authors.split(','); - const authorDataArray = await Promise.all(authorArray.map(async (author) => { - const response = await fetch(`https://api.github.com/users/${author.trim()}`); - return await response.json(); - })); + const authorArray = authors.split(','); + const authorDataArray = await Promise.all(authorArray.map(async (author) => { + const response = await fetch(`https://api.github.com/users/${author.trim()}`); + return await response.json(); + })); - let authorAvatarsHTML = authorDataArray.map((authorData, index) => { - const marginLeft = index === 0 ? '0' : '-10px'; - const zIndex = 4 - index; - return ` + let authorAvatarsHTML = authorDataArray.map((authorData, index) => { + const marginLeft = index === 0 ? '0' : '-10px'; + const zIndex = 4 - index; + return `
`; - }).join(''); + }).join(''); - let authorNamesHTML = authorDataArray.map( - authorData => ` + let authorNamesHTML = authorDataArray.map( + authorData => ` ` - ).join(', '); + ).join(', '); - let authorsHTML = ` + let authorsHTML = `
${authorAvatarsHTML}
${authorNamesHTML}
- `; + `; - element.innerText = ` - -
-
- - ${name} - -
- ${authorsHTML} -
+ element.innerText = ` +
- -   - ${version} + + ${name} +
-
- ${labelHTML} + ${authorsHTML} +
+
+ +   + ${version} +
+
+ ${labelHTML} +
-
-
- ` + `; - let sanitizedHTML = DOMPurify.sanitize(element.innerText); - element.innerHTML = sanitizedHTML; + let sanitizedHTML = DOMPurify.sanitize(element.innerText); + element.innerHTML = sanitizedHTML; - document.querySelectorAll('.author-name').forEach(element => { - element.addEventListener('mouseenter', function() { - const login = this.getAttribute('data-login'); - document.querySelector(`.author-container[data-login="${login}"]`).classList.add('hover'); + document.querySelectorAll('.author-name').forEach(element => { + element.addEventListener('mouseenter', function () { + const login = this.getAttribute('data-login'); + document.querySelector(`.author-container[data-login="${login}"]`).classList.add('hover'); + }); + + element.addEventListener('mouseleave', function () { + const login = this.getAttribute('data-login'); + document.querySelector(`.author-container[data-login="${login}"]`).classList.remove('hover'); + }); }); - - element.addEventListener('mouseleave', function() { - const login = this.getAttribute('data-login'); - document.querySelector(`.author-container[data-login="${login}"]`).classList.remove('hover'); - }); - }); - } + } repoCards.forEach((element, index) => { renderCard(element, index); }); diff --git a/docs/stylesheets/cookbooks-card.css b/docs/stylesheets/cookbooks-card.css index 118c946c..51b24299 100644 --- a/docs/stylesheets/cookbooks-card.css +++ b/docs/stylesheets/cookbooks-card.css @@ -19,6 +19,16 @@ } } +.custom-grid a { + color: inherit; + text-decoration: none; + display: block; +} + +.custom-grid a:hover { + color: inherit; /* Ensure color does not change on hover */ +} + .repo-card { background: radial-gradient(at right top, #A351FB25, #A5F9EA25); border-radius: 0.5rem; diff --git a/docs/theme/cookbooks.html b/docs/theme/cookbooks.html index 6633db1f..d12de40f 100644 --- a/docs/theme/cookbooks.html +++ b/docs/theme/cookbooks.html @@ -11,17 +11,45 @@

Supervision Cookbooks

-

-

-

-

-

-

-

-

-

-

- +

+
+ +

+
+ +

+
+ +

+
+ +

+
+ +

+
+ +

+
+ +

+
+ +

+
+ +

+