Skip to content

Commit a3c21b4

Browse files
committed
fix: lint
1 parent 0014761 commit a3c21b4

29 files changed

Lines changed: 698 additions & 828 deletions

File tree

‎biome.json‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616
"!**/vendor",
1717
"!**/*.html",
1818
"!**/layouts/**/*.html",
19-
"!**/layouts/**/*.htm",
2019
"!**/*.webmanifest",
2120
"!**/*.backlinks.json",
2221
"!**/hugo_stats.json",
2322
"!**/*.code-workspace",
2423
"!**/modules/blox/data/icons/devicon.json",
25-
"!**/templates",
24+
"!**/templates/**/*.html",
2625
"!**/test",
2726
"!**/modules/**/package.json",
2827
"!**/assets/jsconfig.json",
@@ -64,7 +63,13 @@
6463
}
6564
}
6665
},
67-
"assist": { "actions": { "source": { "organizeImports": "on" } } },
66+
"assist": {
67+
"actions": {
68+
"source": {
69+
"organizeImports": "on"
70+
}
71+
}
72+
},
6873
"css": {
6974
"parser": {
7075
"tailwindDirectives": true

‎modules/blox/assets/css/blox/biography.css‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,20 @@
9090
line-height: 1.2;
9191

9292
/* Subtle gradient text for premium feel */
93-
background: linear-gradient(135deg,
94-
var(--color-gray-500) 0%,
95-
var(--color-gray-400) 100%);
93+
background: linear-gradient(135deg, var(--color-gray-500) 0%, var(--color-gray-400) 100%);
9694
-webkit-background-clip: text;
9795
background-clip: text;
9896
-webkit-text-fill-color: transparent;
9997

10098
/* Smooth reveal animation */
10199
opacity: 0.85;
102-
transition: opacity 0.3s ease, transform 0.3s ease;
100+
transition:
101+
opacity 0.3s ease,
102+
transform 0.3s ease;
103103
}
104104

105105
.dark .hb-ruby-name rt {
106-
background: linear-gradient(135deg,
107-
var(--color-gray-400) 0%,
108-
var(--color-gray-300) 100%);
106+
background: linear-gradient(135deg, var(--color-gray-400) 0%, var(--color-gray-300) 100%);
109107
-webkit-background-clip: text;
110108
background-clip: text;
111109
-webkit-text-fill-color: transparent;
@@ -280,4 +278,4 @@
280278
background-image:
281279
radial-gradient(at 20% 25%, hsla(212, 35%, 15%, 1) 0px, transparent 50%), radial-gradient(at 75% 30%, hsla(160, 35%, 15%, 1) 0px, transparent 50%),
282280
radial-gradient(at 25% 80%, hsla(280, 35%, 15%, 1) 0px, transparent 50%), radial-gradient(at 75% 85%, hsla(30, 35%, 15%, 1) 0px, transparent 50%);
283-
}
281+
}
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
import { render } from "preact";
2-
import { CtaCardBlock } from "./component.jsx";
1+
import {render} from "preact";
2+
import {CtaCardBlock} from "./component.jsx";
33

44
function renderCtaCardBlock() {
5-
const blocks = document.querySelectorAll('.cta-card-block-container[data-preact-render="true"]');
5+
const blocks = document.querySelectorAll('.cta-card-block-container[data-preact-render="true"]');
66

7-
blocks.forEach((block) => {
8-
try {
9-
if (block.dataset.rendered === "true") return;
7+
blocks.forEach((block) => {
8+
try {
9+
if (block.dataset.rendered === "true") return;
1010

11-
const props = JSON.parse(block.dataset.props);
12-
render(<CtaCardBlock {...props} />, block);
13-
block.dataset.rendered = "true";
14-
} catch (e) {
15-
console.error("Error rendering CTA Card Block:", e, block);
16-
}
17-
});
11+
const props = JSON.parse(block.dataset.props);
12+
render(<CtaCardBlock {...props} />, block);
13+
block.dataset.rendered = "true";
14+
} catch (e) {
15+
console.error("Error rendering CTA Card Block:", e, block);
16+
}
17+
});
1818
}
1919

2020
// Initial render
2121
if (document.readyState === "loading") {
22-
document.addEventListener("DOMContentLoaded", renderCtaCardBlock);
22+
document.addEventListener("DOMContentLoaded", renderCtaCardBlock);
2323
} else {
24-
renderCtaCardBlock();
24+
renderCtaCardBlock();
2525
}

