Skip to content

Commit 2302732

Browse files
committed
feat: add website theme and assets
1 parent 211241b commit 2302732

15 files changed

Lines changed: 1342 additions & 0 deletions

www.itedev.com/assets/css/main.css

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
:root{
2+
--bg-dark:#0d1117;
3+
--card-dark:#0f1720;
4+
--text:#c9d1d9;
5+
--muted:#8b949e;
6+
--accent:#8b9cfb;
7+
--radius:12px;
8+
}
9+
:root.light {
10+
--bg-dark:#f6f8fa;
11+
--card-dark:#ffffff;
12+
--text:#0b1220;
13+
--muted:#586069;
14+
--accent:#4c6ef5;
15+
}
16+
html,body{height:100%;}
17+
body{
18+
margin:0;
19+
font-family: "Noto Serif SC", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
20+
background:var(--bg-dark);
21+
color:var(--text);
22+
-webkit-font-smoothing:antialiased;
23+
line-height:1.6;
24+
}
25+
.container{max-width:1100px;margin:36px auto;padding:0 20px;}
26+
.site-header{display:flex;justify-content:space-between;align-items:center;padding:12px 20px;}
27+
.logo{font-weight:700;}
28+
nav a{margin:0 8px;color:var(--muted)}
29+
.hero{display:flex;gap:20px;align-items:center;padding:24px;background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent);border-radius:var(--radius);box-shadow:0 6px 18px rgba(2,6,23,0.6);}
30+
.avatar{width:120px;height:120px;border-radius:50%;object-fit:cover;border:3px solid rgba(255,255,255,0.03)}
31+
.hero h1{margin:0;font-size:28px}
32+
.hero p.sub{color:var(--muted);margin-top:6px}
33+
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:18px;margin-top:20px}
34+
.card{background:var(--card-dark);padding:16px;border-radius:12px;box-shadow:0 4px 14px rgba(2,6,23,0.6);border:1px solid rgba(255,255,255,0.02)}
35+
a { color:var(--accent); text-decoration:none; }
36+
.post-body img{max-width:100%;height:auto;border-radius:8px;}
37+
.post-body pre{overflow:auto;padding:12px;border-radius:8px;background:rgba(0,0,0,0.4)}
38+
.search-results{position:absolute;background:var(--card-dark);border-radius:8px;max-height:300px;overflow:auto;padding:8px;box-shadow:0 8px 24px rgba(2,6,23,0.6)}
39+
footer{margin-top:40px;padding:20px;color:var(--muted);font-size:14px;text-align:center}
40+
@media (max-width:640px){
41+
.hero{flex-direction:column;align-items:flex-start}
42+
.avatar{width:96px;height:96px}
43+
}
89.9 KB
Loading
28.9 KB
Loading

www.itedev.com/assets/img/demo.jpg

30.2 KB
Loading
29.7 KB
Loading

www.itedev.com/assets/js/theme.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Noctua v3 theme JS
2+
document.addEventListener('DOMContentLoaded', function(){
3+
// Respect prefers-color-scheme
4+
try {
5+
const prefersLight = window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches;
6+
if(prefersLight){
7+
document.documentElement.classList.add('light');
8+
}
9+
} catch(e){}
10+
11+
// Auto-add lazyload attributes to markdown images
12+
document.querySelectorAll('.post-body img').forEach(function(img){
13+
if(!img.classList.contains('lazyload')){
14+
img.setAttribute('data-src', img.getAttribute('src'));
15+
img.setAttribute('loading', 'lazy');
16+
img.classList.add('lazyload');
17+
// keep src as placeholder to avoid broken images when lazysizes not loaded
18+
img.removeAttribute('src');
19+
}
20+
});
21+
22+
// init highlight.js if available
23+
if(window.hljs){
24+
try{ hljs.highlightAll(); }catch(e){}
25+
}
26+
27+
// init KaTeX auto-render (if present)
28+
if(window.renderMathInElement){
29+
try{ renderMathInElement(document.body); }catch(e){}
30+
}
31+
32+
// init search when simple-jekyll-search is present
33+
if(window.SimpleJekyllSearch){
34+
try{
35+
SimpleJekyllSearch({
36+
searchInput: document.getElementById('search-input'),
37+
resultsContainer: document.getElementById('results-container'),
38+
json: '/search.json',
39+
limit: 10,
40+
fuzzy: false,
41+
searchResultTemplate: '<li><a href="{url}">{title}</a> <small style="color:var(--muted)">{date}</small></li>'
42+
});
43+
}catch(e){}
44+
}
45+
46+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@import url('./Black/index.css');
2+
@import url('./Bold/index.css');
3+
@import url('./ExtraBold/index.css');
4+
@import url('./ExtraLight/index.css');
5+
@import url('./Light/index.css');
6+
@import url('./Medium/index.css');
7+
@import url('./Regular/index.css');
8+
@import url('./SemiBold/index.css');

www.itedev.com/assets/vendor/auto-render.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

www.itedev.com/assets/vendor/fuse.min.js

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

www.itedev.com/assets/vendor/highlight.github-dark.min.css

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)