fix(tinytorch): update branding colors and sidebar tagline

- Change navbar brand text to warm cream (#fef3c7)
- Add "Build-It-Yourself Companion" tagline under sidebar logo
- Remove duplicate tagline from intro page main content
This commit is contained in:
Vijay Janapa Reddi
2025-12-15 17:32:27 -05:00
parent 4c4255b34b
commit e8c9303c82
4 changed files with 24 additions and 39 deletions

View File

@@ -290,7 +290,7 @@ pre.mermaid {
align-items: center;
font-size: 1.2rem;
font-weight: 600;
color: #ffffff;
color: #fef3c7;
text-decoration: none;
letter-spacing: -0.01em;
}

View File

@@ -1,46 +1,37 @@
// Add permanent textbook link to sidebar on all pages
// Add tagline directly under the logo in the sidebar
document.addEventListener('DOMContentLoaded', function() {
// Find the sidebar header (logo area)
const sidebarHeader = document.querySelector('.sidebar-header-items.sidebar-primary__section');
// Find the logo link in the sidebar
const logoLink = document.querySelector('.navbar-brand.logo');
if (sidebarHeader) {
// Create the link container
const linkBox = document.createElement('div');
linkBox.className = 'sidebar-textbook-link';
linkBox.style.cssText = `
margin: 0.5rem 1rem;
padding: 0.6rem 0.8rem;
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
border: 1px solid #e2e8f0;
border-radius: 6px;
text-align: center;
`;
// Create the actual link
const link = document.createElement('a');
link.href = 'https://mlsysbook.ai';
link.target = '_blank';
link.rel = 'noopener noreferrer';
link.textContent = 'Hands-on labs for the ML Systems textbook';
link.style.cssText = `
font-size: 0.75rem;
if (logoLink) {
// Create the tagline element
const tagline = document.createElement('a');
tagline.href = 'https://mlsysbook.ai';
tagline.target = '_blank';
tagline.rel = 'noopener noreferrer';
tagline.className = 'sidebar-tagline';
tagline.innerHTML = 'A Build-It-Yourself Companion to the <strong>Machine Learning Systems</strong> textbook';
tagline.style.cssText = `
display: block;
font-size: 0.7rem;
color: #64748b;
text-decoration: none;
line-height: 1.4;
display: block;
margin-top: 0.25rem;
padding: 0 0.5rem;
text-align: center;
transition: color 0.2s ease;
`;
// Add hover effect
link.addEventListener('mouseenter', function() {
this.style.color = '#1e293b';
tagline.addEventListener('mouseenter', function() {
this.style.color = '#f97316';
});
link.addEventListener('mouseleave', function() {
tagline.addEventListener('mouseleave', function() {
this.style.color = '#64748b';
});
// Assemble and insert
linkBox.appendChild(link);
sidebarHeader.appendChild(linkBox);
// Insert right after the logo
logoLink.parentNode.insertBefore(tagline, logoLink.nextSibling);
}
});

View File

@@ -12,7 +12,7 @@ document.addEventListener('DOMContentLoaded', function() {
<div class="tinytorch-bar-content">
<div class="tinytorch-bar-left">
<a href="intro.html" class="tinytorch-bar-brand">
<span class="brand-fire">🔥</span>Tiny<span class="brand-fire">🔥</span>Torch
Tiny<span class="brand-fire">🔥</span>Torch
</a>
<span class="tinytorch-bar-badge">Under Construction</span>
</div>

View File

@@ -12,12 +12,6 @@ Build Your Own ML Framework
</p>
```
<p style="text-align: center; margin: 0 0 1rem 0;">
<a href="https://mlsysbook.ai" target="_blank" style="color: #64748b; font-size: 0.95rem; text-decoration: none; border-bottom: 1px solid #cbd5e1;">
Hands-on labs for the <span style="font-weight: 600; color: #475569;">Machine Learning Systems</span> textbook
</a>
</p>
<h2 style="background: linear-gradient(135deg, #E74C3C 0%, #E67E22 50%, #F39C12 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; text-align: center; font-size: 2.5rem; margin: 1rem 0; font-weight: 700;">
Don't import it. Build it.
</h2>