Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta #107

Merged
merged 11 commits into from
Oct 9, 2024
18 changes: 16 additions & 2 deletions assets/js/offline-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -3497,6 +3497,16 @@
$searchInput.blur();
});

// Allow enter to be used to re-trigger search
$searchInput.on('keydown', (event) => {
if (event.key === 'Enter' || event.which === 13) {
render($(event.target));

// Hide keyboard on mobile browser
$searchInput.blur();
}
});

// Prevent reloading page by enter key on sidebar search.
$searchInput.closest('form').on('submit', () => {
return false;
Expand Down Expand Up @@ -3545,7 +3555,7 @@

{
let popover = bootstrap.Popover.getInstance($targetSearchInput[0]);
if (popover !== null) {
if (popover !== null ) {
popover.dispose();
}
}
Expand Down Expand Up @@ -3661,8 +3671,12 @@

$targetSearchInput.one('shown.bs.popover', () => {
$('.td-offline-search-results__close-button').on('click', () => {
$targetSearchInput.val('');
$targetSearchInput.val(searchQuery);
$targetSearchInput.trigger('change');
{
let popover = bootstrap.Popover.getInstance($targetSearchInput[0]);
popover.dispose();
}
});
});

Expand Down
1 change: 0 additions & 1 deletion layouts/blog/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
</div>
{{ partial "footer.html" . }}
</div>
{{ partial "scripts.html" . }}
<script>
const toggleButton = document.querySelector('.td-sidebar__toggle');
const targetCollapse = document.querySelector('#td-section-nav');
Expand Down
3 changes: 1 addition & 2 deletions layouts/docs/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="container-fluid td-outer">
<div class="td-main">
<div class="row flex-xl-nowrap">
<aside class="col-12 col-md-3 col-xxl-2 td-sidebar d-print-none " id="sidebar-docs">
<aside class="col-12 col-md-3 td-sidebar d-print-none " id="sidebar-docs">
{{ partial "sidebar-docs.html" . }}
</aside>
<aside class="d-none d-xl-block col-xl-2 td-sidebar-toc d-print-none">
Expand All @@ -28,7 +28,6 @@
</div>
{{ partial "footer.html" . }}
</div>
{{ partial "scripts.html" . }}
<script>
const toggleButton = document.querySelector('.td-sidebar__toggle');
const targetCollapse = document.querySelector('#td-section-nav');
Expand Down
19 changes: 1 addition & 18 deletions layouts/shortcodes/blocks/cover.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
{{ $blockID := printf "td-cover-block-%d" .Ordinal }}
{{ $promo_image := (.Page.Resources.ByType "image").GetMatch "**background*" }}
{{ $promo_image_dark := (.Page.Resources.ByType "image").GetMatch "**darkground*" -}}
{{ $logo_image := (.Page.Resources.ByType "image").GetMatch "**logo*" }}
{{ $logo_image_dark := (.Page.Resources.ByType "image").GetMatch "**darkogo*" }}
{{ $logo_image := (.Page.Resources.ByType "image").GetMatch "**darkogo*" }}
{{ $col_id := .Get "color" | default "dark" }}
{{ $class := .Get "class" | default "" }}
{{ $image_anchor := .Get "image_anchor" | default "smart" }}
Expand Down Expand Up @@ -32,12 +31,6 @@
background-image: url({{ $promo_image_big.RelPermalink }});
}
}
.cover-logo-light {
display: block;
}
.cover-logo-dark {
display: none;
}
[data-bs-theme="dark"]{
#{{ $blockID }} {
background-image: url({{ $promo_image_dark_small.RelPermalink }});
Expand All @@ -47,13 +40,6 @@
background-image: url({{ $promo_image_dark_big.RelPermalink }});
}
}
.cover-logo-light {
display: none;
}
.cover-logo-dark {
display: block;
}

}
</style>
{{ end }}
Expand All @@ -68,10 +54,7 @@
<div class="text-center">
{{ with .Get "title" }}<h1 class="display-1 mt-0">{{ $title := . }}
{{ with $logo_image }}
{{ with $logo_image_dark }}
<img class="td-cover-logo cover-logo-light" src="{{ $logo_image.RelPermalink }}" alt="{{ $title | html }} Logo">
<img class="td-cover-logo cover-logo-dark" src="{{ $logo_image_dark.RelPermalink }}" alt="{{ $title | html }} Logo">
{{ end }}
{{ end }}
</h1>
{{ end }}
Expand Down
101 changes: 65 additions & 36 deletions static/css/rosenpass.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@


/* General, site-wide changes to the theme */
body {
max-width: 1920px;
margin-left: auto;
margin-right: auto;
}

div.row p,
div.row h4,
div.row ol li {
max-width: 1200px;
margin-left: auto;
margin-right: auto;
}



