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/Views/Index/Index.cshtml | 7 ++++--- .../wwwroot/Content/images/pufferchick-cool.png | Bin 0 -> 2921 bytes src/SMAPI.Web/wwwroot/Content/js/index.js | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.png create mode 100644 src/SMAPI.Web/wwwroot/Content/js/index.js (limited to 'src/SMAPI.Web') diff --git a/src/SMAPI.Web/Views/Index/Index.cshtml b/src/SMAPI.Web/Views/Index/Index.cshtml index 4efb9f8a..c13c94a5 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 { + }

@@ -13,14 +14,14 @@

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

+ Download SMAPI @Model.BetaVersion.Version
for Stardew Valley 1.3 beta

} Install guide
FAQs
- +

Get help

diff --git a/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.png b/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.png new file mode 100644 index 00000000..63eb8970 Binary files /dev/null and b/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.png differ 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