From 4a4befa2c5f2906390b83b4c7ace0a6a329b7d64 Mon Sep 17 00:00:00 2001 From: Neil Brommer Date: Wed, 13 Dec 2017 19:50:55 -0800 Subject: [PATCH] Add a background color to the navbar toggler, better button colors --- index.html | 10 +++++----- js/main.js | 10 ++++++---- main.css | 8 ++++++++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index f3fc573..28959e4 100644 --- a/index.html +++ b/index.html @@ -24,16 +24,16 @@ diff --git a/js/main.js b/js/main.js index 9c04c84..8667594 100644 --- a/js/main.js +++ b/js/main.js @@ -35,12 +35,14 @@ function calcBackground() { function setBackground(num, dark) { $("body").css("background-image", "url(img/" + num + ".png)"); + // dark is a boolean that indicates the brightness of the background + if (dark) { - $(".btn-light").removeClass("btn-light").addClass("btn-dark"); - $(".navbar").removeClass("navbar-light").addClass("navbar-dark"); - } else { - $(".btn-dark").removeClass("btn-dark").addClass("btn-light"); $(".navbar").removeClass("navbar-dark").addClass("navbar-light"); + $(".navbar-toggler").removeClass("toggler-bg-dark btn-dark").addClass("toggler-bg-light btn-light"); + } else { + $(".navbar").removeClass("navbar-light").addClass("navbar-dark"); + $(".navbar-toggler").removeClass("toggler-bg-light btn-light").addClass("toggler-bg-dark btn-dark"); } } diff --git a/main.css b/main.css index 169a3b5..b1b2469 100644 --- a/main.css +++ b/main.css @@ -50,6 +50,14 @@ pre { margin-right: 50px; } +.toggler-bg-dark { + background: rgba(0, 0, 0, 0.24); +} + +.toggler-bg-light { + background: rgba(255, 255, 255, 0.24); +} + /* set the width of the main container based on element width */ @media (max-width: 34em) { #wrapper {