From 86cafc77f55ee2b42f4602911d322760d8683972 Mon Sep 17 00:00:00 2001 From: Dan Volchek Date: Mon, 23 Apr 2018 01:05:02 -0500 Subject: cool pufferchick on hover --- src/SMAPI.Web/wwwroot/Content/js/index.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/SMAPI.Web/wwwroot/Content/js/index.js (limited to 'src/SMAPI.Web/wwwroot/Content/js/index.js') diff --git a/src/SMAPI.Web/wwwroot/Content/js/index.js b/src/SMAPI.Web/wwwroot/Content/js/index.js new file mode 100644 index 00000000..54fdf6d9 --- /dev/null +++ b/src/SMAPI.Web/wwwroot/Content/js/index.js @@ -0,0 +1,16 @@ +document.addEventListener('DOMContentLoaded', setupHover, false); + +function setupHover() { + var pufferchick = document.getElementById("pufferchick"); + var downloadLinks = document.getElementsByClassName("download"); + + for (var downloadLink of downloadLinks) { + downloadLink.addEventListener("mouseenter", function () { + pufferchick.src = "Content/images/pufferchick-cool.png"; + }); + + downloadLink.addEventListener("mouseleave", function () { + pufferchick.src = "favicon.ico"; + }); + } +} -- cgit From 2bc9184464261f918abe142de566cd82cf565918 Mon Sep 17 00:00:00 2001 From: Dan Volchek Date: Mon, 23 Apr 2018 01:53:32 -0500 Subject: use jQuery --- src/SMAPI.Web/Views/Index/Index.cshtml | 1 + src/SMAPI.Web/wwwroot/Content/js/index.js | 26 ++++++++++---------------- 2 files changed, 11 insertions(+), 16 deletions(-) (limited to 'src/SMAPI.Web/wwwroot/Content/js/index.js') diff --git a/src/SMAPI.Web/Views/Index/Index.cshtml b/src/SMAPI.Web/Views/Index/Index.cshtml index c13c94a5..8ae23a45 100644 --- a/src/SMAPI.Web/Views/Index/Index.cshtml +++ b/src/SMAPI.Web/Views/Index/Index.cshtml @@ -4,6 +4,7 @@ @model StardewModdingAPI.Web.ViewModels.IndexModel @section Head { + } diff --git a/src/SMAPI.Web/wwwroot/Content/js/index.js b/src/SMAPI.Web/wwwroot/Content/js/index.js index 54fdf6d9..c53592f8 100644 --- a/src/SMAPI.Web/wwwroot/Content/js/index.js +++ b/src/SMAPI.Web/wwwroot/Content/js/index.js @@ -1,16 +1,10 @@ -document.addEventListener('DOMContentLoaded', setupHover, false); - -function setupHover() { - var pufferchick = document.getElementById("pufferchick"); - var downloadLinks = document.getElementsByClassName("download"); - - for (var downloadLink of downloadLinks) { - downloadLink.addEventListener("mouseenter", function () { - pufferchick.src = "Content/images/pufferchick-cool.png"; - }); - - downloadLink.addEventListener("mouseleave", function () { - pufferchick.src = "favicon.ico"; - }); - } -} +$(document).ready(function () { + var pufferchick = $("#pufferchick"); + $(".download").each(function (index, element) { + $(element).hover(function () { + pufferchick.attr("src", "Content/images/pufferchick-cool.png"); + }, function () { + pufferchick.attr("src", "favicon.ico"); + }) + }); +}); -- cgit From 82f418a38baeb44f68601708ebbd3c4af03ef6da Mon Sep 17 00:00:00 2001 From: Dan Volchek Date: Mon, 23 Apr 2018 01:58:18 -0500 Subject: add missing semicolon --- src/SMAPI.Web/wwwroot/Content/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/SMAPI.Web/wwwroot/Content/js/index.js') diff --git a/src/SMAPI.Web/wwwroot/Content/js/index.js b/src/SMAPI.Web/wwwroot/Content/js/index.js index c53592f8..46f78fbe 100644 --- a/src/SMAPI.Web/wwwroot/Content/js/index.js +++ b/src/SMAPI.Web/wwwroot/Content/js/index.js @@ -5,6 +5,6 @@ $(document).ready(function () { pufferchick.attr("src", "Content/images/pufferchick-cool.png"); }, function () { pufferchick.attr("src", "favicon.ico"); - }) + }); }); }); -- cgit From 371d7fa05317f107f7b97a7b5db93e176039418d Mon Sep 17 00:00:00 2001 From: Dan Volchek Date: Mon, 23 Apr 2018 02:01:14 -0500 Subject: use implicit iteration instead --- src/SMAPI.Web/wwwroot/Content/js/index.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/SMAPI.Web/wwwroot/Content/js/index.js') diff --git a/src/SMAPI.Web/wwwroot/Content/js/index.js b/src/SMAPI.Web/wwwroot/Content/js/index.js index 46f78fbe..ac05df05 100644 --- a/src/SMAPI.Web/wwwroot/Content/js/index.js +++ b/src/SMAPI.Web/wwwroot/Content/js/index.js @@ -1,10 +1,8 @@ $(document).ready(function () { var pufferchick = $("#pufferchick"); - $(".download").each(function (index, element) { - $(element).hover(function () { - pufferchick.attr("src", "Content/images/pufferchick-cool.png"); - }, function () { - pufferchick.attr("src", "favicon.ico"); - }); + $(".download").hover(function () { + pufferchick.attr("src", "Content/images/pufferchick-cool.png"); + }, function () { + pufferchick.attr("src", "favicon.ico"); }); }); -- cgit From cd3dbc47aa6e112d8695bcb9ed81f0b422f21e5c Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 25 Apr 2018 12:11:28 -0400 Subject: update release notes, tweak formatting (#477) --- docs/release-notes.md | 3 +++ src/SMAPI.Web/wwwroot/Content/js/index.js | 13 ++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src/SMAPI.Web/wwwroot/Content/js/index.js') diff --git a/docs/release-notes.md b/docs/release-notes.md index 38a8b00d..308007bb 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -18,6 +18,9 @@ * **Breaking change**: dropped some deprecated APIs. * **Breaking change**: mods can't intercept chatbox input, including the game's hotkey to toggle the chatbox (default `T`). +* For the log parser: + * The pufferchick is now more stylish. + * For SMAPI developers: * Added more consistent crossplatform handling using a new `EnvironmentUtility`. * Added MacOS detection. diff --git a/src/SMAPI.Web/wwwroot/Content/js/index.js b/src/SMAPI.Web/wwwroot/Content/js/index.js index ac05df05..016d5fa4 100644 --- a/src/SMAPI.Web/wwwroot/Content/js/index.js +++ b/src/SMAPI.Web/wwwroot/Content/js/index.js @@ -1,8 +1,11 @@ $(document).ready(function () { var pufferchick = $("#pufferchick"); - $(".download").hover(function () { - pufferchick.attr("src", "Content/images/pufferchick-cool.png"); - }, function () { - pufferchick.attr("src", "favicon.ico"); - }); + $(".download").hover( + function () { + pufferchick.attr("src", "Content/images/pufferchick-cool.png"); + }, + function () { + pufferchick.attr("src", "favicon.ico"); + } + ); }); -- cgit From c9a6d327110806d20877c477095238846a8d83bf Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 16 Jun 2018 01:11:13 -0400 Subject: update web UI to let players download from new Nexus page (#547) --- docs/release-notes.md | 5 +- src/SMAPI.Web/Views/Index/Index.cshtml | 21 ++++++-- src/SMAPI.Web/wwwroot/Content/css/index.css | 55 ++++++++++++++++++++- .../Content/images/direct-download-icon.png | Bin 0 -> 250 bytes .../wwwroot/Content/images/nexus-icon.png | Bin 0 -> 927 bytes src/SMAPI.Web/wwwroot/Content/js/index.js | 25 +++++++++- 6 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 src/SMAPI.Web/wwwroot/Content/images/direct-download-icon.png create mode 100644 src/SMAPI.Web/wwwroot/Content/images/nexus-icon.png (limited to 'src/SMAPI.Web/wwwroot/Content/js/index.js') diff --git a/docs/release-notes.md b/docs/release-notes.md index 152037f8..5bb77762 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -59,9 +59,10 @@ * Fixed `world_setseason` not normalising the season value. * For the web UI: - * Redesigned log parser upload page to make it more intuitive for new players. - * Changed log parser filters to show `DEBUG` messages by default. + * Improved log parser design to make it more intuitive. * Improved layout on small screens. + * Added option to download from Nexus. + * Changed log parser filters to show `DEBUG` messages by default. * Fixed log parser issue when content packs have no description. * Fixed log parser mangling crossplatform paths in some cases. diff --git a/src/SMAPI.Web/Views/Index/Index.cshtml b/src/SMAPI.Web/Views/Index/Index.cshtml index 0f056ada..fbfc2239 100644 --- a/src/SMAPI.Web/Views/Index/Index.cshtml +++ b/src/SMAPI.Web/Views/Index/Index.cshtml @@ -3,9 +3,9 @@ } @model StardewModdingAPI.Web.ViewModels.IndexModel @section Head { - + - + }

@@ -15,10 +15,23 @@

- Download SMAPI @Model.StableVersion.Version
+
+ @if (Model.BetaVersion != null) { - Download SMAPI @Model.BetaVersion.Version
for Stardew Valley 1.3 beta

+
} Player guide
diff --git a/src/SMAPI.Web/wwwroot/Content/css/index.css b/src/SMAPI.Web/wwwroot/Content/css/index.css index 6340ed87..514e1a5c 100644 --- a/src/SMAPI.Web/wwwroot/Content/css/index.css +++ b/src/SMAPI.Web/wwwroot/Content/css/index.css @@ -18,7 +18,8 @@ h1 { text-align: center; } -#call-to-action a { +#call-to-action a.main-cta, +#call-to-action a.secondary-cta { box-shadow: #caefab 0 1px 0 0 inset; background: linear-gradient(#77d42a 5%, #5cb811 100%) #77d42a; border-radius: 6px; @@ -40,6 +41,58 @@ h1 { text-shadow: #2b665e 0 1px 0; } +.cta-dropdown { + position: relative; + display: inline-block; + margin-bottom: 1em; +} + +.cta-dropdown a.download { + margin-bottom: 0 !important; +} + +.cta-dropdown .dropdown-content { + display: none; + position: absolute; + text-align: left; + box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2); + border: 1px solid #566963; + background: #5cb811; + border-top: 0; + border-radius: 0 0 6px 6px; + margin-top: -6px; + z-index: 1; +} + +.cta-dropdown .dropdown-content a:hover { + background-color: #ddd; +} + +.cta-dropdown .dropdown-content img { + width: 0.85em; + height: 0.85em; +} + +.cta-dropdown.secondary-cta-dropdown .dropdown-content a:hover { + background-color: #566963; +} + +.cta-dropdown.secondary-cta-dropdown .dropdown-content { + background-color: #768d87; + border-color: #566963; +} + +.cta-dropdown.secondary-cta-dropdown .dropdown-content a { + color: #fff; + text-shadow: #2b665e 0 1px 0; +} + +.cta-dropdown .dropdown-content a { + padding: 0.75em 1em; + text-decoration: none; + display: block; +} + /********* ** Subsections *********/ diff --git a/src/SMAPI.Web/wwwroot/Content/images/direct-download-icon.png b/src/SMAPI.Web/wwwroot/Content/images/direct-download-icon.png new file mode 100644 index 00000000..6c30ca36 Binary files /dev/null and b/src/SMAPI.Web/wwwroot/Content/images/direct-download-icon.png differ diff --git a/src/SMAPI.Web/wwwroot/Content/images/nexus-icon.png b/src/SMAPI.Web/wwwroot/Content/images/nexus-icon.png new file mode 100644 index 00000000..10c66712 Binary files /dev/null and b/src/SMAPI.Web/wwwroot/Content/images/nexus-icon.png differ diff --git a/src/SMAPI.Web/wwwroot/Content/js/index.js b/src/SMAPI.Web/wwwroot/Content/js/index.js index 016d5fa4..8fa1c26f 100644 --- a/src/SMAPI.Web/wwwroot/Content/js/index.js +++ b/src/SMAPI.Web/wwwroot/Content/js/index.js @@ -1,6 +1,7 @@ $(document).ready(function () { + /* enable pufferchick */ var pufferchick = $("#pufferchick"); - $(".download").hover( + $(".cta-dropdown").hover( function () { pufferchick.attr("src", "Content/images/pufferchick-cool.png"); }, @@ -8,4 +9,26 @@ $(document).ready(function () { pufferchick.attr("src", "favicon.ico"); } ); + + /* enable download dropdowns */ + $(".cta-dropdown a.download").each(function(i, button) { + button = $(button); + var wrapper = button.parent(".cta-dropdown"); + var button = wrapper.find(".download"); + var dropdownContent = wrapper.find(".dropdown-content"); + + $(window).on("click", function(e) { + var target = $(e.target); + + // toggle dropdown on button click + if (target.is(button) || $.contains(button.get(0), target.get(0))) { + e.preventDefault(); + dropdownContent.toggle(); + } + + // else hide dropdown + else + dropdownContent.hide(); + }); + }); }); -- cgit From f1bdafde238280b771abb1d74ae780b6b86bdc79 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 16 Jun 2018 01:13:39 -0400 Subject: use sharper pufferchick images --- src/SMAPI.Web/Views/Index/Index.cshtml | 2 +- .../wwwroot/Content/images/pufferchick-cool.png | Bin 2921 -> 1099 bytes src/SMAPI.Web/wwwroot/Content/images/pufferchick.png | Bin 0 -> 831 bytes src/SMAPI.Web/wwwroot/Content/js/index.js | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 src/SMAPI.Web/wwwroot/Content/images/pufferchick.png (limited to 'src/SMAPI.Web/wwwroot/Content/js/index.js') diff --git a/src/SMAPI.Web/Views/Index/Index.cshtml b/src/SMAPI.Web/Views/Index/Index.cshtml index fbfc2239..8145d354 100644 --- a/src/SMAPI.Web/Views/Index/Index.cshtml +++ b/src/SMAPI.Web/Views/Index/Index.cshtml @@ -34,7 +34,7 @@

} Player guide
- +

Get help

diff --git a/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.png b/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.png index 63eb8970..f359146c 100644 Binary files a/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.png and b/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.png differ diff --git a/src/SMAPI.Web/wwwroot/Content/images/pufferchick.png b/src/SMAPI.Web/wwwroot/Content/images/pufferchick.png new file mode 100644 index 00000000..1de9cf47 Binary files /dev/null and b/src/SMAPI.Web/wwwroot/Content/images/pufferchick.png differ diff --git a/src/SMAPI.Web/wwwroot/Content/js/index.js b/src/SMAPI.Web/wwwroot/Content/js/index.js index 8fa1c26f..d0734b02 100644 --- a/src/SMAPI.Web/wwwroot/Content/js/index.js +++ b/src/SMAPI.Web/wwwroot/Content/js/index.js @@ -6,7 +6,7 @@ $(document).ready(function () { pufferchick.attr("src", "Content/images/pufferchick-cool.png"); }, function () { - pufferchick.attr("src", "favicon.ico"); + pufferchick.attr("src", "Content/images/pufferchick.png"); } ); -- cgit