feat: Modular UI component refactor Enhanced navbar and hero section

This commit is contained in:
Fechin committed 2025-06-20 20:42:55 +08:00
1 parent 3caacd4567
commit e08ec9eba9
58 files changed
+2008 -229

No files matched your search

+26 -1
View File
@@ -8,8 +8,33 @@ module.exports = {
ignoreAtRules: ['tailwind', 'apply', 'variants', 'responsive', 'screen', 'layer']
}
],
// Disable @apply deprecation warning, as this is a Tailwind CSS feature
'at-rule-no-deprecated': null,
// Allow duplicate selectors, as this is common in generated CSS
'no-descending-specificity': null,
'selector-class-pattern': null // Allow camelCase class names
'no-duplicate-selectors': null,
// Allow camelCase class names
'selector-class-pattern': null,
// Allow camelCase ID selectors
'selector-id-pattern': null,
// Allow unknown properties (Tailwind generated CSS variables)
'property-no-unknown': null,
// Allow unknown type selectors (custom elements)
'selector-type-no-unknown': null,
// Allow unknown declaration values
'declaration-property-value-no-unknown': null,
// Allow duplicate custom properties
'declaration-block-no-duplicate-custom-properties': null,
// Allow multiple declarations on single line
'declaration-block-single-line-max-declarations': null,
// Allow decimal precision
'number-max-precision': null,
// Allow unknown media feature values
'media-feature-name-value-no-unknown': null,
// Allow non-kebab-case keyframe names
'keyframes-name-pattern': null,
// Allow empty source files
'no-empty-source': null
},
ignoreFiles: [
'node_modules/**/*',
+1 -1
View File
@@ -383,7 +383,7 @@ file should include a front matter section with the following format:
title: CheatSheets
date: 2020-11-25 18:28:43
icon: icon-style
background: bg-emerald-600
background: bg-indigo-600
tags:
categories:
- Other
+3
View File
@@ -43,6 +43,7 @@
"hexo-browsersync": "^0.3.0",
"hexo-excerpt": "^1.3.1",
"hexo-filter-nofollow": "^2.0.2",
"hexo-fs": "^5.0.0",
"hexo-generator-index": "^4.0.0",
"hexo-generator-sitemap": "^3.0.1",
"hexo-log": "^4.1.0",
@@ -52,6 +53,8 @@
"hexo-renderer-markdown-it": "^5.0.0",
"hexo-renderer-stylus": "^3.0.1",
"hexo-server": "^3.0.0",
"hexo-util": "^3.3.0",
"highlight.js": "^11.11.1",
"markdown-it-abbr": "^2.0.0",
"markdown-it-anchor": "^9.2.0",
"markdown-it-attrs": "^4.3.1",
+34
View File
@@ -47,6 +47,9 @@ importers:
hexo-filter-nofollow:
specifier: ^2.0.2
version: 2.0.2
hexo-fs:
specifier: ^5.0.0
version: 5.0.0
hexo-generator-index:
specifier: ^4.0.0
version: 4.0.0
@@ -74,6 +77,12 @@ importers:
hexo-server:
specifier: ^3.0.0
version: 3.0.0
hexo-util:
specifier: ^3.3.0
version: 3.3.0
highlight.js:
specifier: ^11.11.1
version: 11.11.1
markdown-it-abbr:
specifier: ^2.0.0
version: 2.0.0
@@ -988,6 +997,10 @@ packages:
resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}
engines: {node: '>= 8.10.0'}
chokidar@4.0.3:
resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==}
engines: {node: '>= 14.16.0'}
class-utils@0.3.6:
resolution: {integrity: sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==}
engines: {node: '>=0.10.0'}
@@ -2292,6 +2305,10 @@ packages:
resolution: {integrity: sha512-Q92zQ5PlVDouvSWFLXQoFSTLIUIODikUJs2BfAXQglyOEjN1dOQn1Z5Nimk/7GHof17R5h/uObCQLnZAjzI2tg==}
engines: {node: '>=14'}
hexo-fs@5.0.0:
resolution: {integrity: sha512-oBkg1QgXyb4JxipaH+yCV/7E7XOUASTK6x1pocWvLw6U2mB6VfLENgYg61ft9Qn6JCiKSzs7FU4vyTUy6gIPvQ==}
engines: {node: '>=18'}
hexo-generator-index@4.0.0:
resolution: {integrity: sha512-KeM7mOCKWINGFAk1E+CkjMMgqFIv8oaRbGxR7ipkQAp44o4aopkVftma4sdIplOq9WQEWfVYDUK5gEv9J3nzUg==}
engines: {node: '>=18'}
@@ -4142,6 +4159,10 @@ packages:
resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
engines: {node: '>=8.10.0'}
readdirp@4.1.2:
resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==}
engines: {node: '>= 14.18.0'}
rechoir@0.8.0:
resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==}
engines: {node: '>= 10.13.0'}
@@ -6032,6 +6053,10 @@ snapshots:
optionalDependencies:
fsevents: 2.3.3
chokidar@4.0.3:
dependencies:
readdirp: 4.1.2
class-utils@0.3.6:
dependencies:
arr-union: 3.1.0
@@ -7547,6 +7572,13 @@ snapshots:
graceful-fs: 4.2.11
hexo-util: 3.3.0
hexo-fs@5.0.0:
dependencies:
bluebird: 3.7.2
chokidar: 4.0.3
graceful-fs: 4.2.11
hexo-util: 3.3.0
hexo-generator-index@4.0.0:
dependencies:
hexo-pagination: 3.0.0
@@ -9410,6 +9442,8 @@ snapshots:
dependencies:
picomatch: 2.3.1
readdirp@4.1.2: {}
rechoir@0.8.0:
dependencies:
resolve: 1.22.10
+1 -1
View File
@@ -1,7 +1,7 @@
---
title: Aspect Ratio
date: 2022-09-21 10:28:43
background: bg-emerald-600
background: bg-indigo-600
tags:
- photo
- image
+1 -1
View File
@@ -1,7 +1,7 @@
---
title: Chmod
date: 2021-07-01 10:51:44
background: bg-emerald-600
background: bg-indigo-600
tags:
- permission
categories:
+1 -1
View File
@@ -1,7 +1,7 @@
---
title: FastAPI
date: 2025-06-07 18:40:00
background: bg-[#059669]
background: bg-[#3730a3]
tags:
- web
- python
+1 -1
View File
@@ -1,7 +1,7 @@
---
title: Grep
date: 2020-11-25 18:28:43
background: bg-emerald-400
background: bg-indigo-400
tags:
- egrep
- search
+1 -1
View File
@@ -2,7 +2,7 @@
title: OpenSSL
date: 2020-11-25 18:28:43
icon: icon-style
background: bg-emerald-600
background: bg-indigo-600
tags:
categories:
- Linux Command
+1 -1
View File
@@ -1,7 +1,7 @@
---
title: PhpStorm
date: 2022-11-23 16:23:31.703719
background: bg-gradient-to-r from-[#be4fe9] to-[#715bef] hover:from-emerald-400 hover:to-blue-500
background: bg-gradient-to-r from-[#be4fe9] to-[#715bef] hover:from-indigo-400 hover:to-blue-500
label:
tags:
- jetbrains
+1 -1
View File
@@ -1,7 +1,7 @@
---
title: Screen
date: 2021-01-02 20:03:55
background: bg-emerald-500
background: bg-indigo-500
tags:
- terminal
- session
+1 -1
View File
@@ -1,7 +1,7 @@
---
title: Tmux
date: 2021-02-20 14:31:24
background: bg-emerald-600
background: bg-indigo-600
tags:
- utility
- terminal
+1 -1
View File
@@ -1,7 +1,7 @@
---
title: WebStorm
date: 2020-12-17 21:51:44
background: bg-gradient-to-r from-emerald-300 to-blue-400 hover:from-emerald-400 hover:to-blue-500
background: bg-gradient-to-r from-indigo-300 to-blue-400 hover:from-indigo-400 hover:to-blue-500
tags:
- jetbrains
- web
+3
View File
@@ -0,0 +1,3 @@
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
<path d="M512 714.666667c-8.533333 0-17.066667-2.133333-23.466667-8.533334l-341.333333-341.333333c-12.8-12.8-12.8-32 0-44.8 12.8-12.8 32-12.8 44.8 0l320 317.866667 317.866667-317.866667c12.8-12.8 32-12.8 44.8 0 12.8 12.8 12.8 32 0 44.8l-341.333334 341.333333c-4.266667 6.4-12.8 8.533333-21.333333 8.533334z"/>
</svg>

After

Width:  |  Height:  |  Size: 431 B

+5
View File
@@ -0,0 +1,5 @@
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
<path d="M744 312h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c53 0 96 43 96 96s-43 96-96 96h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c101.8 0 184-82.2 184-184s-82.2-184-184-184z"/>
<path d="M664 128H144c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-24h480v24c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32z"/>
<path d="M144 256h520c17.7 0 32 14.3 32 32v496c0 17.7-14.3 32-32 32H144c-17.7 0-32-14.3-32-32V288c0-17.7 14.3-32 32-32zm464 496V320H176v432h432z"/>
</svg>

After

Width:  |  Height:  |  Size: 615 B

+3
View File
@@ -0,0 +1,3 @@
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
<path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.4c2.4.8 4.9 1.2 7.5 1.2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM672 888H414V746c0-22.1-17.9-40-40-40H232V256h440v632z"/>
</svg>

After

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

+3
View File
@@ -0,0 +1,3 @@
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
<path d="M853.333333 298.666667c0-117.333333-96-213.333333-213.333333-213.333334H298.666667c-23.466667 0-42.666667 19.2-42.666667 42.666667v554.666667c0 23.466667 19.2 42.666667 42.666667 42.666666h85.333333c23.466667 0 42.666667-19.2 42.666667-42.666666V469.333333h213.333333c117.333333 0 213.333333-96 213.333333-213.333333z m-85.333333 0c0 70.4-57.6 128-128 128H426.666667V213.333333h213.333333c70.4 0 128 57.6 128 128z"/>
</svg>

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

+3
View File
@@ -0,0 +1,3 @@
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
<path d="M714.163 519.284L1160.89 0h-105.86L667.137 450.887L357.328 0H0l468.492 681.821L0 1226.37h105.866l409.625-476.152L826.647 1226.37H1183.98L714.137 519.284h.026ZM569.165 687.828l-47.468-67.894L144.011 79.6944h162.604l304.797 435.991 47.468 67.894 396.2 566.721H892.476L569.165 687.854v-.026Z"/>
</svg>

After

Width:  |  Height:  |  Size: 422 B

+1 -1
View File
@@ -5,7 +5,7 @@
"start_url": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#10b981",
"theme_color": "#6366f1",
"orientation": "portrait-primary",
"scope": "/",
"lang": "en",
+56
View File
@@ -0,0 +1,56 @@
---
title: Buy Me a Coffee
description: Support the development of CheatSheets.zip through various donation platforms
permalink: /support/
background: bg-gradient-to-r from-pink-500 to-purple-600
tags:
- support
- donation
categories:
- Other
intro: |
Thank you for considering supporting CheatSheets.zip! Your contributions help us maintain and improve this free resource for developers worldwide.
---
## Buy Me a Coffee
### 💖 Why Support Us?
CheatSheets.zip serves **1M+ developers** monthly with **200+ free cheat sheets**.
We believe great developer resources should be **free forever**. Your support helps us:
- 🚀 Keep servers running smoothly
- ✨ Add new cheat sheets weekly
- 🎯 Improve user experience
- 🔥 Maintain top-quality content
_No ads, no paywalls, just pure developer goodness._
### ☕ Buy Me a Coffee
**Fuel our coding sessions!**
Buy us a coffee and help keep the cheat sheets coming. Perfect for one-time support or when you just want to say thanks.
☕ **What your coffee buys:**
- Server uptime for thousands of developers
- Motivation to create new content
- A smile on our faces
[Buy Me a Coffee](https://buymeacoffee.com/cheatsheets.zip) {.link-arrow}
### 🌟 GitHub Sponsors
**Join our amazing sponsors!**
Support the future of free developer resources. Every contribution, big or small, makes a real difference.
✨ **Sponsor perks:**
- Your name in our README
- Early access to new features
- Good karma for supporting open source
[Sponsor on GitHub](https://github.com/sponsors/Fechin) {.link-arrow}
+3 -3
View File
@@ -174,14 +174,14 @@ function createOfflineResponse(pathname) {
.offline-title {
font-size: 1.5rem;
margin-bottom: 1rem;
color: #10b981;
color: #6366f1;
}
.offline-message {
margin-bottom: 1.5rem;
line-height: 1.6;
}
.retry-button {
background: #10b981;
background: #6366f1;
color: white;
border: none;
padding: 0.75rem 1.5rem;
@@ -190,7 +190,7 @@ function createOfflineResponse(pathname) {
font-size: 1rem;
}
.retry-button:hover {
background: #059669;
background: #3730a3;
}
</style>
</head>
+2 -2
View File
@@ -4,7 +4,7 @@
</div>
<div class="w-1/3 px-2">
<input
class="bg-grey-lighter text-grey-darker border-red block w-full appearance-none rounded border px-3 py-2 focus:border-emerald-500 focus:outline-none dark:bg-slate-800"
class="bg-grey-lighter text-grey-darker border-red block w-full appearance-none rounded border px-3 py-2 focus:border-indigo-500 focus:outline-none dark:bg-slate-800"
id="num"
placeholder="777"
maxlength="3"
@@ -13,7 +13,7 @@
</div>
<div class="w-1/3 px-2">
<input
class="bg-grey-lighter dark-bg-slate-800 text-grey-darker border-grey-lighter block w-full appearance-none rounded border px-3 py-2 focus:border-emerald-500 focus:outline-none"
class="bg-grey-lighter dark-bg-slate-800 text-grey-darker border-grey-lighter block w-full appearance-none rounded border px-3 py-2 focus:border-indigo-500 focus:outline-none"
id="let"
placeholder="rwxrwxrwx"
maxlength="9"
@@ -0,0 +1,78 @@
<%
// Buy Me a Coffee button component
// variant: 'hero' | 'compact' | 'inline'
// showLabel: boolean - whether to show text label
// className: string - additional CSS class names
const variant = locals.variant || 'inline';
const showLabel = locals.showLabel !== false; // show label by default
const className = locals.className || '';
// Set styles based on variant
const buttonBaseClass = {
hero: 'group inline-flex items-center justify-center px-6 py-3 backdrop-blur-sm outline outline-1 rounded-3xl transition-all duration-300 hover:scale-105 hover:shadow-lg',
compact: 'group inline-flex items-center justify-center h-9 px-3 backdrop-blur-sm outline outline-1 rounded-3xl transition-colors duration-200',
inline: 'group inline-flex items-center justify-center h-9 px-4 backdrop-blur-sm outline outline-1 rounded-3xl transition-all duration-200 hover:scale-105'
}[variant];
// Coffee button styles
const coffeeClass = {
hero: 'bg-gradient-to-r from-orange-500/20 to-yellow-500/20 outline-orange-300/30 text-white hover:from-orange-500/30 hover:to-yellow-500/30',
compact: is_home() ? 'bg-white/10 outline-white/20 text-white hover:bg-white/20' : 'bg-gradient-to-r from-orange-500/10 to-yellow-500/10 outline-orange-300/30 text-slate-700 dark:text-slate-300 hover:from-orange-500/20 hover:to-yellow-500/20',
inline: 'bg-gradient-to-r from-orange-500/10 to-yellow-500/10 outline-orange-300/30 text-slate-700 dark:text-slate-300 hover:from-orange-500/20 hover:to-yellow-500/20'
}[variant];
// Icon size and styles
const iconClass = {
hero: 'w-5 h-5 flex-shrink-0 flex items-center justify-center',
compact: 'w-4 h-4 flex-shrink-0 flex items-center justify-center',
inline: 'w-4 h-4 flex-shrink-0 flex items-center justify-center'
}[variant];
// Actual SVG icon size
const svgSize = {
hero: '20', // w-5 h-5 = 20px
compact: '16', // w-4 h-4 = 16px
inline: '16' // w-4 h-4 = 16px
}[variant];
// Text size
const textSize = {
hero: 'font-semibold leading-none',
compact: 'text-sm font-medium leading-none',
inline: 'text-sm font-medium leading-none'
}[variant];
// Spacing
const spacing = {
hero: 'mr-3',
compact: 'mr-2',
inline: 'mr-2'
}[variant];
%>
<a href="/support/"
class="<%= buttonBaseClass %> <%= coffeeClass %> <%= className %>">
<div class="<%= iconClass %> <%= spacing %>">
<svg width="<%= svgSize %>" height="<%= svgSize %>" viewBox="0 0 25 35" fill="currentColor">
<path d="M22.0672 8.1281 22.0437 8.11426 21.9893 8.09766C22.0112 8.11614 22.0386 8.12685 22.0672 8.1281z" fill="currentColor"></path>
<path d="M22.4111 10.5781 22.3848 10.5855 22.4111 10.5781z" fill="currentColor"></path>
<path d="M22.0735 8.11128C22.0708 8.11093 22.0681 8.11029 22.0655 8.10938 22.0654 8.11115 22.0654 8.11293 22.0655 8.1147 22.0685 8.11432 22.0712 8.11313 22.0735 8.11128z" fill="currentColor"></path>
<path d="M22.3877 10.5647 22.4274 10.5421 22.4421 10.5338 22.4555 10.5195C22.4303 10.5304 22.4074 10.5457 22.3877 10.5647z" fill="currentColor"></path>
<path d="M22.1334 8.1762 22.0947 8.1393 22.0684 8.125C22.0825 8.14993 22.1058 8.16832 22.1334 8.1762z" fill="currentColor"></path>
<path d="M12.3836 31.9453C12.3526 31.9587 12.3255 31.9796 12.3047 32.0062L12.3291 31.9905C12.3457 31.9753 12.3693 31.9573 12.3836 31.9453z" fill="currentColor"></path>
<path d="M18.0497 30.8309C18.0497 30.7958 18.0326 30.8023 18.0368 30.9268 18.0368 30.9167 18.0409 30.9065 18.0428 30.8969 18.0451 30.8747 18.0469 30.853 18.0497 30.8309z" fill="currentColor"></path>
<path d="M17.4617 31.9453C17.4307 31.9587 17.4036 31.9796 17.3828 32.0062L17.4073 31.9905C17.4239 31.9753 17.4474 31.9573 17.4617 31.9453z" fill="currentColor"></path>
<path d="M8.39845 32.2145C8.37496 32.1941 8.34619 32.1807 8.31543 32.1758 8.34034 32.1878 8.36524 32.1998 8.38185 32.209L8.39845 32.2145z" fill="currentColor"></path>
<path d="M7.50541 31.3533C7.50173 31.317 7.49058 31.2818 7.47266 31.25 7.48535 31.2831 7.49598 31.317 7.50448 31.3515L7.50541 31.3533z" fill="currentColor"></path>
<path d="M13.5278 15.9814C12.2963 16.5086 10.8987 17.1064 9.08736 17.1064 8.32963 17.1048 7.57558 17.0009 6.8457 16.7973L8.09845 29.6592C8.14279 30.1968 8.38769 30.698 8.78452 31.0634 9.18134 31.4288 9.70106 31.6316 10.2405 31.6315 10.2405 31.6315 12.0167 31.7237 12.6094 31.7237 13.2474 31.7237 15.1601 31.6315 15.1601 31.6315 15.6995 31.6315 16.2191 31.4286 16.6158 31.0633 17.0125 30.6979 17.2574 30.1967 17.3017 29.6592l1.3418-14.2129C18.0439 15.2415 17.4387 15.1055 16.7565 15.1055 15.5767 15.105 14.626 15.5114 13.5278 15.9814z" fill="#FD0"></path>
<path d="M2.96582 10.5039l.02122.0198L3.00088 10.532C2.99022 10.5215 2.97847 10.512 2.96582 10.5039z" fill="currentColor"></path>
<path d="M24.4376 9.31226 24.249 8.36071C24.0797 7.50694 23.6955 6.70022 22.8191 6.39164 22.5382 6.29294 22.2195 6.2505 22.0041 6.04617 21.7887 5.84184 21.725 5.5245 21.6752 5.23023 21.583 4.6901 21.4963 4.14952 21.4017 3.61033 21.3201 3.14677 21.2555 2.62602 21.0428 2.20075 20.7661 1.62973 20.1918 1.29579 19.6208 1.07485 19.3282.965622 19.0296.873222 18.7265.798101 17.2998.421723 15.7999.283349 14.3322.204476c-1.7617-.097207-3.528-.06792-5.28547.087637-1.3081.119001-2.68584.262911-3.9289.715397C4.6635 1.1731 4.19533 1.37189 3.84986 1.7229c-.42389.43127-.56226 1.09823-.25276 1.63604.22001.38192.5927.65175.98799.83025.51488.23 1.0526.40501 1.60422.52213 1.53595.33948 3.12679.47278 4.69599.52951C12.6245 5.31103 14.3665 5.25414 16.0974 5.07063 16.5254 5.02359 16.9527 4.96716 17.3792 4.90136 17.8815 4.82433 18.2039 4.16751 18.0558 3.70995 17.8787 3.16292 17.4027 2.95074 16.8644 3.0333 16.7851 3.04576 16.7062 3.05729 16.6269 3.06882L16.5697 3.07712C16.3873 3.10019 16.205 3.12171 16.0226 3.1417 15.646 3.18229 15.2683 3.2155 14.8898 3.24133 14.042 3.30037 13.192 3.32758 12.3423 3.32896 11.5075 3.32896 10.6722 3.30544 9.83916 3.25055 9.45909 3.22564 9.07994 3.19397 8.70172 3.15553 8.52967 3.13755 8.35809 3.11864 8.18651 3.09742L8.02322 3.07666 7.98771 3.07159 7.81843 3.04714C7.4725 2.99502 7.12656 2.93506 6.78431 2.86264 6.74978 2.85498 6.71889 2.83577 6.69675 2.80818 6.67461 2.78059 6.66254 2.74627 6.66254 2.71089 6.66254 2.67552 6.67461 2.6412 6.69675 2.61361 6.71889 2.58602 6.74978 2.5668 6.78431 2.55914H6.79077C7.08735 2.49595 7.38624 2.44199 7.68605 2.39494 7.78599 2.37926 7.88623 2.36388 7.98679 2.34881H7.98955C8.17728 2.33636 8.36593 2.30269 8.55274 2.28055c1.62526-.16906 3.26026-.22669 4.89336-.17251C14.239 2.13111 15.0314 2.17769 15.8206 2.25795 15.9903 2.27548 16.1592 2.29393 16.328 2.31468 16.3926 2.32252 16.4576 2.33175 16.5226 2.33959l.131.01891C17.0355 2.41539 17.4154 2.48442 17.7934 2.5656 18.3533 2.68737 19.0724 2.72704 19.3215 3.3405 19.4008 3.53514 19.4368 3.75147 19.4806 3.9558L19.5364 4.2164C19.5379 4.22108 19.5389 4.22586 19.5396 4.2307 19.6716 4.8457 19.8036 5.46069 19.9359 6.07569 19.9455 6.12112 19.9458 6.16806 19.9365 6.21359 19.9273 6.25911 19.9087 6.30224 19.8821 6.34028 19.8554 6.37832 19.8212 6.41046 19.7816 6.4347 19.7419 6.45893 19.6977 6.47474 19.6517 6.48113H19.648L19.5673 6.4922 19.4875 6.50281C19.2348 6.53571 18.9817 6.56646 18.7283 6.59506 18.2292 6.65194 17.7294 6.70114 17.2288 6.74265 16.234 6.82537 15.2373 6.87965 14.2385 6.90548 13.7296 6.919 13.2209 6.92531 12.7123 6.92439 10.6878 6.92279 8.66519 6.80513 6.65424 6.57199 6.43653 6.54616 6.21883 6.51849 6.00112 6.49035 6.16993 6.51203 5.87843 6.47375 5.81939 6.46545 5.68101 6.44607 5.54264 6.42593 5.40426 6.40502 4.93979 6.33537 4.47808 6.24958 4.01453 6.1744 3.45411 6.08215 2.91814 6.12827 2.41123 6.40502c-.4161.2277-.75287.57686-.96539 1.00091-.21863.45202-.28367.94417-.38145 1.42987C.966604 9.32149.814392 9.84408.872048 10.3427c.124075 1.0761.876372 1.9506 1.958452 2.1462 1.01798.1845 2.04148.3339 3.06776.4612C9.9297 13.4439 14.0025 13.5029 18.0466 13.1263 18.3759 13.0956 18.7048 13.062 19.0332 13.0258 19.1358 13.0145 19.2396 13.0263 19.337 13.0604 19.4344 13.0944 19.523 13.1498 19.5962 13.2225S19.7255 13.3834 19.7602 13.4805C19.795 13.5777 19.8075 13.6814 19.797 13.7841L19.6946 14.7794C19.4883 16.7908 19.282 18.802 19.0756 20.813 18.8604 22.9249 18.6437 25.0366 18.4257 27.1482 18.3642 27.7429 18.3027 28.3375 18.2412 28.9319 18.1822 29.5172 18.1739 30.121 18.0627 30.6994 17.8875 31.609 17.2717 32.1675 16.3732 32.3719 15.55 32.5592 14.7091 32.6575 13.8649 32.6652 12.929 32.6703 11.9936 32.6288 11.0578 32.6338 10.0587 32.6394 8.83502 32.5471 8.06381 31.8036 7.38624 31.1505 7.29261 30.1279 7.20036 29.2437c-.123-1.1707-.24492-2.3412-.36577-3.5115l-.67803-6.5077-.43865-4.2108C5.71053 14.9441 5.70315 14.8754 5.69623 14.8053 5.64365 14.303 5.28803 13.8113 4.72761 13.8366 4.24792 13.8579 3.70272 14.2656 3.759 14.8053l.32517 3.1217L4.75667 24.3844C4.94824 26.2187 5.13935 28.0532 5.33 29.888 5.3669 30.2395 5.40149 30.5919 5.44024 30.9434c.21079 1.9206 1.67755 2.9556 3.49395 3.2472C9.99506 34.3612 11.0818 34.3963 12.1583 34.4138 13.5384 34.4359 14.9322 34.489 16.2897 34.239c2.0115-.369 3.5207-1.7122 3.7361-3.7956C20.0873 29.8419 20.1488 29.2403 20.2103 28.6385 20.4148 26.6484 20.619 24.6581 20.8228 22.6677L21.4898 16.1641 21.7956 13.1835C21.8108 13.0357 21.8733 12.8968 21.9736 12.7872 22.0739 12.6776 22.2069 12.6033 22.3528 12.5751 22.928 12.463 23.4778 12.2716 23.8869 11.8339 24.5382 11.137 24.6678 10.2283 24.4376 9.31226zM2.80098 9.95524C2.80975 9.95109 2.7936 10.0263 2.78669 10.0613 2.7853 10.0083 2.78807 9.96124 2.80098 9.95524zM2.8568 10.387C2.86141 10.3837 2.87524 10.4022 2.88954 10.4243 2.86786 10.404 2.85403 10.3888 2.85633 10.387H2.8568zM2.91168 10.4594C2.93152 10.4931 2.94213 10.5143 2.91168 10.4594v0zM3.02192 10.5489H3.02469C3.02469 10.5521 3.02976 10.5553 3.03161 10.5586 3.02855 10.555 3.02515 10.5518 3.02146 Line truncated
</svg>
</div>
<% if (showLabel) { %>
<span class="<%= textSize %>">
<% if (variant === 'compact') { %>Coffee<% } else { %>Buy Me a Coffee<% } %>
</span>
<% } %>
</a>
@@ -0,0 +1,84 @@
<%
// Follow on X button component
// variant: 'hero' | 'compact' | 'inline'
// showLabel: boolean - whether to show text label
// className: string - additional CSS class names
const variant = locals.variant || 'inline';
const showLabel = locals.showLabel !== false; // show label by default
const className = locals.className || '';
// Set styles based on variant
const buttonBaseClass = {
hero: 'group inline-flex items-center justify-center px-6 py-3 backdrop-blur-sm outline outline-1 rounded-3xl transition-all duration-300 hover:scale-105 hover:shadow-lg',
compact: 'group inline-flex items-center justify-center h-9 px-3 backdrop-blur-sm outline outline-1 rounded-3xl transition-colors duration-200',
inline: 'group inline-flex items-center justify-center h-9 px-4 backdrop-blur-sm outline outline-1 rounded-3xl transition-all duration-200 hover:scale-105',
request: 'group inline-flex items-center justify-center px-6 py-3 backdrop-blur-sm outline outline-1 rounded-3xl transition-all duration-300 hover:scale-105 hover:shadow-lg'
}[variant];
// X button styles - consistent background colors with GitHub button
const xClass = {
hero: 'bg-white/10 outline-white/20 text-white hover:bg-white/20',
compact: is_home() ? 'bg-white/10 outline-white/20 text-white hover:bg-white/20' : 'bg-white outline-slate-200 dark:bg-slate-800 dark:outline-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-700',
inline: 'bg-white outline-slate-200 dark:bg-slate-800 dark:outline-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-700',
request: 'bg-blue-600/80 outline-blue-500/50 text-white hover:bg-blue-500/90 dark:bg-blue-500/20 dark:outline-blue-400/30 dark:text-white dark:hover:bg-blue-500/30'
}[variant];
// Icon size and styles
const iconClass = {
hero: 'w-5 h-5 flex-shrink-0 flex items-center justify-center',
compact: 'w-4 h-4 flex-shrink-0 flex items-center justify-center',
inline: 'w-4 h-4 flex-shrink-0 flex items-center justify-center',
request: 'w-5 h-5 flex-shrink-0 flex items-center justify-center'
}[variant];
// Text size
const textSize = {
hero: 'font-semibold leading-none',
compact: 'text-sm font-medium leading-none',
inline: 'text-sm font-medium leading-none',
request: 'font-semibold leading-none'
}[variant];
// Spacing
const spacing = {
hero: 'mr-3',
compact: 'mr-2',
inline: 'mr-2',
request: 'mr-3'
}[variant];
%>
<% if (variant === 'request') { %>
<a href="https://x.com/FechinLi" target="_blank"
class="<%= buttonBaseClass %> <%= xClass %> <%= className %>">
<div class="<%= iconClass %> <%= spacing %> group-hover:scale-110 transition-transform">
<%- icon("x") %>
</div>
<% if (showLabel) { %>
<span class="<%= textSize %>">
Follow us on X
</span>
<div class="ml-2 group-hover:translate-x-1 transition-transform leading-none">
→
</div>
<% } %>
</a>
<% } else { %>
<a href="https://x.com/FechinLi" target="_blank"
class="<%= buttonBaseClass %> <%= xClass %> <%= className %>">
<div class="<%= iconClass %> <%= spacing %> <% if (variant === 'hero') { %>group-hover:scale-110 transition-transform<% } %>">
<%- icon("x") %>
</div>
<% if (showLabel) { %>
<span class="<%= textSize %>">
<% if (variant === 'compact') { %>Follow<% } else { %>Follow us on X<% } %>
</span>
<% if (variant === 'hero') { %>
<div class="ml-2 group-hover:translate-x-1 transition-transform leading-none">
→
</div>
<% } %>
<% } %>
</a>
<% } %>
@@ -0,0 +1,64 @@
<%
// GitHub Contribute button component
// variant: 'hero' | 'compact' | 'inline' | 'request'
// showLabel: boolean - whether to show text label
// className: string - additional CSS class names
const variant = locals.variant || 'request';
const showLabel = locals.showLabel !== false; // show label by default
const className = locals.className || '';
// Set styles based on variant
const buttonBaseClass = {
hero: 'group inline-flex items-center justify-center px-6 py-3 backdrop-blur-sm outline outline-1 rounded-3xl transition-all duration-300 hover:scale-105 hover:shadow-lg',
compact: 'group inline-flex items-center justify-center h-9 px-3 backdrop-blur-sm outline outline-1 rounded-3xl transition-colors duration-200',
inline: 'group inline-flex items-center justify-center h-9 px-4 backdrop-blur-sm outline outline-1 rounded-3xl transition-all duration-200 hover:scale-105',
request: 'group inline-flex items-center justify-center px-6 py-3 backdrop-blur-sm outline outline-1 rounded-3xl transition-all duration-300 hover:scale-105 hover:shadow-lg'
}[variant];
// GitHub button styles
const githubClass = {
hero: 'bg-white/10 outline-white/20 text-white hover:bg-white/20',
compact: is_home() ? 'bg-white/10 outline-white/20 text-white hover:bg-white/20' : 'bg-white outline-slate-200 dark:bg-slate-800 dark:outline-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-700',
inline: 'bg-white outline-slate-200 dark:bg-slate-800 dark:outline-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-700',
request: 'bg-slate-800/80 outline-slate-700/50 text-white hover:bg-slate-700/90 dark:bg-white/10 dark:outline-white/20 dark:text-white dark:hover:bg-white/20'
}[variant];
// Icon size and styles
const iconClass = {
hero: 'w-5 h-5 flex-shrink-0 flex items-center justify-center',
compact: 'w-4 h-4 flex-shrink-0 flex items-center justify-center',
inline: 'w-4 h-4 flex-shrink-0 flex items-center justify-center',
request: 'w-5 h-5 flex-shrink-0 flex items-center justify-center'
}[variant];
// Text size
const textSize = {
hero: 'font-semibold leading-none',
compact: 'text-sm font-medium leading-none',
inline: 'text-sm font-medium leading-none',
request: 'font-semibold leading-none'
}[variant];
// Spacing
const spacing = {
hero: 'mr-3',
compact: 'mr-2',
inline: 'mr-2',
request: 'mr-3'
}[variant];
%>
<a href="<%- contributing() %>" target="_blank"
class="<%= className %>">
<button type="button" class="<%= buttonBaseClass %> <%= githubClass %>">
<div class="<%= iconClass %> <%= spacing %>">
<%- icon("github") %>
</div>
<% if (showLabel) { %>
<span class="<%= textSize %>">
<% if (variant === 'compact') { %>Contribute<% } else { %>Contribute on GitHub<% } %>
</span>
<% } %>
</button>
</a>
@@ -0,0 +1,73 @@
<%
// GitHub Star button component
// variant: 'hero' | 'compact' | 'inline'
// showLabel: boolean - whether to show text label
// className: string - additional CSS class names
const variant = locals.variant || 'inline';
const showLabel = locals.showLabel !== false; // show label by default
const className = locals.className || '';
// Set styles based on variant
const buttonBaseClass = {
hero: 'group inline-flex items-center justify-center px-6 py-3 backdrop-blur-sm outline outline-1 rounded-3xl transition-all duration-300 hover:scale-105 hover:shadow-lg',
compact: 'group inline-flex items-center justify-center h-9 px-3 backdrop-blur-sm outline outline-1 rounded-3xl transition-colors duration-200',
inline: 'group inline-flex items-center justify-center h-9 px-4 backdrop-blur-sm outline outline-1 rounded-3xl transition-all duration-200 hover:scale-105'
}[variant];
// GitHub button styles
const githubClass = {
hero: 'bg-white/10 outline-white/20 text-white hover:bg-white/20',
compact: is_home() ? 'bg-white/10 outline-white/20 text-white hover:bg-white/20' : 'bg-white outline-slate-200 dark:bg-slate-800 dark:outline-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-700',
inline: 'bg-white outline-slate-200 dark:bg-slate-800 dark:outline-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-700'
}[variant];
// Icon size and styles
const iconClass = {
hero: 'w-5 h-5 flex-shrink-0 flex items-center justify-center',
compact: 'w-4 h-4 flex-shrink-0 flex items-center justify-center',
inline: 'w-4 h-4 flex-shrink-0 flex items-center justify-center'
}[variant];
// Text size
const textSize = {
hero: 'font-semibold leading-none',
compact: 'text-sm font-medium leading-none',
inline: 'text-sm font-medium leading-none'
}[variant];
// Spacing
const spacing = {
hero: 'mr-3',
compact: 'mr-2',
inline: 'mr-2'
}[variant];
%>
<a href="<%- edit_page() %>" target="_blank"
class="<%= buttonBaseClass %> <%= githubClass %> <%= className %>">
<div class="<%= iconClass %> <%= spacing %>">
<%- icon("github") %>
</div>
<% if (showLabel) { %>
<span class="<%= textSize %>">
<% if (variant === 'compact') { %>Star<% } else { %>Star on GitHub<% } %>
</span>
<% } %>
<!-- GitHub Stars Counter -->
<% if (variant === 'compact') { %>
<% if (is_home()) { %>
<div id="github-stars-<%= variant %>" class="ml-2 px-2 py-1 bg-white/10 outline outline-1 outline-white/20 rounded-3xl text-xs font-mono leading-none">
<span class="loading-dots">...</span>
</div>
<% } else { %>
<div id="github-stars-<%= variant %>" class="ml-2 px-2 py-1 bg-slate-100 dark:bg-slate-700 outline outline-1 outline-slate-200 dark:outline-slate-600 rounded-3xl text-xs font-mono leading-none">
<span class="loading-dots">...</span>
</div>
<% } %>
<% } else { %>
<div id="github-stars-<%= variant %>" class="ml-3 px-2 py-1 bg-white/20 rounded-3xl text-xs font-mono leading-none">
<span class="loading-dots">...</span>
</div>
<% } %>
</a>
+103 -18
View File
@@ -1,29 +1,114 @@
<footer class="text-slate-700 dark:text-slate-300 bg-slate-200 dark:bg-slate-800 md:mt-14">
<% if (page.layout !== "note" && !page._isNotePagination) { %>
<div class="max-container mb-8 md:py-10 mx-auto flex md:items-center lg:items-start md:flex-row flex-col">
<div class="grid grid-cols-1 md:grid-cols-2 md:flex-grow md:flex -mb-10 md:mt-0 mt-10">
<div class="md:w-1/2 md:pr-4">
<%- partial('_partial/post/popular', {post: page || post}) %>
<div class="max-container mb-8 md:py-10 mx-auto">
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-6 xl:gap-8">
<!-- Top Cheatsheet -->
<div>
<h3 class="text-lg font-semibold text-slate-900 dark:text-slate-100 mb-4 flex items-center">
Top <span class="text-slate-500">&nbsp;Cheatsheet</span>
</h3>
<div class="space-y-3">
<%
const topPostsData = topPosts(3);
topPostsData.forEach(function(post, index) {
%>
<a href="<%- url_for(post.path) %>" class="group flex items-center p-3 bg-white dark:bg-slate-700 rounded-lg border border-slate-200 dark:border-slate-600 hover:border-indigo-300 dark:hover:border-indigo-500 transition-all duration-200 hover:shadow-md">
<div class="w-8 h-8 flex items-center justify-center flex-shrink-0 mr-3 text-indigo-600">
<%- icon(post.slug) %>
</div>
<div class="min-w-0 flex-1">
<h4 class="font-medium text-sm text-slate-900 dark:text-slate-100 group-hover:text-indigo-600 dark:group-hover:text-indigo-400 truncate">
<%= post.title %> <span class="text-slate-400">Cheatsheet</span>
</h4>
<p class="text-xs text-slate-500 dark:text-slate-400">Popular Quick Reference</p>
</div>
</a>
<% }); %>
</div>
</div>
<div class="md:w-1/2 md:pl-4">
<%- partial('_partial/post/recent') %>
<!-- Recent Cheatsheet -->
<div>
<h3 class="text-lg font-semibold text-slate-900 dark:text-slate-100 mb-4 flex items-center">
Recent <span class="text-slate-500">&nbsp;Cheatsheet</span>
</h3>
<div class="space-y-3">
<%
const recentPosts = site.posts.sort('date', -1).filter(post => post.layout !== "note").data.slice(0, 3);
recentPosts.forEach(function(post, index) {
%>
<a href="<%- url_for(post.path) %>" class="group flex items-center p-3 bg-white dark:bg-slate-700 rounded-lg border border-slate-200 dark:border-slate-600 hover:border-blue-300 dark:hover:border-blue-500 transition-all duration-200 hover:shadow-md">
<div class="w-8 h-8 flex items-center justify-center flex-shrink-0 mr-3 text-blue-600">
<%- icon(post.slug) %>
</div>
<div class="min-w-0 flex-1">
<h4 class="font-medium text-sm text-slate-900 dark:text-slate-100 group-hover:text-blue-600 dark:group-hover:text-blue-400 truncate">
<%= post.title %> <span class="text-slate-400">Cheatsheet</span>
</h4>
<p class="text-xs text-slate-500 dark:text-slate-400">Latest Quick Reference</p>
</div>
</a>
<% }); %>
</div>
</div>
</div>
<div class="hidden md:block flex-shrink-0 mx-auto block mt-8 md:mx-8 max-w-xs">
<%- partial('index/logo', {icon: false}) %>
<h4 class="mt-5 text-sm text-slate-500"><%- config.description %>.</h4>
<div class="share mt-4">
<a href="/zh-CN/">中文版</a>
<% if (site.posts.filter(post => post.layout === "note").length > 0) { %>
<a href="/notes/">#Notes</a>
<% } %>
<!-- Our Products -->
<div>
<h3 class="text-lg font-semibold text-slate-900 dark:text-slate-100 mb-4 flex items-center">
Our <span class="text-slate-500">&nbsp;Products</span>
</h3>
<div class="space-y-3">
<a href="https://tableconvert.com" target="_blank" class="group flex items-center p-3 bg-white dark:bg-slate-700 rounded-lg border border-slate-200 dark:border-slate-600 hover:border-purple-300 dark:hover:border-purple-500 transition-all duration-200 hover:shadow-md">
<div class="w-8 h-8 flex items-center justify-center flex-shrink-0 mr-3">
<img src="/assets/icon/tableconvert.png" alt="TableConvert" class="w-6 h-6 rounded">
</div>
<div class="min-w-0 flex-1">
<h4 class="font-medium text-sm text-slate-900 dark:text-slate-100 group-hover:text-purple-600 dark:group-hover:text-purple-400">TableConvert</h4>
<p class="text-xs text-slate-500 dark:text-slate-400 truncate">Convert tables between formats instantly</p>
</div>
</a>
<a href="https://dorefer.com" target="_blank" class="group flex items-center p-3 bg-white dark:bg-slate-700 rounded-lg border border-slate-200 dark:border-slate-600 hover:border-purple-300 dark:hover:border-purple-500 transition-all duration-200 hover:shadow-md">
<div class="w-8 h-8 flex items-center justify-center flex-shrink-0 mr-3">
<img src="/assets/icon/dorefer.png" alt="doRefer" class="w-6 h-6 rounded">
</div>
<div class="min-w-0 flex-1">
<h4 class="font-medium text-sm text-slate-900 dark:text-slate-100 group-hover:text-purple-600 dark:group-hover:text-purple-400">doRefer</h4>
<p class="text-xs text-slate-500 dark:text-slate-400 truncate">Find Best Referral Code, Link & Signup Bonus</p>
</div>
</a>
<a href="https://fionaai.com" target="_blank" class="group flex items-center p-3 bg-white dark:bg-slate-700 rounded-lg border border-slate-200 dark:border-slate-600 hover:border-purple-300 dark:hover:border-purple-500 transition-all duration-200 hover:shadow-md">
<div class="w-8 h-8 flex items-center justify-center flex-shrink-0 mr-3">
<img src="/assets/icon/fionaai.png" alt="Fiona AI" class="w-6 h-6 rounded">
</div>
<div class="min-w-0 flex-1">
<h4 class="font-medium text-sm text-slate-900 dark:text-slate-100 group-hover:text-purple-600 dark:group-hover:text-purple-400">Fiona AI</h4>
<p class="text-xs text-slate-500 dark:text-slate-400 truncate">Your AI assistant in chrome</p>
</div>
</a>
</div>
</div>
<div class="share mt-8">
<%- partial('_partial/share', {extra: ""}) %>
<!-- Logo Area -->
<div class="text-left">
<div class="mb-4">
<%- partial('_partial/index/logo', { icon: true, theme: 'light' }) %>
</div>
<p class="text-sm text-slate-600 dark:text-slate-400 mb-4">
Share quick reference and cheat sheet for developers.
</p>
<div class="space-y-2 text-sm">
<div><a href="/about/" class="text-slate-600 dark:text-slate-400 hover:text-indigo-600 dark:hover:text-indigo-400">About</a></div>
<div><a href="/notes/" class="text-slate-600 dark:text-slate-400 hover:text-indigo-600 dark:hover:text-indigo-400">Notes</a></div>
<div><a href="/support/" class="text-slate-600 dark:text-slate-400 hover:text-indigo-600 dark:hover:text-indigo-400">Support</a></div>
</div>
<div class="mt-4">
<%- partial('share', { extra: 'justify-start' }) %>
</div>
</div>
</div>
</div>
<div class="max-container border-b border-slate-300 dark:border-slate-700"></div>
<% } %>
<div class="max-container flex flex-col sm:flex-row items-center ">
<p class="py-2 md:py-3 text-slate-500 text-sm text-center w-full">
+2 -2
View File
@@ -37,7 +37,7 @@
<!-- PWA -->
<link rel="manifest" href="/manifest.json"/>
<meta name="theme-color" content="#10b981"/>
<meta name="theme-color" content="#6366f1"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="default"/>
<meta name="apple-mobile-web-app-title" content="CheatSheets"/>
@@ -45,7 +45,7 @@
<link rel="apple-touch-icon" sizes="152x152" href="/assets/logo/icon-152x152.png"/>
<link rel="apple-touch-icon" sizes="180x180" href="/assets/logo/icon-192x192.png"/>
<meta name="msapplication-TileImage" content="/assets/logo/icon-144x144.png"/>
<meta name="msapplication-TileColor" content="#10b981"/>
<meta name="msapplication-TileColor" content="#6366f1"/>
<!-- misc -->
<link rel="canonical" href="<%- url_for(url) %>"/>
+122 -43
View File
@@ -1,56 +1,135 @@
<% let postPage = (page['layout'] === 'post' || page._isNotePagination || page['layout'] === 'note') ? true : false; %>
<header class="<% if (is_home()){ %>home bg-blue-500 dark:bg-slate-800<% } %>">
<div class="max-container z-10">
<div class="flex flex-row justify-between md:justify-start items-center py-3">
<%- partial('index/logo', {icon: true}) %>
<header class="<% if (is_home()){ %>home<% } %> relative z-10 <% if (is_home()){ %>w-full overflow-visible<% } %>">
<% if (is_home()){ %>
<!-- Modern Hero Background with Clean Gradient Design -->
<!-- Main Background Gradient Layer -->
<div class="absolute inset-0 bg-gradient-to-br from-indigo-500 via-purple-600 to-indigo-800 pointer-events-none"></div>
<!-- Subtle Geometric Pattern Overlay -->
<div class="absolute inset-0 opacity-10 pointer-events-none"
style="background-image: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.2) 1px, transparent 1px),
radial-gradient(circle at 80% 50%, rgba(255,255,255,0.2) 1px, transparent 1px);
background-size: 60px 60px, 90px 90px;
background-position: 0 0, 30px 45px;"></div>
<!-- Floating Orbs for Visual Interest -->
<div class="absolute top-20 left-1/4 w-32 h-32 bg-gradient-to-r from-pink-400/20 to-purple-400/20 rounded-full blur-xl animate-pulse"></div>
<div class="absolute bottom-20 right-1/4 w-40 h-40 bg-gradient-to-r from-blue-400/20 to-cyan-400/20 rounded-full blur-xl animate-pulse" style="animation-delay: 2s;"></div>
<!-- Code Elements (Simplified) -->
<div class="absolute top-24 right-12 opacity-20 font-mono text-white/60 text-sm animate-bounce" style="animation-delay: 1s; animation-duration: 3s;">
&lt;/&gt;
</div>
<div class="absolute bottom-32 left-16 opacity-20 font-mono text-white/60 text-lg animate-bounce" style="animation-delay: 2s; animation-duration: 3s;">
{ }
</div>
<!-- Gradient Overlay for Better Text Readability -->
<div class="absolute inset-0 bg-gradient-to-t from-black/20 via-transparent to-black/10 pointer-events-none"></div>
<% } %>
<!-- Navbar Section -->
<div class="max-container z-20 relative">
<div class="flex flex-row justify-between md:justify-start items-center py-4">
<%- partial('index/logo', {icon: true, theme: is_home() ? 'dark' : 'light'}) %>
<div class="md:ml-auto flex flex-wrap items-center text-base justify-center">
<!-- Search Button -->
<button id="mysearch-trigger" type="button"
class="fadeIn inline-flex h-8 items-center bg-slate-200 dark:bg-gray-900 md:dark:bg-transparent md:bg-transparent rounded-full px-2 md:px-3 lg:px-6 py-2 <%- is_home() ? "text-white" : "text-slate-700" %> md:hover:opacity-80">
<div class="md:text-xl text-slate-700 dark:text-slate-300 <%- is_home() ? "md:text-white" : "" %> md:mr-2">
class="inline-flex h-9 items-center backdrop-blur-sm rounded-3xl px-3 md:px-4 lg:px-6 py-2 transition-colors duration-200 group <%- is_home() ? "bg-white/10 outline outline-1 outline-white/20 text-white hover:bg-white/20 hover:outline-white/30" : "bg-white outline outline-1 outline-slate-200 dark:bg-slate-800 dark:outline-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-700" %>">
<div class="md:text-xl md:mr-2 <%- is_home() ? "text-white" : "text-slate-700 dark:text-slate-300" %>">
<%- icon("search") %>
</div>
<span class="hidden md:inline dark:text-slate-300">Search for cheatsheet</span>
<span class="hidden md:inline dark:text-slate-300 md:ml-2 text-sm leading-5 py-0.5 px-1.5 border <%- postPage ? "border-slate-400" : "border-slate-300" %> rounded-md">
<span class="font-sans">⌘</span>
<span class="font-sans">K</span>
</span>
<span class="hidden md:inline font-medium <%- is_home() ? "text-white" : "text-slate-700 dark:text-slate-300" %>">Search for cheatsheet</span>
<span class="hidden md:inline dark:text-slate-300 md:ml-2 text-sm leading-5 py-0.5 px-1.5 border border-slate-300 rounded-md"><span class="font-sans">⌘</span> <span class="font-sans">K</span></span>
</button>
<a href="<%- edit_page() %>" target="_blank">
<img alt="GitHub Repo stars" style="height: 26px; opacity: 0.8;" src="https://img.shields.io/github/stars/Fechin/reference?style=social">
</a>
<a href="https://twitter.com/FechinLi" target="_blank">
<button type="button"
class="fadeIn inline-flex h-8 items-center rounded-full bg-[#4d9feb] text-slate-100 ml-1 lg:ml-4 px-2 md:px-3 py-2 md:hover:opacity-80">
<div class="md:mr-2">
<%- icon("twitter") %>
</div>
<span class="hidden md:inline text-sm">Follow Me</span>
</button>
</a>
<button id="darkMode" class="fadeIn inline-flex items-center justify-center flex-shrink-0 h-8 w-8 rounded-full text-gray-900 ml-1 lg:ml-4 dark:text-gray-300 bg-gray-200 dark:bg-gray-900">
<i class="icon-light text-gray-600 dark:text-gray-300 dark:hover:text-white">
<!-- Dark Mode Toggle -->
<button id="darkMode" class="inline-flex items-center justify-center flex-shrink-0 h-9 w-9 rounded-3xl ml-2 lg:ml-3 backdrop-blur-sm transition-colors duration-200 group <%- is_home() ? "bg-white/10 outline outline-1 outline-white/20 text-white hover:bg-white/20 hover:outline-white/30" : "bg-white outline outline-1 outline-slate-200 dark:bg-slate-800 dark:outline-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-700" %>">
<i class="icon-light <%- is_home() ? "text-white" : "text-slate-600 dark:text-slate-300" %>">
<%- icon("light") %>
</i>
</button>
<a href="<%- share_link("facebook") %>" target="_blank">
<button type="button"
class="fadeIn inline-flex h-8 w-8 justify-center items-center rounded-full bg-[#4a66ad] text-slate-100 ml-1 lg:ml-4 px-2 md:px-3 py-2 md:hover:opacity-80">
<span class="text-md">
<%- icon("facebook") %>
</span>
<span class="hidden">Facebook</span>
<!-- Share Dropdown -->
<div class="relative ml-2 lg:ml-3" id="share-dropdown">
<button type="button" id="share-trigger"
class="inline-flex h-9 items-center rounded-3xl backdrop-blur-sm ml-0 px-3 py-2 transition-colors duration-200 group <%- is_home() ? "bg-white/10 outline outline-1 outline-white/20 text-white hover:bg-white/20 hover:outline-white/30" : "bg-white outline outline-1 outline-slate-200 dark:bg-slate-800 dark:outline-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-700" %>"
aria-expanded="false" aria-haspopup="true">
<div class="mr-2 <%- is_home() ? "text-white" : "text-slate-700 dark:text-slate-300" %>">
<%- icon("share") %>
</div>
<span class="hidden md:inline text-sm font-medium <%- is_home() ? "text-white" : "text-slate-700 dark:text-slate-300" %>">Share</span>
<div class="hidden md:inline ml-2 <%- is_home() ? "text-white" : "text-slate-700 dark:text-slate-300" %>">
<%- icon("chevron-down") %>
</div>
</button>
</a>
<a href="<%- share_link("twitter") %>" target="_blank">
<button type="button"
class="fadeIn inline-flex h-8 w-8 justify-center items-center rounded-full bg-[#4d9feb] text-slate-100 ml-1 lg:ml-4 px-2 md:px-3 py-2 md:hover:opacity-80">
<span class="text-md">
<%- icon("twitter") %>
</span>
<span class="hidden">Twitter</span>
</button>
</a>
<!-- Dropdown Menu Portal Target -->
<div id="share-menu-portal"></div>
</div>
</div>
</div>
</div>
</header>
<!-- Hero Section (only on home page) -->
<% if (is_home()){ %>
<%- partial('index/hero-content') %>
<% } %>
</header>
<!-- Share Dropdown Menu (Portal) - Outside header to avoid overflow issues -->
<div id="share-menu" class="fixed z-[9999] w-56 rounded-3xl bg-white dark:bg-slate-800 shadow-xl outline outline-1 outline-slate-200 dark:outline-slate-700 opacity-0 invisible transform scale-95 transition-all duration-200 pointer-events-none">
<div class="py-2">
<a href="#" onclick="shareOnX()" class="share-item flex items-center px-4 py-3 text-sm text-slate-700 dark:text-slate-300 hover:bg-slate-100/50 dark:hover:bg-slate-700/50 transition-colors rounded-xl mx-2 my-1">
<div class="flex-shrink-0 w-5 h-5 mr-3 text-[#000000]">
<%- icon("x") %>
</div>
<span class="font-medium">Share on X</span>
</a>
<a href="#" onclick="shareOnFacebook()" class="share-item flex items-center px-4 py-3 text-sm text-slate-700 dark:text-slate-300 hover:bg-slate-100/50 dark:hover:bg-slate-700/50 transition-colors rounded-xl mx-2 my-1">
<div class="flex-shrink-0 w-5 h-5 mr-3 text-[#1877f2]">
<%- icon("facebook") %>
</div>
<span class="font-medium">Share on Facebook</span>
</a>
<a href="#" onclick="shareOnReddit()" class="share-item flex items-center px-4 py-3 text-sm text-slate-700 dark:text-slate-300 hover:bg-slate-100/50 dark:hover:bg-slate-700/50 transition-colors rounded-xl mx-2 my-1">
<div class="flex-shrink-0 w-5 h-5 mr-3 text-[#ff4500]">
<%- icon("reddit") %>
</div>
<span class="font-medium">Share on Reddit</span>
</a>
<a href="#" onclick="shareOnPinterest()" class="share-item flex items-center px-4 py-3 text-sm text-slate-700 dark:text-slate-300 hover:bg-slate-100/50 dark:hover:bg-slate-700/50 transition-colors rounded-xl mx-2 my-1">
<div class="flex-shrink-0 w-5 h-5 mr-3 text-[#bd081c]">
<%- icon("pinterest") %>
</div>
<span class="font-medium">Share on Pinterest</span>
</a>
<a href="#" onclick="shareOnLinkedIn()" class="share-item flex items-center px-4 py-3 text-sm text-slate-700 dark:text-slate-300 hover:bg-slate-100/50 dark:hover:bg-slate-700/50 transition-colors rounded-xl mx-2 my-1">
<div class="flex-shrink-0 w-5 h-5 mr-3 text-[#0a66c2]">
<%- icon("linkedin") %>
</div>
<span class="font-medium">Share on LinkedIn</span>
</a>
<a href="#" onclick="shareOnLine()" class="share-item flex items-center px-4 py-3 text-sm text-slate-700 dark:text-slate-300 hover:bg-slate-100/50 dark:hover:bg-slate-700/50 transition-colors rounded-xl mx-2 my-1">
<div class="flex-shrink-0 w-5 h-5 mr-3 text-[#00c300]">
<%- icon("line") %>
</div>
<span class="font-medium">Share on Line</span>
</a>
<div class="border-t border-slate-200 dark:border-slate-600 my-2 mx-2"></div>
<a href="#" onclick="shareViaEmail()" class="share-item flex items-center px-4 py-3 text-sm text-slate-700 dark:text-slate-300 hover:bg-slate-100/50 dark:hover:bg-slate-700/50 transition-colors rounded-xl mx-2 my-1">
<div class="flex-shrink-0 w-5 h-5 mr-3 text-slate-500">
<%- icon("mail") %>
</div>
<span class="font-medium">Share via Email</span>
</a>
<a href="#" onclick="copyToClipboard(); return false;" class="share-item flex items-center px-4 py-3 text-sm text-slate-700 dark:text-slate-300 hover:bg-slate-100/50 dark:hover:bg-slate-700/50 transition-colors rounded-xl mx-2 my-1">
<div class="flex-shrink-0 w-5 h-5 mr-3 text-slate-500">
<%- icon("copy") %>
</div>
<span class="font-medium">Copy Link</span>
</a>
</div>
</div>
@@ -0,0 +1,32 @@
<!-- Hero Content Section (no background, used within header) -->
<div class="w-full flex flex-col text-center pt-8 pb-10 relative z-30">
<div class="max-container lg:w-4/5 xl:w-3/4 relative z-30">
<!-- Main Heading -->
<h1 class="text-4xl md:text-5xl lg:text-6xl text-white leading-tight font-bold tracking-tight">
<span class="relative whitespace-nowrap">
<svg aria-hidden="true" viewBox="0 0 418 42"
class="absolute top-2/3 left-0 h-[0.58em] w-full fill-pink-300/60"
preserveAspectRatio="none">
<path d="M203.371.916c-26.013-2.078-76.686 1.963-124.73 9.946L67.3 12.749C35.421 18.062 18.2 21.766 6.004 25.934 1.244 27.561.828 27.778.874 28.61c.07 1.214.828 1.121 9.595-1.176 9.072-2.377 17.15-3.92 39.246-7.496C123.565 7.986 157.869 4.492 195.942 5.046c7.461.108 19.25 1.696 19.17 2.582-.107 1.183-7.874 4.31-25.75 10.366-21.992 7.45-35.43 12.534-36.701 13.884-2.173 2.308-.202 4.407 4.442 4.734 2.654.187 3.263.157 15.593-.78 35.401-2.686 57.944-3.488 88.365-3.143 46.327.526 75.721 2.23 130.788 7.584 19.787 1.924 20.814 1.98 24.557 1.332l.066-.011c1.201-.203 1.53-1.825.399-2.335-2.911-1.31-4.893-1.604-22.048-3.261-57.509-5.556-87.871-7.36-132.059-7.842-23.239-.254-33.617-.116-50.627.674-11.629.54-42.371 2.494-46.696 2.967-2.359.259 8.133-3.625 26.504-9.81 23.239-7.825 27.934-10.149 28.304-14.005.417-4.348-3.529-6-16.878-7.066Z"/>
</svg>
<span class="relative bg-gradient-to-r from-white via-pink-100 to-purple-100 bg-clip-text text-transparent"> Cheat Sheets </span>
</span>
<span class="block mt-2">for Developers</span>
</h1>
<!-- Subtitle -->
<h2 class="lg:w-3/4 xl:w-2/3 text-center mx-auto text-lg md:text-xl lg:text-2xl text-slate-300 leading-relaxed font-light tracking-wide mt-8 mb-12">
Welcome to the ultimate repository of sheets and quick references meticulously crafted by the open community to
<span class="font-semibold text-pink-300">boost your productivity</span>.
</h2>
<!-- CTA Buttons -->
<div class="flex flex-col lg:flex-row items-center justify-center gap-4 mb-16 max-w-4xl mx-auto">
<%- partial('_partial/buttons/github-star', {variant: 'hero', showLabel: true}) %>
<%- partial('_partial/buttons/follow-x', {variant: 'hero', showLabel: true}) %>
<%- partial('_partial/buttons/buy-coffee', {variant: 'hero', showLabel: true}) %>
</div>
<div id="carbon_container"></div>
</div>
</div>
+69 -11
View File
@@ -1,19 +1,77 @@
<section class="w-full flex flex-col bg-blue-500 dark:bg-slate-800 text-center pt-14">
<div class="max-container lg:w-3/4">
<h1 class="text-4xl md:text-5xl text-slate-50 dark:text-slate-300 leading-relaxed">
<!-- Hero Content Section (no background, used within header) -->
<div class="w-full flex flex-col text-center pt-8 pb-24 relative z-10">
<div class="max-container lg:w-4/5 xl:w-3/4 relative z-10">
<!-- Main Heading -->
<h1 class="text-4xl md:text-5xl lg:text-6xl text-white leading-tight font-bold tracking-tight">
<span class="relative whitespace-nowrap">
<svg aria-hidden="true" viewBox="0 0 418 42"
class="absolute top-2/3 left-0 h-[0.58em] w-full fill-blue-300/70"
class="absolute top-2/3 left-0 h-[0.58em] w-full fill-pink-300/60"
preserveAspectRatio="none">
<path d="M203.371.916c-26.013-2.078-76.686 1.963-124.73 9.946L67.3 12.749C35.421 18.062 18.2 21.766 6.004 25.934 1.244 27.561.828 27.778.874 28.61c.07 1.214.828 1.121 9.595-1.176 9.072-2.377 17.15-3.92 39.246-7.496C123.565 7.986 157.869 4.492 195.942 5.046c7.461.108 19.25 1.696 19.17 2.582-.107 1.183-7.874 4.31-25.75 10.366-21.992 7.45-35.43 12.534-36.701 13.884-2.173 2.308-.202 4.407 4.442 4.734 2.654.187 3.263.157 15.593-.78 35.401-2.686 57.944-3.488 88.365-3.143 46.327.526 75.721 2.23 130.788 7.584 19.787 1.924 20.814 1.98 24.557 1.332l.066-.011c1.201-.203 1.53-1.825.399-2.335-2.911-1.31-4.893-1.604-22.048-3.261-57.509-5.556-87.871-7.36-132.059-7.842-23.239-.254-33.617-.116-50.627.674-11.629.54-42.371 2.494-46.696 2.967-2.359.259 8.133-3.625 26.504-9.81 23.239-7.825 27.934-10.149 28.304-14.005.417-4.348-3.529-6-16.878-7.066Z"></path></svg><span
class="relative"> Cheat Sheets </span>
<path d="M203.371.916c-26.013-2.078-76.686 1.963-124.73 9.946L67.3 12.749C35.421 18.062 18.2 21.766 6.004 25.934 1.244 27.561.828 27.778.874 28.61c.07 1.214.828 1.121 9.595-1.176 9.072-2.377 17.15-3.92 39.246-7.496C123.565 7.986 157.869 4.492 195.942 5.046c7.461.108 19.25 1.696 19.17 2.582-.107 1.183-7.874 4.31-25.75 10.366-21.992 7.45-35.43 12.534-36.701 13.884-2.173 2.308-.202 4.407 4.442 4.734 2.654.187 3.263.157 15.593-.78 35.401-2.686 57.944-3.488 88.365-3.143 46.327.526 75.721 2.23 130.788 7.584 19.787 1.924 20.814 1.98 24.557 1.332l.066-.011c1.201-.203 1.53-1.825.399-2.335-2.911-1.31-4.893-1.604-22.048-3.261-57.509-5.556-87.871-7.36-132.059-7.842-23.239-.254-33.617-.116-50.627.674-11.629.54-42.371 2.494-46.696 2.967-2.359.259 8.133-3.625 26.504-9.81 23.239-7.825 27.934-10.149 28.304-14.005.417-4.348-3.529-6-16.878-7.066Z"/>
</svg>
<span class="relative bg-gradient-to-r from-white via-pink-100 to-purple-100 bg-clip-text text-transparent"> Cheat Sheets </span>
</span>
for Developers
<span class="block mt-2">for Developers</span>
</h1>
<h2 class="lg:w-2/3 text-center mx-auto text-xl text-slate-200 dark:text-slate-300 leading-tight font-extralight tracking-wide mt-10 mb-20">
Welcome the ultimate repository of sheets and quick references meticulously crafted by the open community
boost your productivity.
<!-- Subtitle -->
<h2 class="lg:w-3/4 xl:w-2/3 text-center mx-auto text-lg md:text-xl lg:text-2xl text-slate-300 leading-relaxed font-light tracking-wide mt-8 mb-12">
Welcome to the ultimate repository of sheets and quick references meticulously crafted by the open community to
<span class="font-semibold text-pink-300">boost your productivity</span>.
</h2>
<!-- CTA Buttons -->
<div class="flex flex-col lg:flex-row items-center justify-center gap-4 mb-16 max-w-4xl mx-auto">
<!-- GitHub Star Button -->
<a href="<%- edit_page() %>" target="_blank"
class="group inline-flex items-center px-6 py-3 bg-white/10 backdrop-blur-sm border border-white/20 rounded-xl text-white hover:bg-white/20 transition-all duration-300 hover:scale-105 hover:shadow-lg">
<div class="mr-3">
<%- icon("github") %>
</div>
<span class="font-semibold">Star on GitHub</span>
<div id="github-stars" class="ml-3 px-2 py-1 bg-white/20 rounded-md text-xs font-mono">
<span class="loading-dots">...</span>
</div>
</a>
<!-- Follow on X Button -->
<a href="https://x.com/FechinLi" target="_blank"
class="group inline-flex items-center px-6 py-3 bg-black/20 backdrop-blur-sm border border-white/20 rounded-xl text-white hover:bg-black/30 transition-all duration-300 hover:scale-105 hover:shadow-lg">
<div class="mr-3 group-hover:scale-110 transition-transform">
<%- icon("x") %>
</div>
<span class="font-semibold">Follow me on X</span>
<div class="ml-2 group-hover:translate-x-1 transition-transform">
→
</div>
</a>
<!-- Buy Me a Coffee Button -->
<a href="<%- donation_link('buymeacoffee') %>" target="_blank"
class="group inline-flex items-center px-6 py-3 bg-gradient-to-r from-orange-500/20 to-yellow-500/20 backdrop-blur-sm border border-orange-300/30 rounded-xl text-white hover:from-orange-500/30 hover:to-yellow-500/30 transition-all duration-300 hover:scale-105 hover:shadow-lg">
<div class="mr-3">
<svg style="display:inline" width="16" height="16" viewBox="0 0 25 35" fill="currentColor">
<path d="M22.0672 8.1281 22.0437 8.11426 21.9893 8.09766C22.0112 8.11614 22.0386 8.12685 22.0672 8.1281z" fill="currentColor"></path>
<path d="M22.4111 10.5781 22.3848 10.5855 22.4111 10.5781z" fill="currentColor"></path>
<path d="M22.0735 8.11128C22.0708 8.11093 22.0681 8.11029 22.0655 8.10938 22.0654 8.11115 22.0654 8.11293 22.0655 8.1147 22.0685 8.11432 22.0712 8.11313 22.0735 8.11128z" fill="currentColor"></path>
<path d="M22.3877 10.5647 22.4274 10.5421 22.4421 10.5338 22.4555 10.5195C22.4303 10.5304 22.4074 10.5457 22.3877 10.5647z" fill="currentColor"></path>
<path d="M22.1334 8.1762 22.0947 8.1393 22.0684 8.125C22.0825 8.14993 22.1058 8.16832 22.1334 8.1762z" fill="currentColor"></path>
<path d="M12.3836 31.9453C12.3526 31.9587 12.3255 31.9796 12.3047 32.0062L12.3291 31.9905C12.3457 31.9753 12.3693 31.9573 12.3836 31.9453z" fill="currentColor"></path>
<path d="M18.0497 30.8309C18.0497 30.7958 18.0326 30.8023 18.0368 30.9268 18.0368 30.9167 18.0409 30.9065 18.0428 30.8969 18.0451 30.8747 18.0469 30.853 18.0497 30.8309z" fill="currentColor"></path>
<path d="M17.4617 31.9453C17.4307 31.9587 17.4036 31.9796 17.3828 32.0062L17.4073 31.9905C17.4239 31.9753 17.4474 31.9573 17.4617 31.9453z" fill="currentColor"></path>
<path d="M8.39845 32.2145C8.37496 32.1941 8.34619 32.1807 8.31543 32.1758 8.34034 32.1878 8.36524 32.1998 8.38185 32.209L8.39845 32.2145z" fill="currentColor"></path>
<path d="M7.50541 31.3533C7.50173 31.317 7.49058 31.2818 7.47266 31.25 7.48535 31.2831 7.49598 31.317 7.50448 31.3515L7.50541 31.3533z" fill="currentColor"></path>
<path d="M13.5278 15.9814C12.2963 16.5086 10.8987 17.1064 9.08736 17.1064 8.32963 17.1048 7.57558 17.0009 6.8457 16.7973L8.09845 29.6592C8.14279 30.1968 8.38769 30.698 8.78452 31.0634 9.18134 31.4288 9.70106 31.6316 10.2405 31.6315 10.2405 31.6315 12.0167 31.7237 12.6094 31.7237 13.2474 31.7237 15.1601 31.6315 15.1601 31.6315 15.6995 31.6315 16.2191 31.4286 16.6158 31.0633 17.0125 30.6979 17.2574 30.1967 17.3017 29.6592l1.3418-14.2129C18.0439 15.2415 17.4387 15.1055 16.7565 15.1055 15.5767 15.105 14.626 15.5114 13.5278 15.9814z" fill="#FD0"></path>
<path d="M2.96582 10.5039l.02122.0198L3.00088 10.532C2.99022 10.5215 2.97847 10.512 2.96582 10.5039z" fill="currentColor"></path>
<path d="M24.4376 9.31226 24.249 8.36071C24.0797 7.50694 23.6955 6.70022 22.8191 6.39164 22.5382 6.29294 22.2195 6.2505 22.0041 6.04617 21.7887 5.84184 21.725 5.5245 21.6752 5.23023 21.583 4.6901 21.4963 4.14952 21.4017 3.61033 21.3201 3.14677 21.2555 2.62602 21.0428 2.20075 20.7661 1.62973 20.1918 1.29579 19.6208 1.07485 19.3282.965622 19.0296.873222 18.7265.798101 17.2998.421723 15.7999.283349 14.3322.204476c-1.7617-.097207-3.528-.06792-5.28547.087637-1.3081.119001-2.68584.262911-3.9289.715397C4.6635 1.1731 4.19533 1.37189 3.84986 1.7229c-.42389.43127-.56226 1.09823-.25276 1.63604.22001.38192.5927.65175.98799.83025.51488.23 1.0526.40501 1.60422.52213 1.53595.33948 3.12679.47278 4.69599.52951C12.6245 5.31103 14.3665 5.25414 16.0974 5.07063 16.5254 5.02359 16.9527 4.96716 17.3792 4.90136 17.8815 4.82433 18.2039 4.16751 18.0558 3.70995 17.8787 3.16292 17.4027 2.95074 16.8644 3.0333 16.7851 3.04576 16.7062 3.05729 16.6269 3.06882L16.5697 3.07712C16.3873 3.10019 16.205 3.12171 16.0226 3.1417 15.646 3.18229 15.2683 3.2155 14.8898 3.24133 14.042 3.30037 13.192 3.32758 12.3423 3.32896 11.5075 3.32896 10.6722 3.30544 9.83916 3.25055 9.45909 3.22564 9.07994 3.19397 8.70172 3.15553 8.52967 3.13755 8.35809 3.11864 8.18651 3.09742L8.02322 3.07666 7.98771 3.07159 7.81843 3.04714C7.4725 2.99502 7.12656 2.93506 6.78431 2.86264 6.74978 2.85498 6.71889 2.83577 6.69675 2.80818 6.67461 2.78059 6.66254 2.74627 6.66254 2.71089 6.66254 2.67552 6.67461 2.6412 6.69675 2.61361 6.71889 2.58602 6.74978 2.5668 6.78431 2.55914H6.79077C7.08735 2.49595 7.38624 2.44199 7.68605 2.39494 7.78599 2.37926 7.88623 2.36388 7.98679 2.34881H7.98955C8.17728 2.33636 8.36593 2.30269 8.55274 2.28055c1.62526-.16906 3.26026-.22669 4.89336-.17251C14.239 2.13111 15.0314 2.17769 15.8206 2.25795 15.9903 2.27548 16.1592 2.29393 16.328 2.31468 16.3926 2.32252 16.4576 2.33175 16.5226 2.33959l.131.01891C17.0355 2.41539 17.4154 2.48442 17.7934 2.5656 18.3533 2.68737 19.0724 2.72704 19.3215 3.3405 19.4008 3.53514 19.4368 3.75147 19.4806 3.9558L19.5364 4.2164C19.5379 4.22108 19.5389 4.22586 19.5396 4.2307 19.6716 4.8457 19.8036 5.46069 19.9359 6.07569 19.9455 6.12112 19.9458 6.16806 19.9365 6.21359 19.9273 6.25911 19.9087 6.30224 19.8821 6.34028 19.8554 6.37832 19.8212 6.41046 19.7816 6.4347 19.7419 6.45893 19.6977 6.47474 19.6517 6.48113H19.648L19.5673 6.4922 19.4875 6.50281C19.2348 6.53571 18.9817 6.56646 18.7283 6.59506 18.2292 6.65194 17.7294 6.70114 17.2288 6.74265 16.234 6.82537 15.2373 6.87965 14.2385 6.90548 13.7296 6.919 13.2209 6.92531 12.7123 6.92439 10.6878 6.92279 8.66519 6.80513 6.65424 6.57199 6.43653 6.54616 6.21883 6.51849 6.00112 6.49035 6.16993 6.51203 5.87843 6.47375 5.81939 6.46545 5.68101 6.44607 5.54264 6.42593 5.40426 6.40502 4.93979 6.33537 4.47808 6.24958 4.01453 6.1744 3.45411 6.08215 2.91814 6.12827 2.41123 6.40502c-.4161.2277-.75287.57686-.96539 1.00091-.21863.45202-.28367.94417-.38145 1.42987C.966604 9.32149.814392 9.84408.872048 10.3427c.124075 1.0761.876372 1.9506 1.958452 2.1462 1.01798.1845 2.04148.3339 3.06776.4612C9.9297 13.4439 14.0025 13.5029 18.0466 13.1263 18.3759 13.0956 18.7048 13.062 19.0332 13.0258 19.1358 13.0145 19.2396 13.0263 19.337 13.0604 19.4344 13.0944 19.523 13.1498 19.5962 13.2225S19.7255 13.3834 19.7602 13.4805C19.795 13.5777 19.8075 13.6814 19.797 13.7841L19.6946 14.7794C19.4883 16.7908 19.282 18.802 19.0756 20.813 18.8604 22.9249 18.6437 25.0366 18.4257 27.1482 18.3642 27.7429 18.3027 28.3375 18.2412 28.9319 18.1822 29.5172 18.1739 30.121 18.0627 30.6994 17.8875 31.609 17.2717 32.1675 16.3732 32.3719 15.55 32.5592 14.7091 32.6575 13.8649 32.6652 12.929 32.6703 11.9936 32.6288 11.0578 32.6338 10.0587 32.6394 8.83502 32.5471 8.06381 31.8036 7.38624 31.1505 7.29261 30.1279 7.20036 29.2437c-.123-1.1707-.24492-2.3412-.36577-3.5115l-.67803-6.5077-.43865-4.2108C5.71053 14.9441 5.70315 14.8754 5.69623 14.8053 5.64365 14.303 5.28803 13.8113 4.72761 13.8366 4.24792 13.8579 3.70272 14.2656 3.759 14.8053l.32517 3.1217L4.75667 24.3844C4.94824 26.2187 5.13935 28.0532 5.33 29.888 5.3669 30.2395 5.40149 30.5919 5.44024 30.9434c.21079 1.9206 1.67755 2.9556 3.49395 3.2472C9.99506 34.3612 11.0818 34.3963 12.1583 34.4138 13.5384 34.4359 14.9322 34.489 16.2897 34.239c2.0115-.369 3.5207-1.7122 3.7361-3.7956C20.0873 29.8419 20.1488 29.2403 20.2103 28.6385 20.4148 26.6484 20.619 24.6581 20.8228 22.6677L21.4898 16.1641 21.7956 13.1835C21.8108 13.0357 21.8733 12.8968 21.9736 12.7872 22.0739 12.6776 22.2069 12.6033 22.3528 12.5751 22.928 12.463 23.4778 12.2716 23.8869 11.8339 24.5382 11.137 24.6678 10.2283 24.4376 9.31226zM2.80098 9.95524C2.80975 9.95109 2.7936 10.0263 2.78669 10.0613 2.7853 10.0083 2.78807 9.96124 2.80098 9.95524zM2.8568 10.387C2.86141 10.3837 2.87524 10.4022 2.88954 10.4243 2.86786 10.404 2.85403 10.3888 2.85633 10.387H2.8568zM2.91168 10.4594C2.93152 10.4931 2.94213 10.5143 2.91168 10.4594v0zM3.02192 10.5489H3.02469C3.02469 10.5521 3.02976 10.5553 3.03161 10.5586 3.02855 10.555 3.02515 10.5Line truncated
</svg>
</div>
<span class="font-semibold">Buy Me a Coffee</span>
</a>
</div>
<div id="carbon_container"></div>
</div>
</section>
</div>
+30 -4
View File
@@ -1,16 +1,42 @@
<%
// Determine theme based on context
let logoTheme = 'light'; // default for non-home pages
if (typeof theme !== 'undefined') {
logoTheme = theme; // use passed theme if provided
} else if (is_home()) {
logoTheme = 'dark'; // dark theme for home page (light text on dark background)
}
// Define color classes based on theme
let iconColorClass, textColorClass, gradientClass, zipColorClass;
if (logoTheme === 'dark') {
// For dark backgrounds (home page)
iconColorClass = 'text-white';
textColorClass = 'text-slate-100';
gradientClass = 'bg-gradient-to-r from-white to-cyan-100 bg-clip-text text-transparent';
zipColorClass = 'text-cyan-300';
} else {
// For light backgrounds (detail pages, footer)
iconColorClass = 'text-emerald-600 dark:text-emerald-400';
textColorClass = 'text-slate-800 dark:text-slate-200';
gradientClass = 'bg-gradient-to-r from-slate-800 to-slate-600 bg-clip-text text-transparent dark:from-slate-200 dark:to-slate-400';
zipColorClass = 'text-emerald-600 dark:text-emerald-400';
}
%>
<a href="/" class="flex font-medium items-center justify-center md:justify-start text-slate-800 dark:text-slate-300">
<% if (icon) { %>
<div class="justify-center text-white mr-2 text-3xl md:text-4xl">
<div class="justify-center <%= iconColorClass %> mr-3 text-3xl md:text-4xl">
<div class="self-center">
<%- icon("logo") %>
</div>
</div>
<% } %>
<span class="hidden md:flex domain text-slate-600 dark:text-slate-300 text-lg md:text-2xl">cheatsheets<span
class="text-emerald-400">.zip</span></span>
<span class="hidden md:flex domain text-xl md:text-2xl lg:text-3xl font-bold tracking-tight">
<span class="<%= gradientClass %>">cheatsheets</span><span class="<%= zipColorClass %> font-black">.zip</span>
</span>
</a>
<% if (page.layout == "note" || page._isNotePagination){ %>
<a class="hidden md:block" href="/notes/">
<span class="flex items-center pl-2 ml-2 text-lg text-slate-600 md:border-l border-slate-400 dark:border-slate-700">Notes</span>
<span class="flex items-center pl-2 ml-2 text-lg text-slate-300 md:border-l border-slate-400 dark:border-slate-700 hover:text-white transition-colors">Notes</span>
</a>
<% } %>
+4 -20
View File
@@ -1,6 +1,6 @@
<section class="text-slate-800 max-container">
<div class=" mx-auto flex py-12 items-center justify-center flex-col">
<span class="inline-block h-1 w-10 rounded-full bg-emerald-500 mt-8 mb-6"></span>
<span class="inline-block h-1 w-10 rounded-full bg-gradient-to-r from-indigo-500 to-purple-600 mt-8 mb-6"></span>
<div class="text-center lg:w-2/3 w-full">
<h3 class="sm:text-4xl text-3xl mb-4 font-medium text-slate-800 dark:text-slate-300">See something
missing?</h3>
@@ -9,25 +9,9 @@
cheat sheets in real-time, it's a best chance to do it!
</p>
<div class="flex flex-col md:flex-row justify-center">
<a href="<%- contributing() %>" target="_blank">
<button type="button"
class="mt-5 fadeIn inline-flex items-center rounded-full bg-[#364153] text-slate-100 text-lg ml-1 lg:ml-4 py-2 px-8 md:hover:opacity-80">
<div class="mr-3">
<%- icon("github") %>
</div>
Contribute on Github
</button>
</a>
<a href="https://twitter.com/FechinLi" target="_blank">
<button type="button"
class="mt-5 fadeIn inline-flex items-center rounded-full bg-[#4d9feb] text-slate-100 text-lg ml-1 lg:ml-4 py-2 px-8 md:hover:opacity-80">
<div class="mr-3">
<%- icon("twitter") %>
</div>
Follow Me
</button>
</a>
<div class="flex flex-col md:flex-row justify-center space-x-4">
<%- partial('_partial/buttons/github-contribute', {variant: 'request', showLabel: true}) %>
<%- partial('_partial/buttons/follow-x', {variant: 'request', showLabel: true}) %>
</div>
</div>
</div>
+1 -1
View File
@@ -1,5 +1,5 @@
<header class="note-width z-10 mx-auto">
<div class="flex flex-row justify-between md:justify-start items-center p-3 md:py-5">
<%- partial('_partial/index/logo', {icon: true}) %>
<%- partial('_partial/index/logo', {icon: true, theme: 'light'}) %>
</div>
</header>
@@ -1,5 +1,5 @@
<a href="<%= url_for(post.path) %>"
class="group flex items-center p-3 bg-slate-50 rounded-lg hover:shadow dark:bg-slate-900 hover:bg-emerald-500 fadeIn">
class="group flex items-center p-3 bg-slate-50 rounded-lg hover:shadow dark:bg-slate-900 hover:bg-gradient-to-r hover:from-indigo-500 hover:to-purple-600 fadeIn">
<div class="ml-4 truncate hover:text-clip overflow-hidden">
<p class="mb-1 text-sm font-medium text-slate-900 dark:text-slate-300 group-hover:text-white"><%= post.title %>
<span class="text-slate-400 group-hover:text-white"> Cheatsheet</span>
+3 -3
View File
@@ -45,7 +45,7 @@
codeBlocks.forEach(function (codeBlock) {
// Create a copy button element
const copyButton = document.createElement('button');
copyButton.className = 'bg-emerald-500 p-2 text-white fadeIn shadow-xl rounded flex items-center absolute top-2 right-2';
copyButton.className = 'opacity-90 bg-gradient-to-r from-indigo-500 to-purple-600 hover:from-indigo-600 hover:to-purple-700 p-2 text-white shadow-xl rounded-lg flex items-center absolute top-2 right-2 transition-all duration-200 backdrop-blur-sm';
copyButton.innerHTML = initInnerHTML;
copyButton.style.opacity = "0";
const parent = codeBlock.parentNode;
@@ -94,7 +94,7 @@
// Create a run button element
const runButton = document.createElement('button');
runButton.className = 'bg-emerald-500 p-2 text-white fadeIn shadow-xl rounded flex items-center absolute top-12 right-2';
runButton.className = 'opacity-90 bg-gradient-to-r from-purple-500 to-pink-500 hover:from-purple-600 hover:to-pink-600 p-2 text-white shadow-xl rounded-lg flex items-center absolute top-12 right-2 transition-all duration-200 backdrop-blur-sm';
runButton.innerHTML = runInnerHTML;
runButton.style.opacity = "0";
const parent = codeBlock.parentNode;
@@ -428,7 +428,7 @@ function showUpdateNotification() {
top: 0;
left: 0;
right: 0;
background: #10b981;
background: #6366f1;
color: white;
padding: 12px;
text-align: center;
+3 -3
View File
@@ -6,13 +6,13 @@
<div class="w-full h-full">
<form class="flex items-center w-full h-full outline-none rounded-tl-lg">
<label for="mysearch-input" id="mysearch-label"
class="h-full w-14 mt-1 ml-1 px-4 flex items-center justify-center transition-colors duration-200 ease-in-out text-emerald-200">
<div class="text-2xl text-emerald-500">
class="h-full w-14 mt-1 ml-1 px-4 flex items-center justify-center transition-colors duration-200 ease-in-out text-indigo-200">
<div class="text-2xl text-indigo-500">
<%-icon('search')%>
</div>
</label>
<div class="relative flex-1">
<input class="flex-1 font-light h-full bg-transparent focus:text-slate-900 text-slate-500 dark:text-slate-300 placeholder-slate-400 placeholder-opacity-80 shadow-none outline-none truncate text-lg sm:text-2xl caret-color-emerald-400 leading-normalized w-full appearance-none rounded-none transition-colors duration-200 ease-in-out"
<input class="flex-1 font-light h-full bg-transparent focus:text-slate-900 text-slate-500 dark:text-slate-300 placeholder-slate-400 placeholder-opacity-80 shadow-none outline-none truncate text-lg sm:text-2xl caret-color-indigo-400 leading-normalized w-full appearance-none rounded-none transition-colors duration-200 ease-in-out"
id="mysearch-input"
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
placeholder="Search for cheatsheet" maxlength="128" type="text"
+2 -2
View File
@@ -1,6 +1,6 @@
<div class="inline-flex text-slate-500 sm:ml-auto sm:mt-0 mt-2 justify-center sm:justify-start <%- extra %>">
<div class="inline-flex text-slate-500 sm:ml-auto sm:mt-0 mt-2 <% if (extra && extra.includes('justify-start')) { %>justify-start<% } else { %>justify-center sm:justify-start<% } %> <% if (extra && !extra.includes('justify-start')) { %><%- extra %><% } %>">
<a class="mr-3 fadeIn hover:text-slate-700 dark:hover:text-slate-300" href="<%- share_link("facebook") %>" target="_blank"><%-icon('facebook')%></a>
<a class="mx-3 fadeIn hover:text-slate-700 dark:hover:text-slate-300" href="<%- share_link("twitter") %>" target="_blank"><%-icon('twitter')%></a>
<a class="mx-3 fadeIn hover:text-slate-700 dark:hover:text-slate-300" href="<%- share_link("x") %>" target="_blank"><%-icon('x')%></a>
<a class="mx-3 fadeIn hover:text-slate-700 dark:hover:text-slate-300" href="<%- share_link("reddit") %>" target="_blank"><%-icon('reddit')%></a>
<a class="mx-3 fadeIn hover:text-slate-700 dark:hover:text-slate-300" href="<%- share_link("pinterest") %>" target="_blank"><%-icon('pinterest')%></a>
<a class="mx-3 fadeIn hover:text-slate-700 dark:hover:text-slate-300" href="<%- share_link("linkedin") %>" target="_blank"><%-icon('linkedin')%></a>
@@ -0,0 +1,42 @@
<%
// Social buttons component - compatibility wrapper, directly uses independent button components
// variant: 'hero' | 'compact' | 'inline'
// showLabels: boolean - whether to show text labels
// className: string - additional CSS class names
// buttons: array - button types to display ['github', 'x', 'coffee']
const variant = locals.variant || 'hero';
const showLabels = locals.showLabels !== false; // show labels by default
const className = locals.className || '';
const buttons = locals.buttons || ['github', 'x', 'coffee']; // show all buttons by default
// Set container styles based on variant
const containerClass = {
hero: 'flex flex-col lg:flex-row items-center justify-center gap-4 mb-16 max-w-4xl mx-auto',
compact: 'hidden lg:flex items-center ml-3',
inline: 'flex flex-wrap items-center justify-center gap-3 mt-6 mb-8'
}[variant];
%>
<div class="<%= containerClass %> <%= className %>">
<% if (buttons.includes('github')) { %>
<%- partial('_partial/buttons/github-star', {
variant: variant,
showLabel: showLabels
}) %>
<% } %>
<% if (buttons.includes('x')) { %>
<%- partial('_partial/buttons/follow-x', {
variant: variant,
showLabel: showLabels
}) %>
<% } %>
<% if (buttons.includes('coffee')) { %>
<%- partial('_partial/buttons/buy-coffee', {
variant: variant,
showLabel: showLabels
}) %>
<% } %>
</div>
+3 -4
View File
@@ -1,12 +1,11 @@
<%- partial('_partial/index/hero') %>
<section class="home max-container">
<div class="w-full lg:w-2/3 flex flex-col mx-auto justify-center mt-10">
<div class="w-full lg:w-4/5 flex flex-col mx-auto justify-center mt-10">
<%- partial('_partial/index/recommend') %>
<div class="mt-6">
<% theme.index_categories.forEach(function (category) { %>
<h2 class="sm:text-xl font-medium mt-12 mb-2 text-slate-800 dark:text-slate-300"><%- category %></h2>
<div class="h-1 bg-slate-200 dark:bg-slate-900 ounded-full overflow-hidden mb-6">
<div class="w-24 h-full bg-emerald-500 dark:bg-slate-800"></div>
<div class="w-24 h-full bg-gradient-to-r from-indigo-500 to-purple-600 dark:bg-slate-800"></div>
</div>
<div class="w-full grid grid-cols-2 md:grid-cols-4 gap-6 md:gap-8 mb-6 text-slate-800">
<% site.categories.findOne({name: category}).posts.sort('date').map(function(post){ %>
@@ -15,7 +14,7 @@
title: post.title,
label: post.label,
slug: post.slug,
background: post.background == undefined ? 'bg-emerald-500' : post.background
background: post.background == undefined ? 'bg-gradient-to-r from-indigo-500 to-purple-600' : post.background
}) %>
<% }) %>
</div>
+7
View File
@@ -5,6 +5,13 @@
<span class="text-slate-700 dark:text-slate-300 font-light"><%- page.title %></span>
</h1>
<div class="lg:w-3/5 mx-auto intro leading-relaxed text-slate-600 dark:text-slate-500"><%- page.intro != null ? markdown(page.intro) : "" %></div>
<!-- Social Buttons (Inline) -->
<div class="flex flex-wrap items-center justify-center gap-3 mt-6 mb-8">
<%- partial('_partial/buttons/github-star', {variant: 'inline', showLabel: true}) %>
<%- partial('_partial/buttons/follow-x', {variant: 'inline', showLabel: true}) %>
<%- partial('_partial/buttons/buy-coffee', {variant: 'inline', showLabel: true}) %>
</div>
</div>
</div>
<div id="mdLayout" class="mdLayout w-full max-container">
+8
View File
@@ -6,6 +6,14 @@
<span class="text-slate-400 dark:text-slate-500 font-extralight hidden md:inline">cheatsheet</span>
</h1>
<div class="lg:w-3/5 mx-auto intro leading-relaxed text-slate-600"><%- page.intro != null ? markdown(page.intro) : "" %></div>
<!-- Social Buttons (Inline) -->
<div class="flex flex-wrap items-center justify-center gap-3 mt-6 mb-8">
<%- partial('_partial/buttons/github-star', {variant: 'inline', showLabel: true}) %>
<%- partial('_partial/buttons/follow-x', {variant: 'inline', showLabel: true}) %>
<%- partial('_partial/buttons/buy-coffee', {variant: 'inline', showLabel: true}) %>
</div>
<div class="pt-5" id="carbon_container"></div>
</div>
</div>
+44
View File
@@ -0,0 +1,44 @@
// Donation configuration and helper functions
const donationConfig = {
github: {
url: 'https://github.com/sponsors/Fechin',
enabled: true
},
buymeacoffee: {
url: 'https://buymeacoffee.com/fechin',
enabled: true
},
kofi: {
url: 'https://ko-fi.com/fechin',
enabled: true
},
paypal: {
url: 'https://paypal.me/fechinli',
enabled: true
}
};
// Helper function to get donation URLs
hexo.extend.helper.register('donation_link', function (platform) {
const config = donationConfig[platform];
if (config && config.enabled) {
return config.url;
}
return '#';
});
// Helper function to check if donations are enabled
hexo.extend.helper.register('donations_enabled', function () {
return Object.values(donationConfig).some((config) => config.enabled);
});
// Helper function to get all enabled donation platforms
hexo.extend.helper.register('enabled_donations', function () {
return Object.entries(donationConfig)
.filter(([platform, config]) => config.enabled)
.map(([platform, config]) => ({
platform,
url: config.url
}));
});
+2 -1
View File
@@ -10,7 +10,8 @@ hexo.extend.helper.register('share_link', function (type) {
link = `https://facebook.com/sharer/sharer.php?u=${url}`;
break;
case 'twitter':
link = `https://twitter.com/intent/tweet/?text=${description}&url=${url}`;
case 'x':
link = `https://x.com/intent/tweet/?text=${description}&url=${url}`;
break;
case 'linkedin':
link = `https://www.linkedin.com/shareArticle?url=${url}&title=${title}&summary=${description}`;
+7 -3
View File
@@ -1,12 +1,16 @@
code {
@apply text-emerald-600;
@apply text-indigo-600;
@apply dark:text-slate-300;
}
pre {
line-height: 1.5;
@apply overflow-hidden overflow-x-auto bg-white p-4;
@apply dark:bg-slate-800;
}
pre:is(.dark *) {
background-color: transparent;
}
.mdLayout pre + p:not(:last-child) {
@@ -32,7 +36,7 @@ pre > code.wrap {
.mdLayout .line-highlight {
transform: translate3d(0, 2px, 0);
background: linear-gradient(to right, rgba(20, 175, 131, 0.05) 25%, transparent);
background: linear-gradient(to right, rgb(20 175 131 / 5%) 25%, transparent);
}
.mdLayout .line-highlight[data-end] {
@@ -32,7 +32,7 @@
content: '';
top: 16px;
@apply inline-block h-2 w-2 rounded-full border border-2 border-emerald-600 bg-white;
@apply inline-block h-2 w-2 rounded-full border border-2 border-indigo-600 bg-white;
}
.mdLayout .h3-wrap > .section > ul.collapsible > li > pre {
@@ -57,7 +57,7 @@
left: 10px;
font-size: 0.825em;
@apply text-emerald-500;
@apply text-indigo-500;
}
.mdLayout .h3-wrap > .section > ul.marker-timeline {
@@ -68,7 +68,7 @@
.mdLayout .h3-wrap > .section > ul.marker-timeline > li {
padding-top: 2px;
padding-bottom: 1.25rem;
border-left: 2px solid #48c78e;
border-left: 2px solid #6366f1;
position: relative;
padding-left: 22px;
margin-left: 30px;
@@ -79,7 +79,7 @@
.mdLayout .h3-wrap > .section > ul.marker-timeline > li:last-child {
padding-bottom: 0.8rem;
border-image: linear-gradient(to bottom, #48c78e, rgb(0 0 0 / 0%)) 1 100%;
border-image: linear-gradient(to bottom, #6366f1, rgb(0 0 0 / 0%)) 1 100%;
}
.mdLayout .h3-wrap > .section > ul.marker-timeline > li > pre {
@@ -91,14 +91,14 @@
counter-increment: stepCount;
content: counter(stepCount);
left: -14px;
border: 2px solid #48c78e;
border: 2px solid #6366f1;
@apply absolute top-0 h-6 w-6 rounded-full bg-white text-center text-sm;
@apply dark:border-slate-600 dark:bg-slate-800;
@apply dark:border-indigo-600 dark:bg-indigo-800;
}
.mdLayout .h3-wrap > .section > ul.marker-timeline > li:first-child::before {
background: #48c78e;
background: #6366f1;
color: white;
}
@@ -39,7 +39,7 @@
.note-content pre,
.note-content pre > code {
@apply mt-3 rounded-lg bg-[#f6f6f6];
@apply dark:bg-slate-800;
@apply dark:bg-indigo-900;
}
.note-content a {
@@ -52,7 +52,7 @@
}
.note-content a:hover {
background-image: linear-gradient(transparent, transparent 4px, #2bbc8a 4px, #2bbc8a);
background-image: linear-gradient(transparent, transparent 4px, #6366f1 4px, #6366f1);
}
.note-content h2 {
@@ -76,7 +76,7 @@
}
.note-content blockquote {
border-left: 3px solid #2bbc8a;
border-left: 3px solid #6366f1;
border-left-width: 6px;
background-color: #f8f8f8;
padding: 15px 20px;
@@ -42,7 +42,7 @@
}
.mdLayout table td:first-child > code {
@apply text-emerald-600;
@apply text-indigo-600;
}
.mdLayout table a,
@@ -86,7 +86,7 @@ kbd {
/* text-shadow: 0 1px 0 #fff; */
color: #303835;
@apply dark:border-slate-700 dark:bg-slate-700/50 dark:text-slate-300 dark:shadow-none dark:shadow-slate-500;
@apply dark:border-indigo-700 dark:bg-indigo-700/50 dark:text-indigo-300 dark:shadow-none dark:shadow-indigo-500;
}
.mdLayout table.left-text tr th,
+489
View File
@@ -0,0 +1,489 @@
/* Modern Navbar Styles */
/* Share Dropdown Styles */
.share-dropdown {
position: relative;
z-index: 1000; /* Ensure container has sufficient z-index */
}
/* Ensure navbar container doesn't clip dropdown menu */
header .max-container {
overflow: visible;
position: relative; /* Ensure z-index takes effect */
}
#share-menu {
transform-origin: top right;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
/* Use absolute positioning, follow button position */
position: absolute;
z-index: 99999; /* Increase z-index to ensure it's on top layer */
pointer-events: auto; /* Ensure it can be clicked */
}
#share-menu.opacity-0 {
opacity: 0;
visibility: hidden;
transform: scale(0.95) translateY(-10px);
}
#share-menu.opacity-100 {
opacity: 1;
visibility: visible;
transform: scale(1) translateY(0);
}
/* Share menu items - Fix alignment and overflow issues */
.share-item {
transition: background-color 0.15s ease-in-out;
cursor: pointer;
pointer-events: auto; /* Ensure menu items can be clicked */
/* Fix icon and text alignment */
align-items: center;
display: flex;
}
/* Fix icon container alignment */
.share-item .flex-shrink-0 {
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
/* Fix SVG icon alignment within container */
.share-item .flex-shrink-0 svg {
width: 20px;
height: 20px;
flex-shrink: 0;
}
/* Fix hover background to not overflow container */
.share-item:hover {
background-color: rgb(148 163 184 / 10%);
border-radius: 0.75rem; /* 12px rounded-xl */
margin: 0.25rem 0.5rem; /* 4px 8px - ensure margin for rounded corners */
}
.dark .share-item:hover {
background-color: rgb(71 85 105 / 50%);
}
/* Fix the last item specifically to prevent overflow */
.share-item:last-child {
margin-bottom: 0.25rem; /* Ensure bottom margin */
}
/* Ensure dropdown menu can be interacted with when visible */
#share-menu.opacity-100 {
pointer-events: auto;
}
#share-menu.opacity-0 {
pointer-events: none;
}
/* Debug styles - ensure dropdown menu is visible */
#share-menu {
/* Temporary debug: make menu always visible */
/* opacity: 1 !important; */
/* visibility: visible !important; */
/* transform: scale(1) !important; */
}
/* Backdrop blur support */
@supports (backdrop-filter: blur(10px)) {
.backdrop-blur-sm {
backdrop-filter: blur(4px);
}
}
/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
.backdrop-blur-sm {
background-color: rgb(255 255 255 / 80%);
}
.dark .backdrop-blur-sm {
background-color: rgb(0 0 0 / 80%);
}
}
/* Professional Flexbox Layout Solution for Home Page */
body {
padding-top: 0;
margin: 0;
}
/* Use modern viewport units with fallback */
html {
height: 100%;
}
body {
min-height: 100vh; /* Fallback */
min-height: 100dvh; /* Dynamic viewport height for mobile */
display: flex;
flex-direction: column;
}
/* Header positioning for home page - use relative instead of absolute */
header.home {
position: relative; /* Change from absolute to relative for natural flow */
z-index: 50;
flex-shrink: 0; /* Don't shrink */
/* Keep all the background styling for hero section */
}
/* Main content area takes remaining space */
section.home {
flex: 1; /* Take all available space */
display: flex;
flex-direction: column;
margin-top: 0;
position: relative;
z-index: 10;
}
/* Footer stays at bottom */
footer {
flex-shrink: 0; /* Don't shrink */
margin-top: auto; /* Push to bottom if content is short */
}
/* Content spacing - natural and responsive */
section.home .max-container {
margin-top: 0;
padding-top: 2rem; /* Clean visual spacing */
flex: 1; /* Take available space in the section */
}
/* Legacy selector for backward compatibility */
.home .max-container:last-child {
margin-top: 2rem;
}
/* Mobile optimizations */
@media (width <= 768px) {
/* Adjust header spacing on mobile */
header .max-container {
padding-left: 1rem;
padding-right: 1rem;
}
/* Make buttons more touch-friendly */
#mysearch-trigger,
#darkMode,
#share-trigger {
min-height: 44px;
min-width: 44px;
}
/* Adjust share dropdown position on mobile */
#share-menu {
right: 0;
left: auto;
width: 280px;
max-width: calc(100vw - 2rem);
}
/* Hero section mobile adjustments */
.hero-section {
padding-top: 2rem;
padding-bottom: 3rem;
}
.hero-section h1 {
font-size: 2.5rem;
line-height: 1.2;
}
.hero-section h2 {
font-size: 1.125rem;
line-height: 1.6;
}
/* CTA buttons stack on mobile */
.hero-cta-buttons {
flex-direction: column;
gap: 1rem;
}
.hero-cta-buttons a {
width: 100%;
justify-content: center;
}
/* Stats grid on mobile */
.hero-stats {
grid-template-columns: 1fr;
gap: 1rem;
}
/* Mobile grid adjustments */
body:has(.home) {
grid-template-rows: auto 1fr auto; /* Maintain grid structure */
}
/* Fix mobile content spacing */
section.home .max-container {
padding-top: 1.5rem; /* Responsive spacing */
}
.home .max-container:last-child {
margin-top: 1rem;
padding-top: 2rem;
}
}
/* Tablet optimizations */
@media (width >= 769px) and (width <= 1024px) {
/* Adjust container width on tablet */
.max-container {
padding-left: 1.5rem;
padding-right: 1.5rem;
}
/* Hero section tablet adjustments */
.hero-section h1 {
font-size: 3.5rem;
}
.hero-section h2 {
font-size: 1.25rem;
}
/* Tablet grid adjustments */
section.home .max-container {
padding-top: 2rem; /* Consistent responsive spacing */
}
}
/* Large screen optimizations */
@media (width >= 1280px) {
/* Add more spacing on large screens */
.hero-section {
padding-top: 4rem;
padding-bottom: 6rem;
}
.hero-section h1 {
font-size: 4rem;
}
.hero-section h2 {
font-size: 1.5rem;
}
/* Large screen grid adjustments */
section.home .max-container {
padding-top: 3rem; /* Slightly more spacing for large screens */
}
}
/* Animation improvements */
@media (prefers-reduced-motion: no-preference) {
/* Add subtle animations */
.fadeIn {
animation: fadeInUp 0.6s ease-out forwards;
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.fadeIn:nth-child(1) {
animation-delay: 0.1s;
}
.fadeIn:nth-child(2) {
animation-delay: 0.2s;
}
.fadeIn:nth-child(3) {
animation-delay: 0.3s;
}
.fadeIn:nth-child(4) {
animation-delay: 0.4s;
}
}
/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
.fadeIn,
* {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* Focus states for accessibility */
#mysearch-trigger:focus,
#darkMode:focus,
#share-trigger:focus {
outline: 2px solid rgb(99 102 241);
outline-offset: 2px;
}
/* High contrast mode support */
@media (prefers-contrast: high) {
#share-menu {
border: 2px solid;
}
.share-item:hover {
border: 1px solid;
}
}
/* Hero section specific styles */
.hero-section {
background: linear-gradient(135deg, rgb(99 102 241), rgb(139 92 246));
position: relative;
overflow: hidden;
}
/* Header background styles for home page (positioning handled above) */
header.home .max-container {
background: transparent;
}
/* Animation keyframes */
@keyframes float {
0%,
100% {
transform: translateY(0);
}
50% {
transform: translateY(-10px);
}
}
@keyframes pulse-slow {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.5;
}
}
@keyframes drift {
0% {
transform: translateX(-50px);
}
50% {
transform: translateX(50px);
}
100% {
transform: translateX(-50px);
}
}
/* Apply animations */
header .animate-float {
animation: float 6s ease-in-out infinite;
}
header .animate-pulse-slow {
animation: pulse-slow 4s ease-in-out infinite;
}
header .animate-drift {
animation: drift 20s linear infinite;
}
/* Background effects */
.mesh-gradient {
background: linear-gradient(
135deg,
rgb(99 102 241 / 80%),
rgb(139 92 246 / 80%),
rgb(168 85 247 / 80%)
);
}
/* Search trigger styles */
#mysearch-trigger {
position: relative;
}
#mysearch-trigger .shortcut-key {
opacity: 0.7;
font-size: 0.75rem;
font-weight: 500;
margin-left: 0.5rem;
}
/* Loading animation for GitHub stars */
.loading-dots {
animation: loading-dots 1.5s infinite;
}
@keyframes loading-dots {
0%,
20% {
color: transparent;
text-shadow:
0.25em 0 0 currentcolor,
0.5em 0 0 transparent;
}
40% {
color: currentcolor;
text-shadow:
0.25em 0 0 transparent,
0.5em 0 0 transparent;
}
60%,
80% {
text-shadow:
0.25em 0 0 currentcolor,
0.5em 0 0 currentcolor;
}
}
/* GitHub stars counter */
#github-stars {
transition: all 0.2s ease-in-out;
min-width: 2rem;
text-align: center;
}
#github-stars.animate-pulse {
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
/* Donation button styles */
.donation-button-hero {
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.donation-button-hero:hover {
transform: translateY(-2px);
box-shadow:
0 10px 25px -3px rgb(0 0 0 / 10%),
0 4px 6px -2px rgb(0 0 0 / 5%);
}
@@ -1,8 +1,8 @@
.pagination .prev,
.pagination .next,
.pagination .page-number {
@apply mx-1 rounded-md bg-white px-3 py-2.5 font-medium text-slate-700 shadow hover:bg-emerald-500 hover:text-white;
@apply dark:bg-slate-800 dark:text-slate-300;
@apply mx-1 rounded-md bg-white px-3 py-2.5 font-medium text-slate-700 shadow hover:bg-indigo-500 hover:text-white;
@apply dark:bg-indigo-900 dark:text-indigo-300;
}
.pagination .space {
@@ -11,5 +11,5 @@
}
.pagination .page-number.current {
@apply bg-emerald-500 text-white;
@apply bg-indigo-500 text-white;
}
+40 -12
View File
@@ -1,5 +1,17 @@
#mysearch {
@apply duration-200 animate-in fade-in;
animation-duration: 200ms;
animation-name: fade-in;
animation-fill-mode: both;
}
@keyframes fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
#mysearch-box {
@@ -7,54 +19,70 @@
}
#mysearch em {
@apply not-italic text-emerald-500;
font-style: normal;
color: rgb(99 102 241);
}
.text-color-inherit {
color: inherit;
}
@media (min-width: 1200px) {
@media (width >= 1200px) {
.xl\:max-h-832 {
max-height: 800px;
}
}
#mysearch-list li.inactive {
@apply border-slate-200;
border-color: rgb(226 232 240);
}
#mysearch-list li.inactive > a.link {
@apply bg-transparent text-slate-900;
background-color: transparent;
color: rgb(15 23 42);
}
#mysearch-list li.inactive .icon-enter {
@apply hidden;
display: none;
}
#mysearch-list li.inactive i.icon,
#mysearch-list li.inactive .sub-intro {
@apply text-slate-400;
color: rgb(148 163 184);
}
#mysearch-list li.active {
@apply z-10 border-transparent shadow-sm;
z-index: 10;
border-color: transparent;
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 5%);
}
#mysearch-list li.active > a {
@apply bg-emerald-500 text-white shadow;
background-color: rgb(99 102 241);
color: rgb(255 255 255);
box-shadow:
0 1px 3px 0 rgb(0 0 0 / 10%),
0 1px 2px -1px rgb(0 0 0 / 10%);
}
#mysearch-list li.active em {
color: inherit;
@apply underline;
text-decoration-line: underline;
}
#mysearch-list li.active .icon-enter {
@apply block;
display: block;
}
#mysearch-list li.active i.icon,
#mysearch-list li.active .sub-intro {
@apply text-white;
color: rgb(255 255 255);
}
/* Ensure search result items have no fade-in animation */
#mysearch-list li {
animation: none !important;
transition:
background-color 0.1s ease-in-out,
border-color 0.1s ease-in-out;
}
@@ -0,0 +1,198 @@
/* Social Buttons Component Styles */
/* Base styles for all social buttons */
.social-buttons {
/* Ensure proper spacing and alignment */
}
/* Fix icon and text alignment issues */
.social-buttons a {
/* Ensure perfect vertical alignment */
align-items: center !important;
justify-content: center !important;
}
.social-buttons a > div,
.social-buttons a > span {
/* Remove any default margins that might cause misalignment */
margin-top: 0 !important;
margin-bottom: 0 !important;
/* Ensure consistent line height */
line-height: 1 !important;
/* Prevent flex items from growing/shrinking unexpectedly */
flex-shrink: 0;
}
/* Specific fixes for SVG icons */
.social-buttons svg {
/* Ensure SVG icons are properly aligned */
vertical-align: middle;
display: block;
/* Override any fixed width/height attributes to match container */
width: 100% !important;
height: 100% !important;
}
/* Ensure icon containers have consistent sizing */
.social-buttons .w-4 {
width: 1rem !important;
height: 1rem !important;
}
.social-buttons .w-5 {
width: 1.25rem !important;
height: 1.25rem !important;
}
/* Force all SVG icons to inherit container dimensions */
.social-buttons .w-4 svg,
.social-buttons .w-5 svg {
width: 100% !important;
height: 100% !important;
max-width: 100% !important;
max-height: 100% !important;
}
/* Hero variant - large buttons for homepage */
.social-buttons.hero {
/* Already handled by Tailwind classes in component */
}
/* Compact variant - small icons for navbar */
.social-buttons.compact {
/* Hide on mobile to save space */
@media (width <= 1023px) {
display: none !important;
}
}
/* Inline variant - medium size for detail pages */
.social-buttons.inline {
/* Responsive adjustments for inline variant */
@media (width <= 768px) {
flex-direction: column;
gap: 0.75rem;
}
@media (width <= 640px) {
/* Stack vertically on small screens */
flex-direction: column;
align-items: stretch;
gap: 0.5rem;
}
}
/* GitHub stars counter responsive behavior */
[id^='github-stars'] {
/* Ensure stars counter is readable */
min-width: 2rem;
text-align: center;
}
/* Compact variant specific styling for navbar */
#github-stars-compact {
min-width: 2.5rem;
font-size: 0.75rem;
line-height: 1;
text-align: center;
font-weight: 500;
}
/* Ensure proper text color for compact variant */
#github-stars-compact {
color: inherit;
}
/* Home page compact variant */
.home #github-stars-compact {
color: rgb(255 255 255 / 90%);
}
/* Non-home page compact variant */
body:not(.home) #github-stars-compact {
color: rgb(71 85 105); /* slate-600 */
}
.dark body:not(.home) #github-stars-compact {
color: rgb(203 213 225); /* slate-300 */
}
/* Loading animation for stars */
.loading-dots {
animation: loading-dots 1.5s infinite;
}
@keyframes loading-dots {
0%,
20% {
opacity: 0.4;
}
50% {
opacity: 1;
}
80%,
100% {
opacity: 0.4;
}
}
/* Button hover effects - ensure they work on all variants */
.social-buttons a {
/* Smooth transitions */
transition: all 0.2s ease-in-out;
}
/* Responsive text sizing */
@media (width <= 640px) {
.social-buttons.inline a {
padding: 0.5rem 1rem;
font-size: 0.875rem;
}
.social-buttons.inline [id^='github-stars'] {
font-size: 0.75rem;
padding: 0.25rem 0.5rem;
}
}
/* Ensure proper spacing between buttons on all screen sizes */
.social-buttons.hero {
@media (width <= 1024px) {
flex-direction: column;
gap: 1rem;
}
}
/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
.social-buttons.inline a {
/* Ensure good contrast in dark mode */
border-color: rgb(51 65 85 / 70%);
}
}
/* Focus states for accessibility */
.social-buttons a:focus {
outline: 2px solid rgb(59 130 246);
outline-offset: 2px;
}
/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
.social-buttons a {
transition: none;
}
.social-buttons a:hover {
transform: none !important;
}
.loading-dots {
animation: none;
}
}
+31 -31
View File
@@ -40,7 +40,7 @@
content: '';
@apply absolute bottom-0 left-1/2 top-0 w-0.5;
@apply bg-slate-300 dark:bg-slate-600;
@apply bg-indigo-200 dark:bg-indigo-700;
transform: translateX(-50%);
z-index: 1;
@@ -51,7 +51,7 @@
content: '';
@apply absolute left-1/2 top-0 w-0.5;
@apply bg-gradient-to-b from-emerald-400 via-emerald-500 to-emerald-600;
@apply bg-gradient-to-b from-indigo-400 via-indigo-500 to-indigo-600;
transform: translateX(-50%);
z-index: 1;
@@ -89,14 +89,14 @@
/* Add subtle background when hovering over the list */
.toc-list:hover .toc-link {
@apply bg-slate-100 dark:bg-slate-800;
@apply bg-indigo-50 dark:bg-indigo-900;
opacity: 0.7;
}
/* Highlight the currently hovered link */
.toc-link:hover {
@apply bg-blue-100 dark:bg-blue-900;
@apply bg-indigo-100 dark:bg-indigo-800;
opacity: 1 !important;
transform: scale(1.1);
@@ -112,7 +112,7 @@
width: 12px;
height: 12px;
@apply bg-slate-400 dark:bg-slate-500;
@apply bg-indigo-300 dark:bg-indigo-600;
}
/* Larger dots on mobile for better visibility */
@@ -126,53 +126,53 @@
/* Hover effects for dots */
.toc-list:hover .toc-link::before {
/* Dim all dots when hovering over the list */
@apply bg-slate-300 dark:bg-slate-600;
@apply bg-indigo-200 dark:bg-indigo-700;
opacity: 0.6;
}
.toc-list:hover .toc-link.read::before {
/* Dim read dots */
@apply bg-emerald-400;
@apply bg-indigo-400;
opacity: 0.6;
}
.toc-list:hover .toc-link.active::before {
/* Dim active dots */
@apply bg-emerald-600;
@apply bg-indigo-600;
opacity: 0.6;
}
/* Highlight the currently hovered dot */
.toc-link:hover::before {
@apply bg-slate-700 dark:bg-slate-200;
@apply bg-indigo-700 dark:bg-indigo-200;
opacity: 1 !important;
transform: scale(1.2);
box-shadow: 0 0 0 3px rgb(59 130 246 / 30%);
box-shadow: 0 0 0 3px rgb(99 102 241 / 30%);
}
.toc-link.read:hover::before {
@apply bg-emerald-700;
@apply bg-indigo-700;
opacity: 1 !important;
transform: scale(1.2);
box-shadow: 0 0 0 3px rgb(16 185 129 / 30%);
box-shadow: 0 0 0 3px rgb(99 102 241 / 30%);
}
.toc-link.active:hover::before {
@apply bg-emerald-800;
@apply bg-indigo-800;
opacity: 1 !important;
transform: scale(1.2);
box-shadow: 0 0 0 3px rgb(16 185 129 / 40%);
box-shadow: 0 0 0 3px rgb(99 102 241 / 40%);
}
/* Active state */
.toc-link.active::before {
@apply bg-emerald-700 ring-2 ring-emerald-300;
@apply bg-indigo-700 ring-2 ring-indigo-300;
}
/* Tooltip - show all when any link is hovered */
@@ -180,9 +180,9 @@
content: attr(data-tooltip);
@apply absolute top-1/2 -translate-y-1/2;
@apply rounded-lg bg-slate-600 px-3 py-2 text-xs text-white;
@apply rounded-lg bg-indigo-600 px-3 py-2 text-xs text-white;
@apply whitespace-nowrap shadow-lg;
@apply dark:bg-slate-600 dark:text-slate-300;
@apply dark:bg-indigo-700 dark:text-indigo-100;
/* Fixed position to the left of the timeline */
right: 44px;
@@ -218,8 +218,8 @@
/* Highlight the currently hovered tooltip */
.toc-link:hover::after {
@apply bg-slate-800 text-white;
@apply dark:bg-slate-700 dark:text-slate-100;
@apply bg-indigo-800 text-white;
@apply dark:bg-indigo-600 dark:text-indigo-50;
@apply font-medium;
transform: translateY(-50%) scale(1.05);
@@ -260,56 +260,56 @@
/* Semi-transparent timeline and dots */
.toc-list::before {
@apply bg-slate-300/60 dark:bg-slate-600/60;
@apply bg-indigo-200/60 dark:bg-indigo-700/60;
}
.toc-list::after {
@apply bg-gradient-to-b from-emerald-400/70 via-emerald-500/70 to-emerald-600/70;
@apply bg-gradient-to-b from-indigo-400/70 via-indigo-500/70 to-indigo-600/70;
}
.toc-link::before {
@apply bg-slate-400/70 dark:bg-slate-500/70;
@apply bg-indigo-300/70 dark:bg-indigo-600/70;
}
.toc-link.read::before {
@apply bg-emerald-500/80;
@apply bg-indigo-500/80;
}
.toc-link.active::before {
@apply bg-emerald-700/90;
@apply bg-indigo-700/90;
}
/* Full opacity when container is active */
.toc-container:active .toc-list::before,
.toc-container:hover .toc-list::before {
@apply bg-slate-300 dark:bg-slate-600;
@apply bg-indigo-200 dark:bg-indigo-700;
}
.toc-container:active .toc-list::after,
.toc-container:hover .toc-list::after {
@apply bg-gradient-to-b from-emerald-400 via-emerald-500 to-emerald-600;
@apply bg-gradient-to-b from-indigo-400 via-indigo-500 to-indigo-600;
}
.toc-container:active .toc-link::before,
.toc-container:hover .toc-link::before {
@apply bg-slate-400 dark:bg-slate-500;
@apply bg-indigo-300 dark:bg-indigo-600;
}
.toc-container:active .toc-link.read::before,
.toc-container:hover .toc-link.read::before {
@apply bg-emerald-500;
@apply bg-indigo-500;
}
.toc-container:active .toc-link.active::before,
.toc-container:hover .toc-link.active::before {
@apply bg-emerald-700;
@apply bg-indigo-700;
}
/* Better touch targets */
.toc-link {
-webkit-tap-highlight-color: rgb(59 130 246 / 30%);
-webkit-tap-highlight-color: rgb(99 102 241 / 30%);
/* stylelint-disable-next-line property-no-unknown */
tap-highlight-color: rgb(59 130 246 / 30%);
tap-highlight-color: rgb(99 102 241 / 30%);
}
/* Show tooltips on touch for mobile */
+29 -34
View File
@@ -14,6 +14,8 @@
@import "components/search.css";
@import "components/toc.css";
@import "components/pagination.css";
@import "components/navbar.css";
@import "components/social-buttons.css";
@import "components/common.css";
@@ -32,23 +34,6 @@ html.scrollbar {
color-scheme: dark;
}
/* Restrict changes to mouse users */
@media (pointer: fine) {
::-webkit-scrollbar {
@apply bg-slate-200 w-2 h-2 rounded-lg
}
::-webkit-scrollbar-thumb {
@apply bg-slate-300 rounded-lg
}
:root.dark ::-webkit-scrollbar {
@apply bg-slate-700
}
:root.dark ::-webkit-scrollbar-thumb {
@apply bg-slate-500
}
}
.max-container {
max-width: 1320px;
@apply mx-auto p-3;
@@ -115,16 +100,16 @@ html.scrollbar {
}
.mdLayout .h2-wrap > h2 {
@apply text-emerald-500 pr-2;
@apply text-indigo-600 pr-2;
@apply dark:text-slate-300;
}
.mdLayout .h2-wrap > h2 > a.h-anchor {
@apply text-emerald-500 pr-2;
@apply text-indigo-600 pr-2;
}
.mdLayout .h2-wrap > h2 > a.h-anchor:hover {
@apply text-emerald-600 no-underline cursor-pointer;
@apply text-indigo-700 no-underline cursor-pointer;
}
/** Grid layout. */
@@ -167,8 +152,9 @@ html.scrollbar {
}
.mdLayout .h2-wrap.boxed, .mdLayout .h3-wrap.boxed {
box-shadow: 0 0 0 1.6pt #10b981;
box-shadow: 0 0 0 1.6pt #6366f1;
transition: box-shadow 0.4s ease-in-out;
padding: 4px;
}
.mdLayout .h3-wrap.primary.boxed {
@@ -180,7 +166,8 @@ html.scrollbar {
}
.mdLayout .h3-wrap > h3 {
@apply bg-emerald-500 shadow text-white px-3 py-1 tracking-wider text-xs absolute right-0 top-0 rounded-bl-lg z-10;
opacity: 0.9;
@apply bg-gradient-to-r from-indigo-500 to-purple-600 shadow text-white px-3 py-1 tracking-wider text-xs absolute right-0 top-0 rounded-bl-lg z-10;
@apply dark:bg-opacity-70 dark:text-slate-200;
}
@@ -238,12 +225,12 @@ html.scrollbar {
text-decoration: none;
border-bottom: solid 1px rgba(85, 102, 119, 0.18);
@apply dark:text-slate-500;
@apply hover:underline hover:decoration-emerald-500 hover:underline-offset-2 hover:decoration-1;
@apply hover:underline hover:decoration-indigo-500 hover:underline-offset-2 hover:decoration-1;
}
.mdLayout .h3-wrap > .section p a:hover,
.intro p a:hover {
@apply text-emerald-500;
@apply text-indigo-600;
}
@@ -291,7 +278,7 @@ html.scrollbar {
background-size: 100% 6px;
background-repeat: repeat-x;
@apply dark:text-sky-600;
@apply hover:underline hover:decoration-emerald-500 hover:underline-offset-4 hover:decoration-2;
@apply hover:underline hover:decoration-indigo-500 hover:underline-offset-4 hover:decoration-2;
}
.mdLayout em, .mdLayout sup, .mdLayout sub {
@@ -319,13 +306,13 @@ html.scrollbar {
.mdLayout .local-anchor:target, .mdLayout :target > .local-anchor {
opacity: 1;
@apply text-emerald-500;
@apply text-indigo-500;
}
.mdLayout .local-anchor:hover, .mdLayout .local-anchor:focus {
opacity: 1;
text-decoration: inherit;
@apply text-white bg-emerald-500;
@apply text-white bg-indigo-500;
}
/* Crosslink (eg, phoenix.md) */
@@ -336,12 +323,12 @@ html.scrollbar {
.mdLayout.mdLayout p.link-arrow > a {
box-shadow: none;
text-decoration: none;
@apply text-emerald-500 block -mx-5 -my-3 p-3 border-0 text-center;
@apply hover:text-emerald-300 hover:bg-slate-200;
@apply text-indigo-500 block -mx-5 -my-3 p-3 border-0 text-center;
@apply hover:text-indigo-300 hover:bg-slate-200;
}
.mdLayout.mdLayout p.link-arrow > a:visited {
@apply text-emerald-500;
@apply text-indigo-500;
}
.mdLayout.mdLayout p.link-arrow > a::before {
@@ -356,17 +343,25 @@ html.scrollbar {
height: 32px;
line-height: 32px;
border-radius: 50%;
@apply bg-emerald-500;
@apply bg-indigo-500;
}
.mdLayout.mdLayout p.link-arrow > a::before, .mdLayout.mdLayout p.link-arrow > a:visited::before {
@apply text-emerald-400 text-white;
@apply text-indigo-400 text-white;
}
.mdLayout.mdLayout p.link-arrow > a:hover, .mdLayout.mdLayout p.link-arrow > a:focus {
@apply text-emerald-500;
@apply text-indigo-500;
}
.mdLayout.mdLayout p.link-arrow > a:hover::before, .mdLayout.mdLayout p.link-arrow > a:focus::before {
@apply bg-emerald-500;
@apply bg-indigo-500;
}
/* IMPORTANT: Override any conflicting header.home styles */
header.home {
position: relative !important; /* Force relative positioning */
top: auto !important;
left: auto !important;
right: auto !important;
}
+270 -4
View File
@@ -237,7 +237,273 @@ const Utils = (function () {
}
})();
// Share Dropdown Functionality with Portal Positioning
function initShareDropdown() {
const shareDropdown = document.getElementById('share-dropdown');
const shareTrigger = document.getElementById('share-trigger');
const shareMenu = document.getElementById('share-menu');
if (!shareDropdown || !shareTrigger || !shareMenu) return;
// Toggle dropdown
shareTrigger.addEventListener('click', (e) => {
e.preventDefault();
e.stopPropagation();
const isOpen = shareTrigger.getAttribute('aria-expanded') === 'true';
if (isOpen) {
closeShareDropdown();
} else {
openShareDropdown();
}
});
// Close dropdown when clicking outside
document.addEventListener('click', (e) => {
if (!shareDropdown.contains(e.target) && !shareMenu.contains(e.target)) {
closeShareDropdown();
}
});
// Close dropdown on escape key
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
closeShareDropdown();
}
});
// Update position on scroll and resize
function updatePosition() {
if (shareTrigger.getAttribute('aria-expanded') === 'true') {
positionDropdown();
}
}
window.addEventListener('scroll', updatePosition);
window.addEventListener('resize', updatePosition);
function positionDropdown() {
const triggerRect = shareTrigger.getBoundingClientRect();
const menuWidth = 224; // w-56 = 14rem = 224px
const spacing = 8; // mt-2 = 0.5rem = 8px
// Calculate position
let left = triggerRect.right - menuWidth;
let top = triggerRect.bottom + spacing;
// Ensure menu doesn't go off screen
const viewportWidth = window.innerWidth;
const viewportHeight = window.innerHeight;
if (left < 8) {
left = 8;
}
if (left + menuWidth > viewportWidth - 8) {
left = viewportWidth - menuWidth - 8;
}
// Check if there's enough space below, otherwise show above
if (top + 300 > viewportHeight) {
// Approximate menu height
top = triggerRect.top - 300 - spacing;
}
shareMenu.style.left = `${left}px`;
shareMenu.style.top = `${top}px`;
}
function openShareDropdown() {
shareTrigger.setAttribute('aria-expanded', 'true');
// Position the dropdown
positionDropdown();
// Enable pointer events and show menu
shareMenu.style.pointerEvents = 'auto';
shareMenu.classList.remove('opacity-0', 'invisible', 'scale-95');
shareMenu.classList.add('opacity-100', 'visible', 'scale-100');
}
function closeShareDropdown() {
shareTrigger.setAttribute('aria-expanded', 'false');
shareMenu.style.pointerEvents = 'none';
shareMenu.classList.remove('opacity-100', 'visible', 'scale-100');
shareMenu.classList.add('opacity-0', 'invisible', 'scale-95');
}
}
// Share Functions
function shareOnX() {
const url = encodeURIComponent(window.location.href);
const text = encodeURIComponent(document.title);
window.open(`https://x.com/intent/tweet?text=${text}&url=${url}`, '_blank');
}
function shareOnFacebook() {
const url = encodeURIComponent(window.location.href);
window.open(`https://facebook.com/sharer/sharer.php?u=${url}`, '_blank');
}
function shareOnReddit() {
const url = encodeURIComponent(window.location.href);
const title = encodeURIComponent(document.title);
window.open(`https://reddit.com/submit/?url=${url}&resubmit=true&title=${title}`, '_blank');
}
function shareOnPinterest() {
const url = encodeURIComponent(window.location.href);
const description = encodeURIComponent(document.title);
window.open(
`https://pinterest.com/pin/create/button/?url=${url}&description=${description}`,
'_blank'
);
}
function shareOnLinkedIn() {
const url = encodeURIComponent(window.location.href);
const title = encodeURIComponent(document.title);
window.open(`https://www.linkedin.com/shareArticle?url=${url}&title=${title}`, '_blank');
}
function shareOnLine() {
const url = encodeURIComponent(window.location.href);
window.open(`https://social-plugins.line.me/lineit/share?url=${url}`, '_blank');
}
function shareViaEmail() {
const url = encodeURIComponent(window.location.href);
const title = encodeURIComponent(document.title);
window.location.href = `mailto:?subject=${title}&body=${url}`;
}
// Copy to clipboard function
function copyToClipboard() {
const url = window.location.href;
if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard
.writeText(url)
.then(() => {
showCopyNotification('Link copied to clipboard!');
})
.catch(() => {
fallbackCopyToClipboard(url);
});
} else {
fallbackCopyToClipboard(url);
}
}
function fallbackCopyToClipboard(text) {
const textArea = document.createElement('textarea');
textArea.value = text;
textArea.style.position = 'fixed';
textArea.style.left = '-999999px';
textArea.style.top = '-999999px';
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
document.execCommand('copy');
showCopyNotification('Link copied to clipboard!');
} catch (err) {
showCopyNotification('Failed to copy link');
}
document.body.removeChild(textArea);
}
function showCopyNotification(message) {
// Create notification element
const notification = document.createElement('div');
notification.className =
'fixed top-4 right-4 bg-green-500 text-white px-4 py-2 rounded-lg shadow-lg z-50 transform translate-x-full transition-transform duration-300';
notification.textContent = message;
document.body.appendChild(notification);
// Animate in
setTimeout(() => {
notification.classList.remove('translate-x-full');
}, 100);
// Animate out and remove
setTimeout(() => {
notification.classList.add('translate-x-full');
setTimeout(() => {
document.body.removeChild(notification);
}, 300);
}, 2000);
}
// GitHub Stars Functionality
async function fetchGitHubStars() {
// Find all GitHub stars elements (support multiple variants)
const starsElements = document.querySelectorAll('[id^="github-stars"]');
if (starsElements.length === 0) return;
try {
// Try to get from cache first
const cached = localStorage.getItem('github-stars');
const cacheTime = localStorage.getItem('github-stars-time');
const now = Date.now();
// Use cache if it's less than 5 minutes old
if (cached && cacheTime && now - parseInt(cacheTime) < 5 * 60 * 1000) {
starsElements.forEach((element) => {
element.innerHTML = formatStarCount(parseInt(cached));
});
return;
}
// Fetch from GitHub API
const response = await fetch('https://api.github.com/repos/Fechin/reference');
if (!response.ok) throw new Error('Failed to fetch');
const data = await response.json();
const stars = data.stargazers_count;
// Cache the result
localStorage.setItem('github-stars', stars.toString());
localStorage.setItem('github-stars-time', now.toString());
// Update UI with animation
starsElements.forEach((element) => {
element.innerHTML = formatStarCount(stars);
element.classList.add('animate-pulse');
setTimeout(() => {
element.classList.remove('animate-pulse');
}, 1000);
});
} catch (error) {
console.warn('Failed to fetch GitHub stars:', error);
// Fallback to cached value or default
const cached = localStorage.getItem('github-stars');
const fallbackValue = cached ? formatStarCount(parseInt(cached)) : '6.5k';
starsElements.forEach((element) => {
element.innerHTML = fallbackValue;
});
}
}
function formatStarCount(count) {
if (count >= 1000) {
return (count / 1000).toFixed(1) + 'k';
}
return count.toString();
}
window.addEventListener('load', () => {
// Initialize share dropdown
initShareDropdown();
// Fetch GitHub stars
fetchGitHubStars();
// Dark mode functionality
const isDarkMode = document.documentElement.classList.contains('dark');
if (!isDarkMode) {
const icon = document.querySelector('#darkMode > i').classList;
@@ -602,9 +868,9 @@ window.addEventListener('load', () => {
const tagStr = tags.join("<span class='text-slate-300 px-1'>•</span>");
let tagsHTML = '';
if (tagStr !== '') {
tagsHTML = `<div class="w-px h-3 bg-slate-300 mr-2"></div><span class="mr-2">${tagStr}</span>`;
tagsHTML = `<div class="w-px h-3 bg-indigo-300 mr-2"></div><span class="mr-2">${tagStr}</span>`;
}
liHtml += `<li class="group ${activeStr} m-3 fadeIn" data-index="${itemIndex}">
liHtml += `<li class="group ${activeStr} m-3" data-index="${itemIndex}">
<a href="${hit.path}" class="flex justify-between items-center rounded-lg py-1 px-4 transition-colors duration-100 ease-in-out overflow-hidden">
<div class="flex items-start">
<div class="flex justify-center items-center w-5 mr-5 mt-2 flex-none">
@@ -642,7 +908,7 @@ window.addEventListener('load', () => {
let h3HTML = '';
section.h3.forEach((h3) => {
const anchor = hit.path + h3.anchor;
h3HTML += `<a href="${anchor}" class="inline-block mr-1 px-2 p-0.5 transition duration-200 ease-in-out rounded-full hover:bg-emerald-500 text-slate-500 dark:text-slate-300 hover:text-slate-50">${h3.title.toLowerCase()}</a>`;
h3HTML += `<a href="${anchor}" class="inline-block mr-1 px-2 p-0.5 transition duration-200 ease-in-out rounded-full hover:bg-indigo-500 text-slate-500 dark:text-slate-300 hover:text-slate-50">${h3.title.toLowerCase()}</a>`;
});
const anchor = hit.path + section.h2.anchor;
olInnerHtml += `<li class="text-slate-700 dark:text-slate-300 hover:underline hover:text-slate-900 mt-3 mb-2">
@@ -653,7 +919,7 @@ window.addEventListener('load', () => {
document.querySelector('.preview-panel').innerHTML = `<section class="w-full py-3 px-5">
<div class="flex justify-center pt-1 pb-4">
<div class="flex justify-center items-center w-8 h-8 rounded ${hit.background === undefined ? 'bg-emerald-500' : hit.background} shadow-lg">
<div class="flex justify-center items-center w-8 h-8 rounded ${hit.background === undefined ? 'bg-indigo-500' : hit.background} shadow-lg">
<i class="text-2xl text-slate-100">${hit.icon}</i>
</div>
</div>