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
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ Polymaker-Preset/
├── google7567ee593a9049c2.html # Google site verification
├── assets/ # Static assets
│ ├── logo/
│ │ └── Polymaker Teal.png # Polymaker logo (brand Teal)
│ │ ├── Polymaker Teal.png # English logo (default / en)
│ │ └── Chinese_NoSlogan_Teal.png # Chinese logo (zh; switched in i18n.js)
│ └── font/Figtree/ # Figtree variable fonts + OFL
├── preset/ # All preset JSON files
│ └── <Material>/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Polymaker-Preset/
├── index.json # Auto-generated index of all presets
├── package.json # Node.js project configuration
├── assets/ # Static assets (logo, fonts)
│ ├── logo/ # Brand logo (e.g. Polymaker Teal.png)
│ ├── logo/ # Polymaker Teal.png (en), Chinese_NoSlogan_Teal.png (zh)
│ └── font/Figtree/ # Self-hosted Figtree variable fonts (.ttf)
├── preset/ # All preset JSON files
│ └── <Material>/
Expand Down
Binary file added assets/logo/Chinese_NoSlogan_Teal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
// To add a new language: add a new key block below and a <li> in the lang dropdown in index.html.

var I18N = (function () {
var LOGO_SRC = {
en: './assets/logo/Polymaker%20Teal.png',
zh: './assets/logo/Chinese_NoSlogan_Teal.png'
};

var TRANSLATIONS = {
en: {
// Hero
'hero.logo.alt': 'Polymaker',
'hero.title': 'Filament Presets',
'hero.desc': 'Select your slicer to view and download Polymaker print profiles and filament presets',
'hero.howto': 'How to use?',
Expand Down Expand Up @@ -124,6 +130,7 @@ var I18N = (function () {

zh: {
// Hero
'hero.logo.alt': '\u805a\u590d\u79d1\u6280',
'hero.title': '耗材预设文件',
'hero.desc': '选择您的切片软件,查看并下载 Polymaker 打印配置文件和耗材预设',
'hero.howto': '如何使用?',
Expand Down Expand Up @@ -321,6 +328,16 @@ var I18N = (function () {
}
}

var logoEl = document.getElementById('hero-logo');
if (logoEl) {
logoEl.src = LOGO_SRC[lang] || LOGO_SRC.en;
logoEl.alt = t('hero.logo.alt');
}

if (document.documentElement) {
document.documentElement.setAttribute('lang', lang === 'zh' ? 'zh' : 'en');
}

// Notify app.js to re-render dynamic content
document.dispatchEvent(new CustomEvent('langchange', { detail: { lang: lang } }));
}
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<header class="hero">
<div class="hero-main">
<h1 class="hero-title">
<img src="./assets/logo/Polymaker%20Teal.png" alt="Polymaker" class="hero-logo">
<img id="hero-logo" src="./assets/logo/Polymaker%20Teal.png" alt="Polymaker" class="hero-logo">
<span class="preset-text" data-i18n="hero.title">Filament Presets</span>
</h1>
<div class="hero-actions">
Expand Down
34 changes: 33 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,53 @@ body.theme-wiki .bg-gradient {
font-weight: 700;
margin: 0 0 0.15rem;
letter-spacing: -0.01em;
line-height: 1;
display: flex;
align-items: center;
gap: 0.5rem;
gap: 0.35em;
flex-wrap: wrap;
}

.hero-logo {
height: 1.75em;
width: auto;
display: block;
vertical-align: middle;
flex-shrink: 0;
}

/* Lock subtitle to same vertical box as logo; color differs only */
.preset-text {
margin: 0;
padding: 0;
color: #fff;
font-weight: 700;
font-size: 1em;
line-height: 1;
letter-spacing: inherit;
display: inline-flex;
align-items: center;
min-height: 1.75em;
}

html[lang="en"] .hero-title {
letter-spacing: -0.01em;
}

html[lang="en"] .preset-text {
letter-spacing: -0.01em;
}

/* Chinese lockup: match raster wordmark in logo (聚复科技) — tighter tracking, slightly smaller caps */
html[lang="zh"] .hero-title {
letter-spacing: 0.02em;
}

html[lang="zh"] .preset-text {
letter-spacing: 0.07em;
font-size: 1.13em;
margin-top: 4px;
margin-left: -3px;
}

body.theme-wiki .preset-text {
Expand Down
Loading