Add a dark mode

This commit is contained in:
Neil Brommer 2017-12-15 21:09:10 -08:00
parent 282281db82
commit 04cce1956b
10 changed files with 278 additions and 87 deletions

2
.gitignore vendored
View file

@ -21,3 +21,5 @@ info\.php
PHPMailer/
\.vscode/
lib/

View file

View file

@ -13,26 +13,38 @@
<link rel="icon" href="favicon.ico">
<!-- theme colors -->
<meta name="theme-color" content="#3f51b5"> <!-- Chrome, Firefox OS and Opera -->
<meta name="msapplication-navbutton-color" content="#3f51b5"> <!-- Windows Phone -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <!-- iOS -->
<meta name="theme-color" content="#3f51b5">
<!-- Chrome, Firefox OS and Opera -->
<meta name="msapplication-navbutton-color" content="#3f51b5">
<!-- Windows Phone -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- iOS -->
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Bootstrap -->
<link href="font-awesome/css/font-awesome.css" rel="stylesheet"> <!-- font awesome -->
<link href="css/main.css" rel="stylesheet"> <!-- Custom styles for this site -->
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap -->
<!-- font awesome -->
<script defer src="/lib/fontawesome/svg-with-js/js/fa-brands.js"></script>
<script defer src="/lib/fontawesome/svg-with-js/js/fa-regular.js"></script>
<script defer src="/lib/fontawesome/svg-with-js/js/fa-solid.js"></script>
<script src="/lib/fontawesome/svg-with-js/js/fontawesome.js"></script>
<link href="css/main.css" rel="stylesheet">
<!-- Custom styles for this site -->
<!-- Google Analytics -->
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-105178749-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
@ -58,11 +70,18 @@
<li class="nav-item active" id="contactlnk">
<a class="nav-link" href="contact.html">Contact</a>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item" id="githublnk">
<a class="nav-link" href="https://github.com/NeilBrommer" target="_blank">
GitHub <span class="fa fa-external-link"></span>
<a class="nav-link" href="https://github.com/NeilBrommer" target="_blank" title="GitHub">
<span class="fab fa-github-alt"></span>
</a>
</li>
<li class="nav-item ml-md-2">
<button id="btnTheme" type="button" class="btn btn-dark" aria-pressed="false" autocomplete="off">
<span id="themeText" class="fas fa-moon"></span>
</button>
</li>
</ul>
</div>
</div>
@ -108,11 +127,13 @@
</div>
<!-- Bootstrap core JavaScript -->
<script src="js/jquery-3.2.1.js"></script>
<script src="js/popper.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="js/contact.js"></script>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="lib/jquery/jquery-3.2.1.js"></script>
<script src="lib/popper/popper.js"></script>
<script src="lib/bootstrap/js/bootstrap.min.js"></script>
<script src="js/main.js"></script>
<!-- Google reCAPTCHA -->
<script src='https://www.google.com/recaptcha/api.js'></script>

View file

