Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .jekyll-metadata
Binary file not shown.
180 changes: 180 additions & 0 deletions _includes/theme-toggle.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
<style>
/* CSS Variables for Theming */
:root {
/* Light theme (default) */
--bg-primary: #ffffff;
--bg-secondary: #f8f9fa;
--bg-tertiary: #e9ecef;
--text-primary: #212529;
--text-secondary: #6c757d;
--link-color: #007bff;
--link-hover: #0056b3;
--border-color: #dee2e6;
--code-bg: #f8f9fa;
--header-bg: #343a40;
--header-text: #ffffff;
--footer-bg: #f8f9fa;
--footer-text: #6c757d;
--jumbotron-bg: #f8f9fa;
--jumbotron-text: #212529;
}

[data-theme="dark"] {
/* Dark theme */
--bg-primary: #121212;
--bg-secondary: #1e1e1e;
--bg-tertiary: #2d3748;
--text-primary: #e9ecef;
--text-secondary: #adb5bd;
--link-color: #4dabf7;
--link-hover: #74c0fc;
--border-color: #495057;
--code-bg: #2d3748;
--header-bg: #212529;
--header-text: #f8f9fa;
--footer-bg: #1a1a1a;
--footer-text: #adb5bd;
--jumbotron-bg: #2d3748;
--jumbotron-text: #e9ecef;
}

/* ========== APPLY THEME TO ALL ELEMENTS ========== */

/* Base elements */
body {
background-color: var(--bg-primary) !important;
color: var(--text-primary) !important;
transition: background-color 0.3s ease, color 0.3s ease !important;
}

/* All text elements */
h1, h2, h3, h4, h5, h6,
p, span, div, li, td, th {
color: var(--text-primary) !important;
}

/* Header/Navigation */
.navbar-inverse {
background-color: var(--header-bg) !important;
border-color: var(--border-color) !important;
}

.navbar-inverse .navbar-nav > li > a,
.navbar-inverse .navbar-brand,
.navbar-inverse .navbar-text {
color: var(--header-text) !important;
}

/* Links */
a {
color: var(--link-color) !important;
}

a:hover {
color: var(--link-hover) !important;
}

/* Main content */
.container {
background-color: var(--bg-primary) !important;
}

/* Jumbotron (hero section on homepage) */
.jumbotron {
background-color: var(--jumbotron-bg) !important;
color: var(--jumbotron-text) !important;
}

.jumbotron h1 {
color: var(--jumbotron-text) !important;
}

.jumbotron p {
color: var(--jumbotron-text) !important;
}

.jumbotron .btn-primary {
background-color: var(--link-color) !important;
border-color: var(--link-color) !important;
}

.jumbotron .btn-primary:hover {
background-color: var(--link-hover) !important;
border-color: var(--link-hover) !important;
}

/* Footer */
.site-footer {
background-color: var(--footer-bg) !important;
color: var(--footer-text) !important;
}

/* Code blocks */
pre, code {
background-color: var(--code-bg) !important;
border-color: var(--border-color) !important;
color: var(--text-primary) !important;
}

/* ========== TOGGLE BUTTON STYLES ========== */

.theme-toggle-item {
display: flex;
align-items: center;
margin-left: 10px;
}

.theme-toggle-wrapper {
display: flex;
align-items: center;
}

.theme-toggle {
background: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: 50%;
width: 40px;
height: 40px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
color: var(--text-primary);
padding: 0;
position: relative;
z-index: 1000;
}

.theme-toggle:hover {
background: var(--bg-tertiary);
transform: scale(1.05);
}

.theme-toggle svg {
pointer-events: none;
}

.theme-icon-dark {
display: none;
}

[data-theme="dark"] .theme-icon-light {
display: none;
}

[data-theme="dark"] .theme-icon-dark {
display: block;
}

.navbar-nav .theme-toggle-item {
padding: 8px 0;
}

@media (max-width: 768px) {
.theme-toggle-item {
margin: 10px 15px;
justify-content: center;
}
}
</style>
96 changes: 96 additions & 0 deletions _includes/theme-toggle.html.backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<style>
/* CSS Variables for Theming */
:root {
--bg-primary: #ffffff;
--bg-secondary: #f8f9fa;
--bg-tertiary: #e9ecef;
--text-primary: #212529;
--text-secondary: #6c757d;
--link-color: #007bff;
--link-hover: #0056b3;
--border-color: #dee2e6;
--code-bg: #f8f9fa;
--header-bg: #343a40;
--header-text: #ffffff;
--footer-bg: #f8f9fa;
--footer-text: #6c757d;
}

