Skip to content

Commit

Permalink
bootstrap to 5.3.3, dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kolappannathan committed Jul 30, 2024
1 parent cf26425 commit a7b3fda
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@ A cookie banner for websites using Bootstrap 5.

## Screenshot

![Demo image](./demo/demo.jpg)
*Light mode*

![Demo image](./demo/light-mode.png)

*Dark mode*

![Demo image](./demo/dark-mode.png)
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## [4.0.0] - 2024-07-30
### Changed
- Demo website now has auto dark and light mode. Screenshot of dark mdoe added to Readme.
- Updated bootstrap version to 5.3.3
- Fixed an error in documentation - [Issue #9](https://github.com/kolappannathan/bootstrap-cookie-banner/issues/9) raised by [@Ahleroy](https://github.com/Ahleroy)

## [3.0.0] - 2021-11-19
Expand Down
Binary file added demo/dark-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed demo/demo.jpg
Binary file not shown.
Binary file added demo/light-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 18 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,37 @@
<title>Bootstrap Cookie Banner</title>

<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>

<!-- Cookie Banner -->
<link rel="stylesheet" href="./src/cookie-banner.css">
<script async src="./src/cookie-banner.js"></script>

<!-- Simple script to switch bootstrap theme -->
<script>
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'dark');
console.log('switching to dark theme');
}

if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'light');
console.log('switching to light theme');
}
</script>
</head>

<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<nav class="navbar navbar-expand-lg">
<div class="container-fluid">
<span class="navbar-brand">
Bootstrap Cookie Banner
<span class="badge rounded-pill bg-primary">Demo</span></h1>
</span>
</div>
</nav>
<main class="container mt-3">
<main class="container mt-5">
<p>
Demo website for Bootstrap Cookie Banner. If you don't see the cookie banner below, clear the localstorage.
</p>
Expand All @@ -33,7 +46,7 @@
<a href="https://github.com/kolappannathan/bootstrap-cookie-banner" target="_blank">GitHub</a>
</li>
<li>
Bootstrap Version used: 5.1.3
Bootstrap Version used: 5.3.3
</li>
</ul>

Expand Down

0 comments on commit a7b3fda

Please sign in to comment.