-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from Hareesh0-inf/darkmode
Added Darkmode
- Loading branch information
Showing
7 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
function addDarkmodeWidget() { | ||
const options = { | ||
bottom: '64px', // default: '32px' | ||
right: '32px', // default: '32px' | ||
left: 'unset', // default: 'unset' | ||
time: '0.5s', // default: '0.3s' | ||
mixColor: '#e5e5e5', // default: '#fff' | ||
backgroundColor: '#fff', // default: '#fff' | ||
buttonColorDark: '#fff', // default: '#100f2c' | ||
buttonColorLight: '#3C3D37', // default: '#fff' | ||
saveInCookies: true, // default: true, | ||
label: '🌖', // default: '' | ||
autoMatchOsTheme: true // default: true | ||
} | ||
|
||
const darkmode = new Darkmode(options); | ||
darkmode.showWidget(); | ||
} | ||
window.addEventListener('load', addDarkmodeWidget); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,9 @@ <h3>Vote Counts:</h3> | |
<!-- Bootstrap JS & Popper.js --> | ||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script> | ||
|
||
<!-- Script for Darkmode --> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/darkmode-js.min.js"></script> | ||
<script src="../static/darkmode.js"></script> | ||
<!-- Script to handle voting functionality --> | ||
<script> | ||
document.getElementById("voteButton").addEventListener("click", function() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,7 @@ <h2>Login</h2> | |
<p>Don't have an account? <a href="/register">Register here</a>.</p> | ||
</div> | ||
</body> | ||
<!-- Script for Darkmode --> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/darkmode-js.min.js"></script> | ||
<script src="../static/darkmode.js"></script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,7 @@ <h2>Register</h2> | |
<p>Already have an account? <a href="/login">Login here</a>.</p> | ||
</div> | ||
</body> | ||
<!-- Script for Darkmode --> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/darkmode-js.min.js"></script> | ||
<script src="../static/darkmode.js"></script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,7 @@ <h2>Winner(s):</h2> | |
<a href="/logout" class="btn-logout">Logout</a> | ||
</div> | ||
</body> | ||
<!-- Script for Darkmode --> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/darkmode-js.min.js"></script> | ||
<script src="../static/darkmode.js"></script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,7 @@ <h2 class="count">Total Vote Counts: {{ total_vote_count }}</h2> | |
<a href="/logout" class="btn-logout">Logout</a> | ||
</div> | ||
</body> | ||
<!-- Script for Darkmode --> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/darkmode-js.min.js"></script> | ||
<script src="../static/darkmode.js"></script> | ||
</html> |