@ -22,7 +22,7 @@ a:not(.nav-link):not(.navbar-brand) {
}
a:hover:not(.nav-link):not(.navbar-brand) {
color: var(--main-light-color) !important;
color: var(--main-light-color);
}
li.col-md-6 {
@ -48,3 +48,35 @@ li.col-md-6 {
.full-height {
height: 100%;
}
.jumbo-dark {
background-color: #2b3136;
}
.a-dark {
color: var(--main-light-color) !important;
}
.a-dark:hover {
color: white !important;
}
.transition {
-webkit-transition: color 0.25s ease-in-out, background-color 0.25s ease-in-out, box-shadow 0.25s ease-in-out, border 0.25s ease-in-out;
-moz-transition: color 0.25s ease-in-out, background-color 0.25s ease-in-out, box-shadow 0.25s ease-in-out, border 0.25s ease-in-out;
-o-transition: color 0.25s ease-in-out, background-color 0.25s ease-in-out, box-shadow 0.25s ease-in-out, border 0.25s ease-in-out;
transition: color 0.25s ease-in-out, background-color 0.25s ease-in-out, box-shadow 0.25s ease-in-out, border 0.25s ease-in-out;
}
.card.bg-dark {
border-color: rgba(255, 255, 255, 0.125);
}
.dark.form-control {
background-color: rgb(81, 89, 107);
border-color: rgb(60, 66, 80);
}
.dark.form-control:focus {
box-shadow: 0 0 0 .2rem rgba(255,255,255,.5);
}

View file

View file

@ -10,16 +10,28 @@
<title>Neil Brommer</title>
<meta name="description" content="Neil Brommer - Home Page">
<meta name="author" content="Neil Brommer">
<link rel="icon" href="favicon.ico">
<link rel="icon" href="/favicon.ico">
<!-- theme colors -->
<meta name="theme-color" content="#3f51b5"> <!-- Chrome, Firefox OS and Opera -->
<meta name="msapplication-navbutton-color" content="#3f51b5"> <!-- Windows Phone -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <!-- iOS -->
<!-- Chrome, Firefox OS and Opera -->
<meta name="theme-color" content="#3f51b5">
<!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#3f51b5">
<!-- iOS -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Bootstrap -->
<link href="font-awesome/css/font-awesome.css" rel="stylesheet"> <!-- font awesome -->
<link href="css/main.css" rel="stylesheet"> <!-- Custom styles for this site -->
<!-- Bootstrap -->
<link id="bootstrapStyle" href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- font awesome -->
<script defer src="/lib/fontawesome/svg-with-js/js/fa-brands.js"></script>
<script defer src="/lib/fontawesome/svg-with-js/js/fa-regular.js"></script>
<script defer src="/lib/fontawesome/svg-with-js/js/fa-solid.js"></script>
<script src="/lib/fontawesome/svg-with-js/js/fontawesome.js"></script>
<!-- Custom styles for this site -->
<link href="css/main.css" rel="stylesheet">
<!-- Google Analytics -->
<script>
@ -37,18 +49,27 @@
</head>
<body>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the top of document to allow theme to be set quickly -->
<script src="lib/jquery/jquery-3.2.1.js"></script>
<script src="lib/popper/popper.js"></script>
<script src="lib/bootstrap/js/bootstrap.min.js"></script>
<script src="js/main.js"></script>
<!-- Fixed navbar -->
<nav id="topnav" class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<div class="container">
<a class="navbar-brand" href="/">Neil Brommer</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse"
<button class="navbar-toggler mr-0 ml-auto" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item active" id="homelnk">
<a class="nav-link" href=".">Home</a>
<a class="nav-link" href="/">Home</a>
</li>
<li class="nav-item" id="resumelnk">
<a class="nav-link" href="resume.html">Resume</a>
@ -59,16 +80,28 @@
<li class="nav-item" id="contactlnk">
<a class="nav-link" href="contact.html">Contact</a>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item" id="githublnk">
<a class="nav-link" href="https://github.com/NeilBrommer" target="_blank">
GitHub <span class="fa fa-external-link"></span>
<a class="nav-link" href="https://github.com/NeilBrommer" target="_blank" title="GitHub">
<span class="fab fa-github-alt"></span>
</a>
</li>
<li class="nav-item ml-md-2">
<button id="btnTheme" type="button" class="btn btn-dark" aria-pressed="false" autocomplete="off">
<span id="themeText" class="fas fa-moon"></span>
</button>
</li>
</ul>
</div>
</div>
</nav>
<!-- try to prevent flickering -->
<script>
checkTheme();
</script>
<div class="container">
<div class="jumbotron">
@ -79,6 +112,11 @@
</p>
</div>
<!-- try to prevent flickering -->
<script>
checkTheme();
</script>
<div class="card-columns">
<div class="card">
<h4 class="card-header">Snippets</h4>
@ -114,7 +152,8 @@
<div class="card">
<h4 class="card-header">Resume</h4>
<div class="card-body">
<p>My <a href="resume.html">resume</a>
<p>My
<a href="resume.html">resume</a>
</p>
<p>Sensitive information has been removed from this public version</p>
<a class="card-link" href="NeilBrommer-WebResume.pdf">PDF</a>
@ -122,16 +161,13 @@
</div>
</div>
</div>
<!-- try to prevent flickering -->
<script>
checkTheme();
</script>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery-3.2.1.js"></script>
<script src="js/popper.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
</body>
</html>

View file

69
js/main.js Normal file
View file

@ -0,0 +1,69 @@
var theme = window.localStorage.getItem("theme");
if (theme != null && theme == "true")
$("body").addClass("bg-dark");
$(document).ready(function () {
$("#btnTheme").click(function () {
if ($("#btnTheme").hasClass("btn-light")) {
transitionLight();
} else {
transitionDark();
}
});
var theme = window.localStorage.getItem("theme");
if (theme != null && theme == "true")
setDark();
});
function checkTheme() {
if (theme != null && theme == "true")
setDark();
}
function transitionDark() {
$("body").addClass("transition bg-dark text-white");
$(".card").addClass("transition bg-dark text-white");
$(".jumbotron").addClass("transition jumbo-dark text-white");
$(".form-control").addClass("transition dark");
$("a:not(.navbar-brand):not(.nav-link)").addClass("transition a-dark");
setInterval(function () {
$("a:not(.navbar-brand):not(.nav-link)").removeClass("transition");
$(".form-control").removeClass("transition");
}, 250);
$("#btnTheme").removeClass("btn-dark").addClass("transition btn-light");
$("#themeText").replaceWith($("<span>").attr("id", "themeText").addClass("fas fa-sun"));
window.localStorage.setItem("theme", "true");
}
function transitionLight() {
$("body").addClass("transition").removeClass("bg-dark text-white");
$(".card").addClass("transition").removeClass("bg-dark text-white");
$(".jumbotron").addClass("transition").removeClass("jumbo-dark text-white");
$(".form-control").addClass("transition").removeClass("dark");
$("a:not(.navbar-brand):not(.nav-link)").addClass("transition").removeClass("a-dark");
setInterval(function () {
$("a:not(.navbar-brand):not(.nav-link)").removeClass("transition");
$(".form-control").removeClass("transition");
}, 500);
$("#btnTheme").removeClass("btn-light").addClass("transition btn-dark");
$("#themeText").replaceWith($("<span>").attr("id", "themeText").addClass("fas fa-moon"));
window.localStorage.setItem("theme", "false");
}
function setDark() {
$("body").addClass("bg-dark text-white");
$(".card").addClass("bg-dark text-white");
$(".jumbotron").addClass("jumbo-dark text-white");
$(".form-control").addClass("dark");
$("a:not(.navbar-brand):not(.nav-link)").addClass("a-dark");
$("#btnTheme").removeClass("btn-dark").addClass("btn-light");
$("#themeText").replaceWith($("<span>").attr("id", "themeText").addClass("fas fa-sun"));
}

View file

@ -13,13 +13,24 @@
<link rel="icon" href="favicon.ico">
<!-- theme colors -->
<meta name="theme-color" content="#3f51b5"> <!-- Chrome, Firefox OS and Opera -->
<meta name="msapplication-navbutton-color" content="#3f51b5"> <!-- Windows Phone -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <!-- iOS -->
<meta name="theme-color" content="#3f51b5">
<!-- Chrome, Firefox OS and Opera -->
<meta name="msapplication-navbutton-color" content="#3f51b5">
<!-- Windows Phone -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- iOS -->
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Bootstrap -->
<link href="font-awesome/css/font-awesome.css" rel="stylesheet"> <!-- font awesome -->
<link href="css/main.css" rel="stylesheet"> <!-- Custom styles for this site -->
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap -->
<!-- font awesome -->
<script defer src="/lib/fontawesome/svg-with-js/js/fa-brands.js"></script>
<script defer src="/lib/fontawesome/svg-with-js/js/fa-regular.js"></script>
<script defer src="/lib/fontawesome/svg-with-js/js/fa-solid.js"></script>
<script src="/lib/fontawesome/svg-with-js/js/fontawesome.js"></script>
<link href="css/main.css" rel="stylesheet">
<!-- Custom styles for this site -->
<!-- Google Analytics -->
<script>
@ -59,11 +70,18 @@
<li class="nav-item" id="contactlnk">
<a class="nav-link" href="contact.html">Contact</a>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item" id="githublnk">
<a class="nav-link" href="https://github.com/NeilBrommer" target="_blank">
GitHub <span class="fa fa-external-link"></span>
<a class="nav-link" href="https://github.com/NeilBrommer" target="_blank" title="GitHub">
<span class="fab fa-github-alt"></span>
</a>
</li>
<li class="nav-item ml-md-2">
<button id="btnTheme" type="button" class="btn btn-dark" aria-pressed="false" autocomplete="off">
<span id="themeText" class="fas fa-moon"></span>
</button>
</li>
</ul>
</div>
</div>
@ -84,8 +102,7 @@
<h4 class="card-header">John Carmack at QuakeCon 2013</h4>
<div class="card-body">
<p class="card-text">
<a href="https://www.youtube.com/watch?v=IyUgHPs86XM"
target="_blank">
<a href="https://www.youtube.com/watch?v=IyUgHPs86XM" target="_blank">
Principles of Lighting and Rendering with John Carmack at QuakeCon 2013
</a>
</p>
@ -101,8 +118,7 @@
<h4 class="card-header">Volatility of High Frequency Trading</h4>
<div class="card-body">
<p class="card-text">
<a href="http://nautil.us/issue/23/dominoes/why-the-flash-crash-really-matters"
target="_blank">
<a href="http://nautil.us/issue/23/dominoes/why-the-flash-crash-really-matters" target="_blank">
Why the Flash Crash Really Matters
</a>
</p>
@ -120,8 +136,7 @@
<h4 class="card-header">Algorithms and Bias</h4>
<div class="card-body">
<p class="card-text">
<a href="https://www.nytimes.com/2015/08/11/upshot/algorithms-and-bias-q-and-a-with-cynthia-dwork.html?abt=0002&abg=1"
target="_blank">
<a href="https://www.nytimes.com/2015/08/11/upshot/algorithms-and-bias-q-and-a-with-cynthia-dwork.html?abt=0002&abg=1" target="_blank">
Algorithms and Bias: Q. and A. With Cynthia Dwork
</a>
</p>
@ -153,8 +168,7 @@
<h4 class="card-header">Real Time Rendering for Artists</h4>
<div class="card-body">
<p class="card-text">
<a href="https://jesshiderue4.wordpress.com/real-time-rendering-an-overview-for-artists/"
target="_blank">
<a href="https://jesshiderue4.wordpress.com/real-time-rendering-an-overview-for-artists/" target="_blank">
Real Time Rendering: An Overview for Artists
</a>
</p>
@ -171,7 +185,7 @@
<div class="card-body">
<p class="card-text">
<a href="https://hacks.mozilla.org/2017/11/entering-the-quantum-era-how-firefox-got-fast-again-and-where-its-going-to-get-faster/"
target="_blank">
target="_blank">
Entering the Quantum Era—How Firefox got fast again and where its going to get faster
</a>
</p>
@ -187,8 +201,7 @@
<h4 class="card-header">Firefoxs New Rendering Engine (WebRender)</h4>
<div class="card-body">
<p class="card-text">
<a href="https://hacks.mozilla.org/2017/10/the-whole-web-at-maximum-fps-how-webrender-gets-rid-of-jank/"
target="_blank">
<a href="https://hacks.mozilla.org/2017/10/the-whole-web-at-maximum-fps-how-webrender-gets-rid-of-jank/" target="_blank">
The whole web at maximum FPS: How WebRender gets rid of jank
</a>
</p>
@ -204,8 +217,7 @@
<h4 class="card-header">Firefoxs New CSS Engine (Stylo)</h4>
<div class="card-body">
<p class="card-text">
<a href="https://hacks.mozilla.org/2017/08/inside-a-super-fast-css-engine-quantum-css-aka-stylo/"
target="_blank">
<a href="https://hacks.mozilla.org/2017/08/inside-a-super-fast-css-engine-quantum-css-aka-stylo/" target="_blank">
Inside a super fast CSS engine: Quantum CSS (aka Stylo)
</a>
</p>
@ -221,17 +233,16 @@
<h4 class="card-header">Judge William Alsup</h4>
<div class="card-body">
<p class="card-text">
<a href="https://www.theverge.com/2017/10/19/16503076/oracle-vs-google-judge-william-alsup-interview-waymo-uber"
target="_blank">
<a href="https://www.theverge.com/2017/10/19/16503076/oracle-vs-google-judge-william-alsup-interview-waymo-uber" target="_blank">
The Judges Code
</a>
</p>
<p class="card-text">
An article on Judge William Alsup, who was the judge for the first
<a href="https://en.wikipedia.org/wiki/Oracle_America,_Inc._v._Google,_Inc." target="_blank">
Oracle v. Google</a> case over whether an API can be copywritten, and is now the judge for
the <a href="http://www.businessinsider.com/google-waymo-v-uber-case-explained-2017-5" target="_blank">
Waymo (Google) v. Uber</a>.
Oracle v. Google</a> case over whether an API can be copywritten, and is now the judge for the
<a href="http://www.businessinsider.com/google-waymo-v-uber-case-explained-2017-5" target="_blank">
Waymo (Google) v. Uber</a>.
</p>
</div>
</div>
@ -243,9 +254,10 @@
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery-3.2.1.js"></script>
<script src="js/popper.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="lib/jquery/jquery-3.2.1.js"></script>
<script src="lib/popper/popper.js"></script>
<script src="lib/bootstrap/js/bootstrap.min.js"></script>
<script src="js/main.js"></script>
</body>

View file

@ -13,21 +13,32 @@
<link rel="icon" href="favicon.ico">
<!-- theme colors -->
<meta name="theme-color" content="#3f51b5"> <!-- Chrome, Firefox OS and Opera -->
<meta name="msapplication-navbutton-color" content="#3f51b5"> <!-- Windows Phone -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <!-- iOS -->
<meta name="theme-color" content="#3f51b5">
<!-- Chrome, Firefox OS and Opera -->
<meta name="msapplication-navbutton-color" content="#3f51b5">
<!-- Windows Phone -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- iOS -->
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Bootstrap -->
<link href="font-awesome/css/font-awesome.css" rel="stylesheet"> <!-- font awesome -->
<link href="css/main.css" rel="stylesheet"> <!-- Custom styles for this site -->
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap -->
<!-- font awesome -->
<script defer src="/lib/fontawesome/svg-with-js/js/fa-brands.js"></script>
<script defer src="/lib/fontawesome/svg-with-js/js/fa-regular.js"></script>
<script defer src="/lib/fontawesome/svg-with-js/js/fa-solid.js"></script>
<script src="/lib/fontawesome/svg-with-js/js/fontawesome.js"></script>
<link href="css/main.css" rel="stylesheet">
<!-- Custom styles for this site -->
<!-- Google Analytics -->
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-105178749-1', 'auto');
@ -38,14 +49,6 @@
<body>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery-3.2.1.js"></script>
<script src="js/popper.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<!-- Fixed navbar -->
<nav id="topnav" class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<div class="container">
@ -68,11 +71,18 @@
<li class="nav-item" id="contactlnk">
<a class="nav-link" href="contact.html">Contact</a>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item" id="githublnk">
<a class="nav-link" href="https://github.com/NeilBrommer" target="_blank">
GitHub <span class="fa fa-external-link"></span>
<a class="nav-link" href="https://github.com/NeilBrommer" target="_blank" title="GitHub">
<span class="fab fa-github-alt"></span>
</a>
</li>
<li class="nav-item ml-md-2">
<button id="btnTheme" type="button" class="btn btn-dark" aria-pressed="false" autocomplete="off">
<span id="themeText" class="fas fa-moon"></span>
</button>
</li>
</ul>
</div>
</div>
@ -167,6 +177,15 @@
</p>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="lib/jquery/jquery-3.2.1.js"></script>
<script src="lib/popper/popper.js"></script>
<script src="lib/bootstrap/js/bootstrap.min.js"></script>
<script src="js/main.js"></script>
</body>
</html>