') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Footer design by enatario · Pull Request #9 · RubyGemsOrg/rubycentral-theme · GitHub
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
127 changes: 87 additions & 40 deletions partials/footer.hbs
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,88 @@
<footer class='footer'>
<div class='footer__inner'>
<section class='footer__links'>
<nav aria-label="Site">
{{navigation type='secondary'}}
</nav>
</section>
<section class='footer__bottom'>
<form
action='https://rubycentral.us13.list-manage.com/subscribe/post?u=e7e9b891a6914ff2f5acdfd15&amp;id=0a6a1336c5&amp;v_id=5118&amp;f_id=008ef4e7f0'
autocomplete='off'
class='footer__form'
method='post'
>
<div class='footer__form__row'>
<input
data-lpignore='true'
data-1p-ignore
name='EMAIL'
placeholder='Enter your email...'
required='true'
type='email'
/>
<div class='kg-button-card'>
<button class='kg-btn' type='submit'>Sign Up</button>
</div>
</div>
</form>
<div class='footer__bottom__socials'>
<div class='footer__bottom__socials__links'>
{{#get 'pages' filter="title:'Footer - Socials'" limit='1'}}
{{#foreach pages}}
{{content}}
{{/foreach}}
{{/get}}
</div>
<small>©{{date format='YYYY'}} Ruby Central. All Rights Reserved.</small>
</div>
</section>
</div>
<footer class="global-footer u-grid">

<a href="/" class="global-footer__logo">{{> "icons/logo"}}</a>

<div class="global-footer__links">
<section class="global-footer__section">
<h2 class="global-footer__heading">Ecosystem</h2>
<nav class="global-footer__nav" aria-label="Ecosystem">
{{#get 'pages' filter="title:'Footer - Ecosystem'" limit='1'}}
{{#foreach pages}}
{{content}}
{{/foreach}}
{{/get}}
</nav>
</section>

<section class="global-footer__section">
<h2 class="global-footer__heading">Ruby Central</h2>
<nav class="global-footer__nav" aria-label="Ruby Central">
{{#get 'pages' filter="title:'Footer - Ruby Central'" limit='1'}}
{{#foreach pages}}
{{content}}
{{/foreach}}
{{/get}}
</nav>
</section>

<section class="global-footer__section">
<h2 class="global-footer__heading">Get involved</h2>
<nav class="global-footer__nav" aria-label="Get involved">
{{#get 'pages' filter="title:'Footer - Get Involved'" limit='1'}}
{{#foreach pages}}
{{content}}
{{/foreach}}
{{/get}}
</nav>
</section>

<section class="global-footer__section">
<h2 class="global-footer__heading">Follow us</h2>
<nav class="global-footer__nav" aria-label="Follow us">
{{#get 'pages' filter="title:'Footer - Socials'" limit='1'}}
{{#foreach pages}}
{{content}}
{{/foreach}}
{{/get}}
</nav>
</section>
</div>

<section class="global-footer__newsletter">
<h2 class="heading-subsection u-grid-span-7">Subscribe to our newsletter</h2>
<form
action="https://rubycentral.us13.list-manage.com/subscribe/post?u=e7e9b891a6914ff2f5acdfd15&amp;id=0a6a1336c5&amp;v_id=5118&amp;f_id=008ef4e7f0"
autocomplete="off"
class="global-footer__newsletter-form u-grid-span-3"
method="post"
>
<label for="global-footer-newsletter-email" class="u-grid-span-2">
<span>Your email address</span>
<input
autocapitalize="off"
autocomplete="email"
autocorrect="off"
data-lpignore="true"
data-1p-ignore
id="global-footer-newsletter-email"
name="EMAIL"
required
spellcheck="false"
type="email"
/>
</label>
<button type="submit" class="button button--inverted">Sign up</button>
</form>
</section>

<section class="global-footer__section--bottom">
<small class="global-footer__copyright">©<time datetime="{{date format='YYYY'}}">{{date format='YYYY'}}</time> Ruby Central. All Rights Reserved.</small>
<nav class="global-footer__nav" aria-label="Legal">
{{#get 'pages' filter="title:'Footer - Legal'" limit='1'}}
{{#foreach pages}}
{{content}}
{{/foreach}}
{{/get}}
</nav>
</section>
</footer>
3 changes: 3 additions & 0 deletions src/css/app.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,13 +14,16 @@
@import "base/_forms.css" layer(base);
@import "base/_lists.css" layer(base);
@import "base/_media.css" layer(base);
@import "base/_page.css" layer(base);
@import "base/_tables.css" layer(base);
@import "base/_typography.css" layer(base);

/* Components */
/* Import components from the component folder here in ABC order */
@import "components/_global-footer.css" layer(components);
@import "components/_global-nav.css" layer(components);

@import "utilities/_grid.css" layer(utilities);
@import "utilities/_hide-visually.css" layer(utilities);

/* Vendors */
Expand Down
15 changes: 15 additions & 0 deletions src/css/base/_buttons.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,6 +51,21 @@
}
}

.button--inverted {
--bg-color: var(--color--button-secondary);

background-color: var(--bg-color);
border-color: var(--color--button-secondary-hover);
border-radius: var(--border-radius--small) var(--border-radius--base) var(--border-radius--small) var(--border-radius--base);
color: contrast-color(var(--bg-color));

&:hover,
&:focus-visible {
--bg-color: var(--color--button-primary-hover);
color: contrast-color(var(--bg-color));
}
}

.button--icon {
background-color: var(--color--button-secondary);
border-radius: var(--border-radius--small);
Expand Down
4 changes: 2 additions & 2 deletions src/css/base/_forms.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -74,7 +74,7 @@ form {
[type="week"]
) {
background-color: var(--color--background-base);
border-radius: var(--border-radius--base);
border-radius: var(--border-radius--small);
color: var(--color--text-base);
padding-block: var(--space--small);
padding-inline: var(--space--small);
Expand DownExpand Up@@ -174,7 +174,7 @@ textarea {
appearance: none;
background-color: var(--color--background-base);
border: 0;
border-radius: var(--border-radius--base);
border-radius: var(--border-radius--small);
height: var(--border-width--thick);
width: 100%;

Expand Down
3 changes: 3 additions & 0 deletions src/css/base/_page.css
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
body:has(.global-nav, .global-footer) {
container: global-nav global-footer / inline-size;
}
21 changes: 10 additions & 11 deletions src/css/base/_typography.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,11 +4,11 @@ html {
}

body {
color: var(--color--text-base);
font-family: var(--font-family--body);
font-size: var(--font-size--body-default);
font-size: var(--font-size--body-base);
font-weight: var(--font-weight--normal);
line-height: var(--line-height--base);
color: var(--color--text-base);
}

:where(
Expand All@@ -29,7 +29,6 @@ h1 {
a {
color: var(--color--link);
text-decoration-color: var(--color--link-accent);
text-decoration-thickness: 10%;
transition: var(--transition-duration--base) text-decoration-color var(--transition-timing--base);

&:hover {
Expand All@@ -44,17 +43,17 @@ label {
}

input {
font-size: var(--font-size--body-default);
font-size: var(--font-size--body-base);
}

legend {
font-size: var(--font-size--body-default);
font-size: var(--font-size--body-base);
font-weight: var(--font-weight--bold);
}

hr {
width: 100%;
border: var(--border--light);
width: 100%;
}

table {
Expand DownExpand Up@@ -82,31 +81,31 @@ small {
}

.heading-section {
font-family: var(--font-family--heading-default);
font-family: var(--font-family--heading-base);
font-size: var(--font-size--heading-section);
font-weight: var(--font-weight--normal);
}

.heading-subsection {
font-family: var(--font-family--heading-default);
font-family: var(--font-family--heading-base);
font-size: var(--font-size--heading-subsection);
font-weight: var(--font-weight--normal);
}

.heading-title-big {
font-family: var(--font-family--heading-default);
font-family: var(--font-family--heading-base);
font-size: var(--font-size--heading-title-big);
font-weight: var(--font-weight--normal);
}

.heading-title-small {
font-family: var(--font-family--heading-default);
font-family: var(--font-family--heading-base);
font-size: var(--font-size--heading-title-small);
font-weight: var(--font-weight--normal);
}

.body-callout {
font-family: var(--font-family--heading-default);
font-family: var(--font-family--heading-base);
font-size: var(--font-size--body-callout);
font-weight: var(--font-weight--normal);
}
6 changes: 3 additions & 3 deletions src/css/base/_variables.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,7 +66,7 @@
--font-size--600: clamp(3rem, 1.875rem + 3vw, 3.75rem);

--font-size--body-callout: var(--font-size--500);
--font-size--body-default: var(--font-size--100);
--font-size--body-base: var(--font-size--100);
--font-size--body-large: var(--font-size--200);
--font-size--body-small: var(--font-size--50);
--font-size--heading-data: var(--font-size--200);
Expand All@@ -81,10 +81,10 @@
--font-weight--bold: 700;

--font-family--sans: system-ui, "Arial", "Helvetica", sans-serif;
--font-family--serif: Hoefler Text, Baskerville Old Face, Garamond, Times New Roman, serif;
--font-family--serif: hoefler text, baskerville old face, garamond, times new roman, serif;

--font-family--body: var(--font-family--sans);
--font-family--heading-default: var(--font-family--serif);
--font-family--heading-base: var(--font-family--serif);
--font-family--heading-overline: var(--font-family--sans);
--font-family--heading-data: var(--font-family--sans);

Expand Down
Loading