Skip to content
Merged
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
4 changes: 2 additions & 2 deletions _data/homepage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ documentation:
technical:
title: "Technical Structure"
subtitle: "Access source code, releases, and project repositories"
intro: "Release packages are available for download. We use three primary GIT repositories to develop the project: <strong><a href=\"{{ site.data.project.source_repository_os_mirror }}\" target=\"_blank\" rel=\"noopener noreferrer\">RTOS</a></strong>, <strong><a href=\"{{ site.data.project.source_repository_apps_mirror }}\" target=\"_blank\" rel=\"noopener noreferrer\">Applications</a></strong>, and <strong><a href=\"https://github.com/apache/nuttx-website\" target=\"_blank\" rel=\"noopener noreferrer\">Website</a></strong>. Documentation is part of the RTOS repository and then built and hosted online."
intro: "Release packages are available for download. We use three primary GIT repositories to develop the project: <strong><a href=\"https://github.com/apache/nuttx\" target=\"_blank\" rel=\"noopener noreferrer\">RTOS</a></strong>, <strong><a href=\"https://github.com/apache/nuttx-apps\" target=\"_blank\" rel=\"noopener noreferrer\">Applications</a></strong>, and <strong><a href=\"https://github.com/apache/nuttx-website\" target=\"_blank\" rel=\"noopener noreferrer\">Website</a></strong>. Documentation is part of the RTOS repository and then built and hosted online."
resources:
- icon: "download.svg"
title: "Release Packages"
Expand Down Expand Up @@ -89,7 +89,7 @@ demo:
# Community Section
community:
title: "Join the Apache NuttX Community"
description: "NuttX is developed and maintained by an international <a href=\"{{ site.baseurl }}/community-members\">group of volunteers</a> from all around the world. We welcome developers of all skill levels to contribute to the project. View our <a href=\"https://github.com/apache/nuttx/graphs/contributors\" target=\"_blank\" rel=\"noopener noreferrer\">full contributor list on GitHub</a>."
description: "NuttX is developed and maintained by an international <a href=\"/community-members\">group of volunteers</a> from all around the world. We welcome developers of all skill levels to contribute to the project. View our <a href=\"https://github.com/apache/nuttx/graphs/contributors\" target=\"_blank\" rel=\"noopener noreferrer\">full contributor list on GitHub</a>."
channels_title: "Connect With Us"
channels:
- name: "Mailing List (Main)"
Expand Down
70 changes: 22 additions & 48 deletions _includes/themes/apache/_navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
<span class="logo-text">Apache NuttX®</span>
</a>

<button class="mobile-toggle" id="mobileToggle" aria-label="Menu">
<span class="hamburger-line"></span>
<span class="hamburger-line"></span>
<span class="hamburger-line"></span>
</button>

<div class="navbar-nav" id="navbarNav">
<div class="nav-item">
<button class="nav-btn" type="button">
Expand Down Expand Up @@ -71,9 +65,30 @@
<a href="https://www.apache.org/foundation/thanks.html" target="_blank">Thanks</a>
</div>
</div>

<div class="mobile-theme-item">
<button class="theme-btn mobile-theme-btn" id="themeBtn" aria-label="Toggle theme">
<span class="theme-label">Theme</span>
<svg class="sun" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>
<line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>
</svg>
<svg class="moon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>
</svg>
</button>
</div>
</div>

<button class="theme-btn" id="themeBtn" aria-label="Toggle theme">
<button class="mobile-toggle" id="mobileToggle" aria-label="Menu">
<span class="hamburger-line"></span>
<span class="hamburger-line"></span>
<span class="hamburger-line"></span>
</button>

<button class="theme-btn desktop-theme-btn" id="desktopThemeBtn" aria-label="Toggle theme">
<svg class="sun" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>
Expand Down Expand Up @@ -110,47 +125,6 @@ <h2 class="hero-subtitle">Apache NuttX is a free and open-source (FOSS) real-tim
Documentation
</a>
</div>

<!-- GitHub Stats - Static Shields.io Badges -->
<div class="hero-stats">
<div class="github-stats-pill">
<div class="stats-repo-group">
<a href="{{ site.data.project.source_repository_os_mirror }}" class="repo-link" target="_blank" rel="noopener noreferrer">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
</svg>
<span class="repo-name">RTOS</span>
</a>
<div class="repo-stats">
<a href="https://github.com/apache/nuttx/stargazers" target="_blank" rel="noopener noreferrer">
<img src="https://img.shields.io/github/stars/apache/nuttx?style=flat&logo=github&label=Stars&labelColor=2d3748&color=3b82f6" alt="RTOS Stars">
</a>
<a href="https://github.com/apache/nuttx/network/members" target="_blank" rel="noopener noreferrer">
<img src="https://img.shields.io/github/forks/apache/nuttx?style=flat&logo=github&label=Forks&labelColor=2d3748&color=3b82f6" alt="RTOS Forks">
</a>
</div>
</div>

<div class="stats-divider"></div>