‎modules/blox/blox/cta-card/component.jsx‎

Lines changed: 111 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -4,125 +4,125 @@
44
* Supports glassmorphism, custom backgrounds, and automatic text color adjustment.
55
*/
66

7-
import { Icon } from "../../shared/components/Icon.jsx";
7+
import {Icon} from "../../shared/components/Icon.jsx";
88

99
// Simple markdown renderer
1010
function renderText(text) {
11-
if (!text) return "";
12-
return String(text)
13-
.replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>")
14-
.replace(/\*(.*?)\*/g, "<em>$1</em>")
15-
.replace(/`(.*?)`/g, "<code>$1</code>")
16-
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2">$1</a>');
11+
if (!text) return "";
12+
return String(text)
13+
.replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>")
14+
.replace(/\*(.*?)\*/g, "<em>$1</em>")
15+
.replace(/`(.*?)`/g, "<code>$1</code>")
16+
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2">$1</a>');
1717
}
1818

19-
export const CtaCardBlock = ({ content, design, id, button_icon_svg }) => {
20-
const card = design?.card || {};
21-
const cardClass = card.css_class || "";
22-
const cardStyle = card.css_style || "";
23-
24-
// Overlay Opacity Logic
25-
let overlayOpacity = 0.15;
26-
if (card.overlay_opacity !== undefined) {
27-
const val = parseFloat(card.overlay_opacity);
28-
if (!isNaN(val)) overlayOpacity = Math.max(0, Math.min(1, val));
29-
}
30-
31-
// Text Color Logic
32-
let textColorMode = "auto";
33-
if (["light", "dark", "auto"].includes(card.text_color?.toLowerCase())) {
34-
textColorMode = card.text_color.toLowerCase();
35-
}
36-
37-
let textClasses = "text-gray-900 dark:text-white";
38-
let buttonClasses = "text-gray-900 dark:text-gray-100";
39-
40-
// Auto-detect based on background gradient
41-
const bg = design?.background || {};
42-
const gradientStart = bg.gradient?.start || "";
43-
const isDarkBg = ["primary-7", "primary-8", "primary-9", "secondary-7", "secondary-8", "secondary-9"].some(p => gradientStart.startsWith(p));
44-
45-
if (textColorMode === "light") {
46-
textClasses = "text-white";
47-
buttonClasses = "text-gray-900 dark:text-white";
48-
} else if (textColorMode === "dark") {
49-
textClasses = "text-gray-900 dark:text-white";
50-
buttonClasses = "text-gray-900 dark:text-white";
51-
} else if (isDarkBg) {
52-
textClasses = "text-white";
53-
buttonClasses = "text-gray-900";
54-
}
55-
56-
// Button Logic
57-
const button = content?.button || {};
58-
const buttonText = button.text?.trim();
59-
const buttonUrl = button.url?.trim();
60-
const showButton = !!(buttonText && buttonUrl);
61-
62-
let isExternal = false;
63-
let isNewTab = button.new_tab === true;
64-
if (buttonUrl) {
65-
try {
66-
const url = new URL(buttonUrl, window.location.origin);
67-
isExternal = url.origin !== window.location.origin;
68-
} catch {
69-
isExternal = /^https?:\/\//.test(buttonUrl);
70-
}
71-
if (buttonUrl.endsWith(".pdf")) isNewTab = true;
72-
if (isExternal) isNewTab = true;
19+
export const CtaCardBlock = ({content, design, _id, button_icon_svg}) => {
20+
const card = design?.card || {};
21+
const cardClass = card.css_class || "";
22+
const cardStyle = card.css_style || "";
23+
24+
// Overlay Opacity Logic
25+
let overlayOpacity = 0.15;
26+
if (card.overlay_opacity !== undefined) {
27+
const val = parseFloat(card.overlay_opacity);
28+
if (!Number.isNaN(val)) overlayOpacity = Math.max(0, Math.min(1, val));
29+
}
30+
31+
// Text Color Logic
32+
let textColorMode = "auto";
33+
if (["light", "dark", "auto"].includes(card.text_color?.toLowerCase())) {
34+
textColorMode = card.text_color.toLowerCase();
35+
}
36+
37+
let textClasses = "text-gray-900 dark:text-white";
38+
let buttonClasses = "text-gray-900 dark:text-gray-100";
39+
40+
// Auto-detect based on background gradient
41+
const bg = design?.background || {};
42+
const gradientStart = bg.gradient?.start || "";
43+
const isDarkBg = ["primary-7", "primary-8", "primary-9", "secondary-7", "secondary-8", "secondary-9"].some((p) => gradientStart.startsWith(p));
44+
45+
if (textColorMode === "light") {
46+
textClasses = "text-white";
47+
buttonClasses = "text-gray-900 dark:text-white";
48+
} else if (textColorMode === "dark") {
49+
textClasses = "text-gray-900 dark:text-white";
50+
buttonClasses = "text-gray-900 dark:text-white";
51+
} else if (isDarkBg) {
52+
textClasses = "text-white";
53+
buttonClasses = "text-gray-900";
54+
}
55+
56+
// Button Logic
57+
const button = content?.button || {};
58+
const buttonText = button.text?.trim();
59+
const buttonUrl = button.url?.trim();
60+
const showButton = !!(buttonText && buttonUrl);
61+
62+
let isExternal = false;
63+
let isNewTab = button.new_tab === true;
64+
if (buttonUrl) {
65+
try {
66+
const url = new URL(buttonUrl, window.location.origin);
67+
isExternal = url.origin !== window.location.origin;
68+
} catch {
69+
isExternal = /^https?:\/\//.test(buttonUrl);
7370
}
74-
75-
const defaultBgClass = "bg-gradient-to-br from-primary-500/90 via-primary-600/95 to-primary-700/90";
76-
const finalCardClass = cardClass || defaultBgClass;
77-
78-
const style = `--glassmorphism-opacity: ${overlayOpacity}; ${cardStyle}`;
79-
80-
return (
71+
if (buttonUrl.endsWith(".pdf")) isNewTab = true;
72+
if (isExternal) isNewTab = true;
73+
}
74+
75+
const defaultBgClass = "bg-gradient-to-br from-primary-500/90 via-primary-600/95 to-primary-700/90";
76+
const finalCardClass = cardClass || defaultBgClass;
77+
78+
const style = `--glassmorphism-opacity: ${overlayOpacity}; ${cardStyle}`;
79+
80+
return (
81+
<div
82+
class={`relative overflow-hidden ${finalCardClass} p-8 sm:p-12 lg:p-16 xl:p-20 mx-auto max-w-6xl rounded-3xl shadow-2xl flex flex-col items-center text-center`}
83+
style={style}
84+
>
85+
{/* Title */}
86+
{content.title && (
87+
<h2
88+
class={`${textClasses} text-4xl sm:text-5xl lg:text-6xl xl:text-7xl font-bold tracking-tight leading-tight`}
89+
dangerouslySetInnerHTML={{__html: renderText(content.title)}}
90+
/>
91+
)}
92+
93+
{/* Text */}
94+
{content.text && (
8195
<div
82-
class={`relative overflow-hidden ${finalCardClass} p-8 sm:p-12 lg:p-16 xl:p-20 mx-auto max-w-6xl rounded-3xl shadow-2xl flex flex-col items-center text-center`}
83-
style={style}
84-
>
85-
{/* Title */}
86-
{content.title && (
87-
<h2
88-
class={`${textClasses} text-4xl sm:text-5xl lg:text-6xl xl:text-7xl font-bold tracking-tight leading-tight`}
89-
dangerouslySetInnerHTML={{ __html: renderText(content.title) }}
90-
/>
96+
class={`${textClasses}/80 mt-6 text-lg sm:text-xl lg:text-2xl max-w-3xl leading-relaxed font-light`}
97+
dangerouslySetInnerHTML={{__html: renderText(content.text)}}
98+
/>
99+
)}
100+
101+
{/* Button */}
102+
{showButton && (
103+
<div class="flex mt-10">
104+
<a
105+
href={buttonUrl}
106+
target={isNewTab ? "_blank" : undefined}
107+
rel={isNewTab ? "noopener" : undefined}
108+
class={`group relative inline-flex items-center gap-3 px-8 py-4 text-lg font-semibold ${buttonClasses} transition-all duration-300 ease-out hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-500/50 dark:focus-visible:ring-white/50 focus-visible:ring-offset-2 focus-visible:ring-offset-transparent`}
109+
>
110+
{/* Glassmorphism Background */}
111+
<div class="absolute inset-0 bg-white/95 dark:bg-gray-900/95 backdrop-blur-md rounded-2xl ring-1 ring-gray-200/30 dark:ring-white/30 shadow-lg group-hover:bg-white dark:group-hover:bg-gray-800 group-hover:ring-gray-300/50 dark:group-hover:ring-white/50 group-hover:shadow-2xl transition-all duration-300"></div>
112+
113+
{/* Button Content */}
114+
<span class="relative z-10">{buttonText}</span>
115+
{button_icon_svg && (
116+
<span class="relative z-10 transition-transform duration-300 group-hover:translate-x-1">
117+
<Icon svg={button_icon_svg} attributes={{style: "height: 1.25em", class: "inline-block"}} />
118+
</span>
91119
)}
92120

93-
{/* Text */}
94-
{content.text && (
95-
<div
96-
class={`${textClasses}/80 mt-6 text-lg sm:text-xl lg:text-2xl max-w-3xl leading-relaxed font-light`}
97-
dangerouslySetInnerHTML={{ __html: renderText(content.text) }}
98-
/>
99-
)}
100-
101-
{/* Button */}
102-
{showButton && (
103-
<div class="flex mt-10">
104-
<a
105-
href={buttonUrl}
106-
target={isNewTab ? "_blank" : undefined}
107-
rel={isNewTab ? "noopener" : undefined}
108-
class={`group relative inline-flex items-center gap-3 px-8 py-4 text-lg font-semibold ${buttonClasses} transition-all duration-300 ease-out hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-500/50 dark:focus-visible:ring-white/50 focus-visible:ring-offset-2 focus-visible:ring-offset-transparent`}
109-
>
110-
{/* Glassmorphism Background */}
111-
<div class="absolute inset-0 bg-white/95 dark:bg-gray-900/95 backdrop-blur-md rounded-2xl ring-1 ring-gray-200/30 dark:ring-white/30 shadow-lg group-hover:bg-white dark:group-hover:bg-gray-800 group-hover:ring-gray-300/50 dark:group-hover:ring-white/50 group-hover:shadow-2xl transition-all duration-300"></div>
112-
113-
{/* Button Content */}
114-
<span class="relative z-10">{buttonText}</span>
115-
{button_icon_svg && (
116-
<span class="relative z-10 transition-transform duration-300 group-hover:translate-x-1">
117-
<Icon svg={button_icon_svg} attributes={{ style: "height: 1.25em", class: "inline-block" }} />
118-
</span>
119-
)}
120-
121-
{/* Glow Effect */}
122-
<div class="absolute inset-0 bg-white/20 dark:bg-white/10 rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 blur-xl"></div>
123-
</a>
124-
</div>
125-
)}
121+
{/* Glow Effect */}
122+
<div class="absolute inset-0 bg-white/20 dark:bg-white/10 rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 blur-xl"></div>
123+
</a>
126124
</div>
127-
);
125+
)}
126+
</div>
127+
);
128128
};

‎modules/blox/blox/cta-image-paragraph/client.jsx‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
* CTA Image Paragraph Block - Client-side Hydration
33
*/
44

5-
import { render } from "preact";
6-
import { CtaImageParagraphBlock } from "./component.jsx";
5+
import {render} from "preact";
6+
import {CtaImageParagraphBlock} from "./component.jsx";
77

88
function renderCtaImageParagraphBlocks() {
9-
const blocks = document.querySelectorAll('[data-block-type="cta-image-paragraph"]');
9+
const blocks = document.querySelectorAll('[data-block-type="cta-image-paragraph"]');
1010

11-
blocks.forEach((block) => {
12-
const propsData = block.dataset.props;
13-
if (propsData) {
14-
try {
15-
const props = JSON.parse(propsData);
16-
render(<CtaImageParagraphBlock {...props} />, block);
17-
console.debug(`✓ CTA Image Paragraph block "${block.id}" rendered with Preact`);
18-
} catch (error) {
19-
console.error(`Failed to render CTA Image Paragraph block "${block.id}":`, error);
20-
}
21-
}
22-
});
11+
blocks.forEach((block) => {
12+
const propsData = block.dataset.props;
13+
if (propsData) {
14+
try {
15+
const props = JSON.parse(propsData);
16+
render(<CtaImageParagraphBlock {...props} />, block);
17+
console.debug(`✓ CTA Image Paragraph block "${block.id}" rendered with Preact`);
18+
} catch (error) {
19+
console.error(`Failed to render CTA Image Paragraph block "${block.id}":`, error);
20+
}
21+
}
22+
});
2323
}
2424

2525
renderCtaImageParagraphBlocks();

0 commit comments

Comments
 (0)