From daa00abeb9a3a6738d68cd6317c4762aebf97e94 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Tue, 31 Jan 2023 10:56:33 -0500 Subject: [PATCH] website: fix overflow and add common js Fixes overflow on small screen width with touch mode enabled (i.e. mobile devices). Additionally adds two common js function (levenshtein_distance.js and ranking_sorter.js). --- dist/discord.html | 4 ++-- dist/feedback.html | 4 ++-- dist/index.html | 4 ++-- dist/js/levenshtein_distance.js | 36 +++++++++++++++++++++++++++++++++ dist/js/projects.js | 27 ++++++++----------------- dist/js/ranking_sorter.js | 18 +++++++++++++++++ dist/privacy.html | 4 ++-- dist/support.html | 2 +- dist/terms.html | 4 ++-- 9 files changed, 73 insertions(+), 30 deletions(-) create mode 100644 dist/js/levenshtein_distance.js create mode 100644 dist/js/ranking_sorter.js diff --git a/dist/discord.html b/dist/discord.html index b9adb17a..c283c252 100644 --- a/dist/discord.html +++ b/dist/discord.html @@ -34,8 +34,8 @@ - -
+ +
diff --git a/dist/feedback.html b/dist/feedback.html index a2b23861..9615e38c 100644 --- a/dist/feedback.html +++ b/dist/feedback.html @@ -34,8 +34,8 @@ - -
+ +
diff --git a/dist/index.html b/dist/index.html index 19c82a6b..3b7bdc4f 100644 --- a/dist/index.html +++ b/dist/index.html @@ -40,7 +40,7 @@ -
+
@@ -268,7 +268,7 @@

-

Donate

+

Donate

b[firstKey]) { - return -1; - } else if (a[firstKey] < b[firstKey]) { - return 1; - } - else { - if (a[secondKey] > b[secondKey]) { - return 1; - } else if (a[secondKey] < b[secondKey]) { - return -1; - } else { - return 0; - } - } - } -} +// load external scripts +$.getScript('https://app.lizardbyte.dev/js/ranking_sorter.js') + + +// get project container container = document.getElementById("project-container") let org_name = "LizardByte" let base_url = `https://app.${org_name.toLowerCase()}.dev` let cache_repo = "uno" -// create project cards + $(document).ready(function(){ // Set cache = false for all jquery ajax requests. $.ajaxSetup({ @@ -31,6 +18,8 @@ $(document).ready(function(){ }); }); + +// create project cards $(document).ready(function(){ // get readthedocs projects let readthedocs = [] diff --git a/dist/js/ranking_sorter.js b/dist/js/ranking_sorter.js new file mode 100644 index 00000000..b0411cdd --- /dev/null +++ b/dist/js/ranking_sorter.js @@ -0,0 +1,18 @@ +let rankingSorter = function (firstKey, secondKey) { + return function(a, b) { + if (a[firstKey] > b[firstKey]) { + return -1; + } else if (a[firstKey] < b[firstKey]) { + return 1; + } + else { + if (a[secondKey] > b[secondKey]) { + return 1; + } else if (a[secondKey] < b[secondKey]) { + return -1; + } else { + return 0; + } + } + } +} diff --git a/dist/privacy.html b/dist/privacy.html index 58c5eccc..5be5e2e6 100644 --- a/dist/privacy.html +++ b/dist/privacy.html @@ -34,8 +34,8 @@ - -
+ +
diff --git a/dist/support.html b/dist/support.html index 6926f3f1..d1ba38e5 100644 --- a/dist/support.html +++ b/dist/support.html @@ -37,7 +37,7 @@ -
+
diff --git a/dist/terms.html b/dist/terms.html index 2f06873e..718a7daa 100644 --- a/dist/terms.html +++ b/dist/terms.html @@ -34,8 +34,8 @@ - -
+ +