mirror of
https://github.com/boostorg/website-v2.git
synced 2026-01-19 04:42:17 +00:00
443 lines
15 KiB
HTML
443 lines
15 KiB
HTML
{% load static %}
|
|
{% load account socialaccount active_link_tags %}
|
|
<style>
|
|
:root {
|
|
--site-light-bg-color: rgb(229, 231, 235);
|
|
--site-dark-bg-color: rgb(5, 26, 38);
|
|
--site-light-card-color: #fff;
|
|
--site-dark-card-color: rgb(23, 42, 52);
|
|
--site-light-border-color: #d1d1d1;
|
|
--site-dark-border-color: #07405f;
|
|
--site-light-text-color: #000;
|
|
--site-dark-text-color: #ccc;
|
|
--site-dark-heading-text-color: #fff;
|
|
--site-light-heading-text-color: rgb(49, 74, 87);
|
|
--site-primary-orange: rgb(255, 159, 0);
|
|
--site-light-secondary-blue: rgb(2, 132, 199);
|
|
--site-dark-secondary-blue: rgb(125, 211, 252);
|
|
--site-light-teritary-green: rgb(14, 174, 96);
|
|
--site-dark-teritary-green: rgb(90, 213, 153);
|
|
/* specific use colors */
|
|
}
|
|
|
|
html {
|
|
--bg-color: var(--site-light-bg-color);
|
|
--card-color: var(--site-light-card-color);
|
|
--border-color: var(--site-light-border-color);
|
|
--text-color: var(--site-light-text-color);
|
|
--header-color: var(--site-light-heading-text-color);
|
|
--primary-color: var(--site-primary-orange);
|
|
--secondary-color: var(--site-light-secondary-blue);
|
|
--teritary-color: var(--site-light-teritary-green);
|
|
/* specific use colors */
|
|
}
|
|
|
|
html.dark {
|
|
--bg-color: var(--site-dark-bg-color);
|
|
--card-color: var(--site-dark-card-color);
|
|
--border-color: var(--site-dark-border-color);
|
|
--text-color: var(--site-dark-text-color);
|
|
--header-color: var(--site-dark-heading-text-color);
|
|
--primary-color: var(--site-primary-orange);
|
|
--secondary-color: var(--site-dark-secondary-blue);
|
|
--teritary-color: var(--site-dark-teritary-green);
|
|
/* specific use colors */
|
|
}
|
|
</style>
|
|
<style scoped>
|
|
.header-menu-bar {
|
|
padding: 1rem;
|
|
height: 2.5rem;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
box-shadow: 0px 1px 0px #d1d1d1;
|
|
border-bottom: 1px solid #f6f6f6 !important;
|
|
max-width:80rem;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.dark .header-menu-bar {
|
|
border-bottom: 1px solid #07405f;
|
|
box-shadow: 0 1px 0 #000;
|
|
}
|
|
|
|
.header-menu-bar .left-menubar {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-start;
|
|
flex-grow: 1;
|
|
}
|
|
|
|
.header-menu-bar .right-menubar {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
max-width: 9rem;
|
|
}
|
|
|
|
.header-menu-bar .logo-link {
|
|
width: 1.3rem;
|
|
height: 1.6rem;
|
|
}
|
|
|
|
.header-menu-bar .menu-link {
|
|
text-transform: capitalize;
|
|
margin-left: 1rem;
|
|
font-weight: 600;
|
|
color: var(--text-color);
|
|
}
|
|
|
|
.icon-link {
|
|
display:block;
|
|
margin-left: 1rem;
|
|
cursor: pointer
|
|
}
|
|
|
|
.dark .icon-link {
|
|
opacity: 0.5;
|
|
}
|
|
|
|
.icon-link:hover,
|
|
.menu-link:hover,
|
|
.active-link,
|
|
.mobile-menu-item a:hover {
|
|
color: var(--primary-color) !important;
|
|
opacity: 1;
|
|
}
|
|
|
|
.guide-modal {
|
|
position: absolute;
|
|
right:0;
|
|
z-index: 10;
|
|
padding: .25rem .5rem;
|
|
margin-top: .5rem;
|
|
width: 8rem;
|
|
text-align:left;
|
|
background-color: var(--card-color);
|
|
border-radius: 0.375rem;
|
|
border-top-width: 1px;
|
|
border-bottom-width: 0px;
|
|
border-color: var(--border-color);
|
|
}
|
|
|
|
.guide-modal a {
|
|
margin-left: .5rem;
|
|
display: block;
|
|
padding: .5rem 0;
|
|
font-size: .7rem;
|
|
cursor: pointer;
|
|
color: var(--text-color);
|
|
border-bottom: var(--border-color) 1px solid;
|
|
}
|
|
|
|
.guide-modal a:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.guide-modal a:hover {
|
|
color: var(--primary-color);
|
|
}
|
|
|
|
#pageselector {
|
|
text-transform: capitalize;
|
|
margin-left: 1rem;
|
|
font-weight: 600;
|
|
display:flex;
|
|
position: absolute;
|
|
top: 0.25rem;
|
|
left: 1.75rem;
|
|
flex-direction: column;
|
|
z-index: 10;
|
|
color: var(--text-color);
|
|
background-color: var(--card-color)
|
|
}
|
|
|
|
.hide {
|
|
display: none !important;
|
|
}
|
|
|
|
.mobile-menu-item {
|
|
min-width: 10rem;
|
|
padding: .5rem 1rem;
|
|
border-bottom: var(--border-color) 1px solid;
|
|
}
|
|
|
|
#avatar svg {
|
|
width: 1rem;
|
|
height: 1rem;
|
|
color: var(--text-color);
|
|
fill: var(--primary-color);
|
|
}
|
|
|
|
#mobileNav {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
#selectedpage {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding-left: 10px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
@media screen and (min-width: 768px) {
|
|
#mobileNav {
|
|
display: none;
|
|
}
|
|
|
|
#desktopNav {
|
|
display: flex;
|
|
}
|
|
}
|
|
|
|
@media screen and (max-width: 768px) {
|
|
#mobileNav {
|
|
display: flex;
|
|
}
|
|
|
|
#desktopNav {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
</style>
|
|
<style>
|
|
/* specific to docs */
|
|
body.article {
|
|
max-width: 100% !important;
|
|
margin: 0;
|
|
padding: 0px;
|
|
}
|
|
|
|
body .body {
|
|
margin: 0px 1.25rem;
|
|
padding: 1rem 0rem 0;
|
|
max-width: 80rem;
|
|
}
|
|
|
|
body.article #headblock {
|
|
padding: 0.25rem 1rem !important;
|
|
}
|
|
|
|
@media (min-width: 768px) {
|
|
body.article {
|
|
max-width: 80rem !important;
|
|
margin: auto;
|
|
padding: 0px 2.25rem;
|
|
}
|
|
|
|
body.article #headblock {
|
|
padding: 0.25rem 0.5rem !important;
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
<div class="header-menu-bar topnavbar">
|
|
<!-- mobile navbar -->
|
|
<div id="mobileNav" >
|
|
<a href="{% url 'home' %}" title="Boost Home" class="logo-link"><img src="{% static 'img/Boost_Symbol_Transparent.svg' %}" alt="Boost"></a>
|
|
<div id="selectedpage" onclick="openNav()" class=""><div id="pageName" class="capitalize">where</div><div class="material-symbols-outlined ml-1">arrow_drop_down</div></div>
|
|
<div id="pageselector" onmouseleave="closeNav()" class="hide" >
|
|
<div class="mobile-menu-item"><a href="{% url 'news' %}" title="News">News</a></div>
|
|
<div class="mobile-menu-item"><a href="{% url 'docs' %}" title="Learn">Learn</a></div>
|
|
<div class="mobile-menu-item"><a href="{% url 'community' %}" title="Community">Community</a></div>
|
|
<div class="mobile-menu-item"><a href="{% url 'libraries' %}" title="Libraries">Libraries</a></div>
|
|
<div class="mobile-menu-item"><a href="{% url 'releases-most-recent' %}" title="Releases">Releases</a></div>
|
|
</div>
|
|
</div>
|
|
<!-- desktop navbar -->
|
|
<div id="desktopNav" class="left-menubar">
|
|
<a href="{% url 'home' %}" title="Boost Home" class="logo-link"><img src="{% static 'img/Boost_Symbol_Transparent.svg' %}" alt="Boost"></a>
|
|
<a href="{% url 'news' %}" class="menu-link {% active_link 'news' css_class=' menu-link active-link' inactive_class='menu-link' %}">news</a>
|
|
<a href="{% url 'docs' %}" class="menu-link {% active_link 'docs||docs-user-guide' css_class=' menu-link active-link' inactive_class='menu-link' %}">learn</a>
|
|
<a href="{% url 'community' %}" class="menu-link {% active_link 'community' css_class=' menu-link active-link' inactive_class='menu-link' %}">community</a>
|
|
<a href="{% url 'libraries' %}" class="menu-link {% active_link 'libraries||docs-libs-page' css_class=' menu-link active-link' inactive_class='menu-link' %}">libraries</a>
|
|
<a href="{% url 'releases-most-recent' %}" class="menu-link {% active_link 'releases-most-recent' css_class=' menu-link active-link' inactive_class='menu-link' %}">releases</a>
|
|
</div>
|
|
<div class="right-menubar" x-data="{ 'searchOpen': false }">
|
|
<span style="position: relative;" x-ref="desktopSearchArea">
|
|
<i id="gecko-search-button" data-current-boost-version="{{ current_release.stripped_boost_url_slug }}" data-theme-mode="light" data-font-family="sans-serif" class="fas fa-search icon-link"></i>
|
|
<script>
|
|
const geckoSearchButton = document.getElementById('gecko-search-button');
|
|
geckoSearchButton.setAttribute('data-theme-mode', localStorage.getItem('colorMode') === 'dark' ? 'dark' : 'light');
|
|
</script>
|
|
</span>
|
|
<span x-data="{ 'guideOpen': false }" style="position:relative;">
|
|
<i class="icon-link fas fa-question-circle" @click="guideOpen = !guideOpen"></i>
|
|
<div x-show="guideOpen" x-cloak @click.away="guideOpen = false" id="guideMenu" class="guide-modal">
|
|
<a href="/doc/user-guide/index.html">User Guide</a>
|
|
<a href="/doc/contributor-guide/index.html">Contributor Guide</a>
|
|
<a href="/doc/formal-reviews/index.html">Formal Reviews</a>
|
|
</div>
|
|
</span>
|
|
{% if not disable_theme_switcher %}
|
|
<i id="light-dark" class="fas fa-sun icon-link " onclick="changeTheme()"></i>
|
|
{% endif %}
|
|
{% comment %}
|
|
The html and context for the user avatar and profile dropdown menu are coming from the view as
|
|
and html fragment fetched view htmx get request and inserted into #avatar
|
|
{% endcomment %}
|
|
<span x-data="{ 'userOpen': false }" class="menu-link" style="position: relative; width: 2rem;">
|
|
<div hx-get="/users/avatar/"
|
|
hx-trigger="load"
|
|
hx-target="#avatar"
|
|
hx-indicator=".htmx-indicator">
|
|
</div>
|
|
<span id="avatar">
|
|
<svg aria-hidden="true" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/>
|
|
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/>
|
|
</svg>
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
document.addEventListener("alpine:init", function() {
|
|
Alpine.data("searchToggleComponent", () => ({
|
|
searchButton: null,
|
|
desktopSearchArea: null,
|
|
mobileSearchArea: null,
|
|
init() {
|
|
this.searchButton = document.getElementById("gecko-search-button");
|
|
this.desktopSearchArea = this.$el.querySelector('[x-ref="desktopSearchArea"]');
|
|
this.mobileSearchArea = this.$el.querySelector('[x-ref="mobileSearchArea"]');
|
|
|
|
this.updateSearchButtonLocation();
|
|
},
|
|
updateSearchButtonLocation() {
|
|
if (window.innerWidth >= 768) {
|
|
this.desktopSearchArea.appendChild(this.searchButton);
|
|
} else {
|
|
this.mobileSearchArea.appendChild(this.searchButton);
|
|
}
|
|
}
|
|
}))
|
|
});
|
|
|
|
// ************ Mobile Navigation **************
|
|
|
|
let containingElement = document.getElementById("pageselector");
|
|
|
|
document.body.addEventListener('click', function( event ){
|
|
if(!containingElement.contains( event.target ) ){
|
|
closeNav();
|
|
}
|
|
});
|
|
|
|
var url = window.location.pathname;
|
|
var words = url.split("\/");
|
|
words[1] = words[1].replaceAll("\/", "");
|
|
console.log(words[1])
|
|
var tabname = "Home"
|
|
|
|
var pagename = document.getElementById("pageName")
|
|
switch (words[1]) {
|
|
case 'doc':
|
|
case 'docs':
|
|
tabname = "Learn"
|
|
break;
|
|
case 'community':
|
|
tabname = "community"
|
|
break;
|
|
case 'news':
|
|
tabname = "news"
|
|
break;
|
|
case 'libraries':
|
|
tabname = "libraries"
|
|
break;
|
|
case 'releases':
|
|
tabname = "releases"
|
|
break;
|
|
}
|
|
pagename.innerText='';
|
|
pagename.appendChild(document.createTextNode(tabname));
|
|
|
|
function openNav() {
|
|
ps = document.getElementById("pageselector");
|
|
ps.classList.remove('hide');
|
|
}
|
|
|
|
function closeNav() {
|
|
ps = document.getElementById("pageselector");
|
|
setTimeout(function() {
|
|
if (!ps.matches(':hover')) {
|
|
ps.classList.add('hide');
|
|
}
|
|
}, 2000);
|
|
}
|
|
|
|
// *********** manage theming *************
|
|
function makeDark() {
|
|
document.documentElement.classList.add('dark');
|
|
var iconchange = document.getElementById("light-dark")
|
|
localStorage.setItem("colorMode", "dark");
|
|
iconchange.classList.remove('fa-moon');
|
|
iconchange.classList.add('fa-sun');
|
|
}
|
|
|
|
function makeLight() {
|
|
document.documentElement.classList.remove('dark');
|
|
var iconchange = document.getElementById("light-dark")
|
|
localStorage.setItem("colorMode", "light");
|
|
iconchange.classList.remove('fa-sun');
|
|
iconchange.classList.add('fa-moon');
|
|
}
|
|
|
|
function changeTheme() {
|
|
if (document.documentElement.classList.contains("dark")) {
|
|
makeLight();
|
|
return;
|
|
}
|
|
makeDark();
|
|
}
|
|
|
|
function setTheme(theme) {
|
|
console.log(theme);
|
|
if (theme == "dark") {
|
|
makeDark();
|
|
return;
|
|
} else if (theme == "light") {
|
|
makeLight();
|
|
return;
|
|
} else {
|
|
makeLight();
|
|
}
|
|
}
|
|
|
|
if (window.matchMedia) {
|
|
console.log("hit match")
|
|
// Check if the dark-mode Media-Query matches
|
|
if(window.matchMedia('(prefers-color-scheme: dark)').matches){
|
|
console.log("a");
|
|
if(localStorage.getItem("colorMode") === null || localStorage.getItem("colorMode") == "dark" ) {
|
|
console.log("doom");
|
|
makeDark();
|
|
localStorage.removeItem("colorMode")
|
|
} else {
|
|
makeLight();
|
|
};
|
|
} else if (window.matchMedia('(prefers-color-scheme: light)').matches) {
|
|
console.log("b");
|
|
if(localStorage.getItem("colorMode") === null || localStorage.getItem("colorMode") == "light" ) {
|
|
makeLight();
|
|
console.log("boom");
|
|
localStorage.removeItem("colorMode")
|
|
} else {
|
|
makeDark();
|
|
};
|
|
} else {
|
|
console.log("c");
|
|
setTheme(localStorage.getItem("colorMode"));
|
|
}
|
|
} else {
|
|
console.log("d");
|
|
setTheme(localStorage.getItem("colorMode"));
|
|
}
|
|
|
|
</script>
|