[data-theme="dark"] {
/* Dark theme */
--bg-primary: #121212;
--bg-secondary: #1e1e1e;
--bg-tertiary: #2d3748;
--text-primary: #e9ecef;
--text-secondary: #adb5bd;
--link-color: #4dabf7;
--link-hover: #74c0fc;
--border-color: #495057;
--code-bg: #2d3748;
--header-bg: #212529;
--header-text: #f8f9fa;
--footer-bg: #1a1a1a;
--footer-text: #adb5bd;
}

/* Toggle button styles */
.theme-toggle-item {
display: flex;
align-items: center;
margin-left: 10px;
}

.theme-toggle-wrapper {
display: flex;
align-items: center;
}

.theme-toggle {
background: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: 50%;
width: 40px;
height: 40px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
color: var(--text-primary);
padding: 0;
position: relative;
z-index: 1000;
}

.theme-toggle:hover {
background: var(--bg-tertiary);
transform: scale(1.05);
}

.theme-toggle svg {
pointer-events: none;
}

.theme-icon-dark {
display: none;
}

[data-theme="dark"] .theme-icon-light {
display: none;
}

[data-theme="dark"] .theme-icon-dark {
display: block;
}

.navbar-nav .theme-toggle-item {
padding: 8px 0;
}

@media (max-width: 768px) {
.theme-toggle-item {
margin: 10px 15px;
justify-content: center;
}
}
</style>
15 changes: 14 additions & 1 deletion _includes/themes/apache/_navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<li><a href="{{ site.baseurl }}/docs/latest">Documentation</a></li>
<li><a href="{{ site.baseurl }}/articles">Articles</a></li>
<li><a href="{{ site.data.project.source_repository_os_mirror }}">GitHub</a></li>
<li id="apache">
<li id="apache">
<a href="#" data-toggle="dropdown" class="dropdown-toggle">Apache<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://www.apache.org/foundation/how-it-works.html">Apache Software Foundation</a></li>
Expand All @@ -37,6 +37,19 @@
<li><a href="https://www.apache.org/foundation/thanks.html">Thanks</a></li>
</ul>
</li>
<!-- Theme Toggle Button -->
<li class="theme-toggle-item">
<div class="theme-toggle-wrapper">
<button class="theme-toggle" id="themeToggle" aria-label="Toggle dark mode">
<svg class="theme-icon-light" width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
<path d="M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/>
</svg>
<svg class="theme-icon-dark" width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
<path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"/>
</svg>
</button>
</div>
</li>
</ul>
</nav><!--/.navbar-collapse -->
</div>
Expand Down
23 changes: 6 additions & 17 deletions _includes/themes/apache/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,14 @@
{% if page.description %}<meta name="description" content="{{ page.description }}">{% endif %}
<meta name="author" content="{{ site.author.name }}">

<!-- Enable responsive viewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<!-- Le styles -->
<link href="{{ site.baseurl }}/assets/themes/apache/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="{{ site.baseurl }}/assets/themes/apache/css/style.css?body=1" rel="stylesheet" type="text/css">
<link href="{{ site.baseurl }}/assets/themes/apache/css/syntax.css" rel="stylesheet" type="text/css" media="screen" />
<link href="{{ site.baseurl }}/assets/themes/apache/css/demo.css" rel="stylesheet" type="text/css"/>
<!-- Le fav and touch icons -->
<!-- Update these with your own images
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
-->

<!-- ADD THEME TOGGLE CSS -->
{% include theme-toggle.html %}

</head>

Expand All @@ -44,9 +32,10 @@

{% include JB/analytics %}
<script src="{{ ASSET_PATH }}/jquery/jquery-2.1.1.min.js"></script>

<script src="{{ ASSET_PATH }}/bootstrap/js/bootstrap.min.js"></script>

<!-- ADD THEME TOGGLE JAVASCRIPT -->
<script src="{{ site.baseurl }}/assets/js/theme.js"></script>

</body>
</html>
</html>
Loading