@media (min-width: 768px) {

Expand Down Expand Up @@ -262,7 +277,7 @@ a.td-rss-button {
a {
color: var(--bs-link-color);
font-weight: bold;
text-wrap: auto;
text-wrap: wrap;
min-width: 210px;
background-image: none;
background-color: inherit;
Expand All @@ -283,7 +298,7 @@ a.td-rss-button {
p {
padding: var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);
font-size: smaller;
text-wrap: auto;
text-wrap: wrap;
max-width: 290px;
}
}
Expand Down Expand Up @@ -998,7 +1013,7 @@ aside#sidebar-docs #td-sidebar-menu{
}

.td-default main > section:first-of-type {
padding-top: 3rem;
padding-top: 4rem;
}
}

Expand Down Expand Up @@ -1087,7 +1102,7 @@ margin-left: 1rem;
position: relative;
}

@media(max-width: 768px){
@media(max-width: 767px){
.options-box {
position: absolute;
right: 4.4rem;
Expand Down Expand Up @@ -1133,24 +1148,29 @@ header {

}

.navbar-nav:has(input.td-search__input:not(:hover, :focus)) {
div.td-search input.td-search__input:not(:hover) {
transition: all 0.01s 0.1s;
width: 36px;
box-shadow: none;
}
}
@media (max-width: 522px) {
.td-light-dark-menu {
transition: visibility 0s 0.1s;
visibility: visible;
@media (max-width: 1500px){
.navbar-nav:has(input.td-search__input:not(:hover, :focus)) {
div.td-search input.td-search__input:not(:hover) {
transition: all 0.01s 0.1s;
width: 36px;
box-shadow: none;
}
}
}

.container-fluid:has(input.td-search__input:focus),
body:has(.td-offline-search-results) {
.td-search__input {
box-shadow: inset 0 0 0 2px var(--bs-primary) !important;
.container-fluid:has(input.td-search__input:focus),
.container-fluid:has(input.td-search__input:hover),
body:has(.td-offline-search-results) {
.td-search__input {
transition: all 0.5s ease-in-out 0.2s;
width: 207px !important;
margin-left: 0.2rem;
margin-right: 0.1rem;
}
@media (max-width: 522px) {
.td-light-dark-menu {
transition: visibility 0s 0.5s ease-in-out;
visibility: hidden;
}
}
}
}

Expand All @@ -1164,9 +1184,6 @@ body:has(.td-offline-search-results) {

.td-search__input {
transition: all 0.5s ease-in-out 0.2s;
width: 207px !important;
margin-left: 0.2rem;
margin-right: 0.1rem;
background-color: var(--bs-white);
}
#main_navbar {
Expand All @@ -1178,14 +1195,23 @@ body:has(.td-offline-search-results) {
.td-search__icon {
color: var(--bs-primary);
}
@media (max-width: 522px) {
.td-light-dark-menu {
transition: visibility 0s 0.5s ease-in-out;
visibility: hidden;
}
}
@media (max-width: 522px) {
.td-light-dark-menu {
transition: visibility 0s 0.1s;
visibility: visible;
}
}

.container-fluid:has(input.td-search__input:focus),
body:has(.td-offline-search-results) {
.td-search__input {
box-shadow: inset 0 0 0 2px var(--bs-primary) !important;
}
}



/* Handles expansion of navbar. Not sure if best end result */
.navbar-nav {
@media(min-width:920px){
Expand All @@ -1194,16 +1220,13 @@ body:has(.td-offline-search-results) {
@media(min-width:1038px){
max-height: 50px !important;
}
/* @media(min-width:1170px){
max-height: 50px !important;
} */
}

.search-highlight {
font-size: small;
width: fit-content;
max-width: 80%;
text-wrap: auto;
text-wrap: wrap;
margin-top: -0.5rem;
}

Expand Down Expand Up @@ -1340,7 +1363,7 @@ font-weight: inherit;
.td-cover-block .rp-buttonrow a.btn {
margin: 0 7px;
width: 11em;
font-size: 18px;
font-size: 1.5rem;
}

.td-cover-block .fa-circle-chevron-down {
Expand Down Expand Up @@ -1485,6 +1508,10 @@ main:has(.man-page-section) .pt-5{
padding-left: 0.2rem;
padding-right: 0.2rem;
}

var {
font-style: normal;
}
}

/* Video Embed */
Expand Down Expand Up @@ -1551,7 +1578,7 @@ background-color: #000000;
margin-right: 2rem;
color: white;
text-shadow: 1px 1px 4px black;
font-size: 1.5vw;
font-size: 1.5rem;
}

@media (max-width: 768px){
Expand Down Expand Up @@ -1746,7 +1773,6 @@ background-color: #000000;
.contact-buttons {
display: flex;
justify-content: space-evenly;
min-width: 60vw;
width: auto;
padding-left: 0;
padding-right: 0;
Expand Down Expand Up @@ -2031,6 +2057,9 @@ img.rp-supporter {

.rosenpass-overview-links {
display: flex;
max-width: 1500px;
margin-left: auto;
margin-right: auto;
}

.rosenpass-overview-links .col .row {
Expand Down
Loading