From a273ec9a88d77f239d0b4142d407481e80682459 Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 5 Jun 2024 22:58:49 +0100 Subject: [PATCH] Display colours in a row on desktop --- index.html | 65 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 16 deletions(-) diff --git a/index.html b/index.html index 28af737..317c46b 100644 --- a/index.html +++ b/index.html @@ -11,7 +11,7 @@ @@ -61,26 +67,32 @@

QR Code Generator

-
- - -
-
- - +
+
+ + +
+
+ + +
@@ -176,10 +188,31 @@

QR Code Generator

} } - $("#create-button").on("click", generateCode); - // $("#download-png").on("click", () => download("png")); - $("#download-svg").on("click", () => download("svg")); + $(document).ready(function () { + $("#create-button").on("click", generateCode); + // $("#download-png").on("click", () => download("png")); + $("#download-svg").on("click", () => download("svg")); + + $("[data-collapse-button]").each(function () { + const target = $($(this).data("target")); + const chevronIcon = $(this).find("[data-chevron-icon]"); + + updateChevronIcon(); + + target.on("shown.bs.collapse hidden.bs.collapse", function () { + updateChevronIcon(); + }); + + function updateChevronIcon() { + if (target.hasClass("show")) { + chevronIcon.removeClass("fa-chevron-down").addClass("fa-chevron-up"); + } else { + chevronIcon.removeClass("fa-chevron-up").addClass("fa-chevron-down"); + } + } + }); + }); - + \ No newline at end of file