From ffd7e73fa393eee4d22cb5ad6f527ad969f3e9e0 Mon Sep 17 00:00:00 2001 From: Jacob Kirkbride Date: Sun, 12 Nov 2023 22:20:44 -0500 Subject: [PATCH 1/8] Add showcase filtering logic --- scripts/showcase-filters.js | 68 ++++++++++++++++++++++++++++ showcase.md | 89 ++++++++++++++++++++++++------------- 2 files changed, 126 insertions(+), 31 deletions(-) create mode 100644 scripts/showcase-filters.js diff --git a/scripts/showcase-filters.js b/scripts/showcase-filters.js new file mode 100644 index 00000000..6c6338d8 --- /dev/null +++ b/scripts/showcase-filters.js @@ -0,0 +1,68 @@ +var tags = [ + {"name":"sor4","tags":["2D","Console","PlayStation4","XboxOne","NintendoSwitch","Featured"]}, + {"name":"paladin","tags":["2D","Console","Mac","Linux","Desktop","XboxOne","NintendoSwitch","Featured"]}, + {"name":"fhook","tags":["2D","Console","PlayStation4","XboxOne","NintendoSwitch","Featured"]}, + {"name":"mkings","tags":["2D","Console","PlayStation4","XboxOne","NintendoSwitch","PSVita"]}, + {"name":"goat2","tags":["2D","Console","PlayStation4"]}, + {"name":"daryl","tags":["2D","Console","PlayStation4","NintendoSwitch","Featured"]}, + {"name":"chasm","tags":["2D","Console","PlayStation4","PSVita","NintendoSwitch","Featured"]}, + {"name":"celeste","tags":["2D","Console","XboxOne","NintendoSwitch","PlayStation4","Featured"]}, + {"name":"rblob","tags":["2D","Android","Console","Desktop","Linux","Mac","Mobile","Windows","XboxOne"]}, + {"name":"bta","tags":["2D","3D","Desktop","Windows"]}, + {"name":"armed","tags":["3D","Desktop","Mobile","Windows","WindowsPhone"]}, + {"name":"redungeon","tags":["Mobile","iOS","Android","Featured"]}, + {"name":"squareheroes","tags":["Console","PlayStation4","Featured"]}, + {"name":"wayward","tags":["Windows","Desktop","Featured"]}, + {"name":"bastion","tags":["Console","Desktop","Mac","PlayStation4"]}, + {"name":"fez","tags":["Desktop","Linux","Mac"]}, + {"name":"skulls","tags":["Console","PlayStation4","Mobile","Android","Featured"]}, + {"name":"ty","tags":["Desktop","Windows","2D","Featured"]}, + {"name":"hockey","tags":["Console","PlayStation4","XboxOne","3D","Featured"]}, + {"name":"flight","tags":["iOS","Android","Mobile","3D","Featured"]}, + {"name":"neurovoider","tags":["Windows","Mac","Linux","XboxOne","PlayStation4","PSVita","NintendoSwitch","2D","Desktop","Console","Featured"]}, + {"name":"apotheon","tags":["PlayStation4","2D","Console","Featured"]}, + {"name":"axiom","tags":["PlayStation4","XboxOne","NintendoSwitch","PSVita","2D","Console","Featured"]}, + {"name":"towerfall","tags":["PlayStation4","XboxOne","NintendoSwitch","PSVita","2D","Console","Featured"]}, + {"name":"stardew","tags":["PlayStation4","XboxOne","NintendoSwitch","PSVita","2D","Console","Mac","Linux","Desktop","Featured"]}, + {"name":"bleed2","tags":["2D","Console","NintendoSwitch","PlayStation4","XboxOne"]}, + {"name":"bleed","tags":["2D","Console","NintendoSwitch","PlayStation4","XboxOne"]}, + {"name":"toothandtail","tags":["PlayStation4","Windows","2D","Console","Desktop","Featured"]}, + {"name":"mgforms","tags":["Library","Linux","Windows"]} +]; + +function init_filter() { + var data = window.top.location.search; + if(data != null && data !="") + { + var elements = document.getElementsByClassName('showcase-link-image'); + // Hide all first if a filter was selected + for (var i = 0; i < elements.length; i++) { + elements[i].style.display = 'none'; + } + + for (var i = 0; i < tags.length; i++) { + if (tags[i].tags.includes(removeQuestionmark(data))) { + var name = tags[i].name; + var element = document.getElementById(name); + if (element) { + element.style.display = 'block'; + } + } + } + + } else { + console.log("No data"); + } +} + +function removeQuestionmark(str) { + var pattern = /\?/; + var result = pattern.exec(str); + if (result != null) { + return str.replace('?', ''); + } else { + return str; + } +} + +init_filter(); \ No newline at end of file diff --git a/showcase.md b/showcase.md index f197a4b7..a278b611 100644 --- a/showcase.md +++ b/showcase.md @@ -3,184 +3,211 @@ _title: Showcase _description: A list of big hits to small gem titles created using MonoGame. --- +

There have been 1000s of games, libraries, and tools made using MonoGame over the years.

-

We have gathered a taste of those titles here from the big hits to the small hidden gems.

+

We have gathered a taste of those titles here from the big hits to the small hidden gems. Just select one of the tags below to filter the results.

If you are a developer and would like us to add your game to this list, please submit a GitHub Issue using the Showcase Submission template

+

+ +
+ All   + Featured   + Desktop   + Mobile   + Console   + 2D   + 3D   + Windows   + Mac   + Linux   + iOS   + Android   + WindowsPhone   + NintendoSwitch   + PlayStation4   + XboxOne   + PSVita   + Library   +
+
+
-