<div class="stats-repo-group">
<a href="{{ site.data.project.source_repository_apps_mirror }}" class="repo-link" target="_blank" rel="noopener noreferrer">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
</svg>
<span class="repo-name">Apps</span>
</a>
<div class="repo-stats">
<a href="https://github.com/apache/nuttx-apps/stargazers" target="_blank" rel="noopener noreferrer">
<img src="https://img.shields.io/github/stars/apache/nuttx-apps?style=flat&logo=github&label=Stars&labelColor=2d3748&color=3b82f6" alt="Apps Stars">
</a>
<a href="https://github.com/apache/nuttx-apps/network/members" target="_blank" rel="noopener noreferrer">
<img src="https://img.shields.io/github/forks/apache/nuttx-apps?style=flat&logo=github&label=Forks&labelColor=2d3748&color=3b82f6" alt="Apps Forks">
</a>
</div>
</div>
</div>
</div>
</div>
</section>
{% endif %}
45 changes: 33 additions & 12 deletions _includes/themes/apache/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
<link href="{{ site.baseurl }}/assets/themes/apache/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="{{ site.baseurl }}/assets/themes/apache/css/modern.css" rel="stylesheet" type="text/css">
<link href="{{ site.baseurl }}/assets/themes/apache/css/syntax.css" rel="stylesheet" type="text/css" media="screen" />
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Patua+One&family=Roboto:wght@300;400;500;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<!-- Local Fonts (CSP compliant) -->
<link href="{{ site.baseurl }}/assets/themes/apache/css/fonts.css" rel="stylesheet" type="text/css">
{% if page.title == "Home" %}
<link href="{{ site.baseurl }}/assets/themes/apache/css/demo.css" rel="stylesheet" type="text/css">
{% endif %}
Expand Down Expand Up @@ -58,8 +56,9 @@
<script>
// Theme Toggle with System Preference
(function() {
const themeBtn = document.getElementById('themeBtn');
const html = document.documentElement;
const mobileThemeBtn = document.getElementById('themeBtn');
const desktopThemeBtn = document.getElementById('desktopThemeBtn');

// Check for saved theme preference or default to system preference
const savedTheme = localStorage.getItem('theme');
Expand All @@ -72,15 +71,37 @@
currentTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
}

// Set initial theme
html.setAttribute('data-theme', currentTheme);
document.body.style.transition = 'background-color 0.3s ease, color 0.3s ease';

if (themeBtn) {
themeBtn.addEventListener('click', function() {
const theme = html.getAttribute('data-theme');
const newTheme = theme === 'dark' ? 'light' : 'dark';
html.setAttribute('data-theme', newTheme);
localStorage.setItem('theme', newTheme);
});
// Function to toggle theme
function toggleTheme(e) {
if (e) {
e.preventDefault();
e.stopPropagation();
}

const theme = html.getAttribute('data-theme');
const newTheme = theme === 'dark' ? 'light' : 'dark';
html.setAttribute('data-theme', newTheme);
localStorage.setItem('theme', newTheme);
console.log('Theme toggled to:', newTheme);
}

// Add click listeners to both buttons
if (mobileThemeBtn) {
mobileThemeBtn.addEventListener('click', toggleTheme);
console.log('Mobile theme button listener attached');
}

if (desktopThemeBtn) {
desktopThemeBtn.addEventListener('click', toggleTheme);
console.log('Desktop theme button listener attached');
}

if (!mobileThemeBtn && !desktopThemeBtn) {
console.warn('Theme buttons not found');
}
})();

Expand Down
110 changes: 110 additions & 0 deletions assets/themes/apache/css/fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/* Local Font Declarations for Apache NuttX */
/* This file contains locally hosted fonts to comply with Apache CSP policies */

/* DM Sans - Regular (400) */
@font-face {
font-family: 'DM Sans';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('../fonts/DMSans-Regular.ttf') format('truetype');
}

/* DM Sans - Medium (500) */
@font-face {
font-family: 'DM Sans';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url('../fonts/DMSans-Medium.ttf') format('truetype');
}

/* DM Sans - SemiBold (600) */
@font-face {
font-family: 'DM Sans';
font-style: normal;
font-weight: 600;
font-display: swap;
src: url('../fonts/DMSans-SemiBold.ttf') format('truetype');
}

/* DM Sans - Bold (700) */
@font-face {
font-family: 'DM Sans';
font-style: normal;
font-weight: 700;
font-display: swap;
src: url('../fonts/DMSans-Bold.ttf') format('truetype');
}

/* Patua One - Regular (400) */
@font-face {
font-family: 'Patua One';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('../fonts/PatuaOne-Regular.ttf') format('truetype');
}

/* Roboto - Light (300) */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
font-display: swap;
src: url('../fonts/Roboto-Light.ttf') format('truetype');
}

/* Roboto - Regular (400) */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('../fonts/Roboto-Regular.ttf') format('truetype');
}

/* Roboto - Medium (500) */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url('../fonts/Roboto-Medium.ttf') format('truetype');
}

/* Roboto - Bold (700) */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
font-display: swap;
src: url('../fonts/Roboto-Bold.ttf') format('truetype');
}

/* JetBrains Mono - Regular (400) */
@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('../fonts/JetBrainsMono-Regular.ttf') format('truetype');
}

/* JetBrains Mono - Medium (500) */
@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url('../fonts/JetBrainsMono-Medium.ttf') format('truetype');
}

/* JetBrains Mono - SemiBold (600) */
@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
font-weight: 600;
font-display: swap;
src: url('../fonts/JetBrainsMono-SemiBold.ttf') format('truetype');
}
Loading