Skip to content

Commit

Permalink
update website to add version tags
Browse files Browse the repository at this point in the history
  • Loading branch information
annacrombie committed Sep 24, 2024
1 parent 24b9d1d commit 0ad2a35
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
19 changes: 17 additions & 2 deletions doc/website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,29 @@
}

function renderReleases(list) {
function versionTag(type) {
var e = document.createElement("span");
e.classList.add("version-tag");
e.classList.add(`version-tag-${type}`);
e.innerHTML = type;
return e;
}

sortReleases(list);

list.forEach((e) => {
list.forEach((e, i) => {
var elem = document.createElement("details");
downloadsElement.appendChild(elem);

var summary = document.createElement("summary");
summary.innerHTML = e.ver;
var summaryTitle = document.createElement("span");
summaryTitle.innerHTML = e.ver;
summary.appendChild(summaryTitle);
if (i == 0) {
summary.appendChild(versionTag("edge"));
} else if (i == 1) {
summary.appendChild(versionTag("released"));
}
elem.appendChild(summary);

var ul = document.createElement("ul");
Expand Down
34 changes: 34 additions & 0 deletions doc/website/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,37 @@ nav div {
transform: rotate(360deg);
}
}

summary {
display: flex;
flex-direction: row;
justify-content: flex-start;
width: 100%;
margin-bottom: 5px;
}

summary:hover {
background-color: #21222C;
}

.version-tag {
margin-left: 3px;
font-size: 10px;
border-radius: 40% / 100%;
padding: 1px;
min-width: 40px;
text-align: center;
vertical-align: middle;
line-height: 18px;
}

.version-tag-edge {
color: #282A36;
background-color: #FFB86C;
}

.version-tag-released {
color: #282A36;
background-color: #50FA7B;
}

0 comments on commit 0ad2a35

Please sign in to comment.