Skip to content

Commit 8038549

Browse files
authored
Merge pull request #57 from RohitLakh/rebrand-daily-challenge-to-scale-engineer
feat: update embed from hw.glich.co to scaleengineer.com
2 parents 83f1e54 + 970a2d3 commit 8038549

26 files changed

Lines changed: 117 additions & 1402 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"use client";
2+
import { useEffect, useState } from "react";
3+
4+
const DailyDSAEmbed = ({ mobile = false, theme = "light" }) => {
5+
const src = `https://scaleengineer.com/embed/daily/dsa?theme=${theme}`;
6+
const wrapperClasses = mobile
7+
? "block md:hidden w-full"
8+
: "max-w-full hidden md:block";
9+
const height = mobile ? 200 : 280;
10+
11+
return (
12+
<div className={wrapperClasses}>
13+
<div className="max-w-full mb-4">
14+
<a
15+
href="https://scaleengineer.com/daily"
16+
target="_blank"
17+
rel="noopener noreferrer"
18+
className="mb-2 inline-block text-[#737373] no-underline"
19+
style={{
20+
font: "500 12px/1.4 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif",
21+
}}
22+
>
23+
Daily DSA Challenge by{" "}
24+
<span className="text-[#0a0a0a] underline underline-offset-[3px]">
25+
Scale Engineer
26+
</span>
27+
</a>
28+
<iframe
29+
src={src}
30+
width="100%"
31+
height={height}
32+
className="border border-black border-dashed rounded-none overflow-hidden"
33+
title="Daily DSA Challenge"
34+
loading="lazy"
35+
></iframe>
36+
</div>
37+
</div>
38+
);
39+
};
40+
41+
export default DailyDSAEmbed;

app/visualizer/queue/implementation/array/content.jsx

Lines changed: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
"use client";
22
import { useEffect, useState } from "react";
3+
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
34

45
const content = () => {
56
const [theme, setTheme] = useState("light");
6-
const [mounted, setMounted] = useState(false);
7-
87
useEffect(() => {
98
const updateTheme = () => {
109
const savedTheme = localStorage.getItem("theme") || "light";
1110
setTheme(savedTheme);
1211
};
1312

1413
updateTheme();
15-
setMounted(true);
1614

1715
window.addEventListener("storage", updateTheme);
1816
window.addEventListener("themeChange", updateTheme);
@@ -96,35 +94,8 @@ const content = () => {
9694

9795
return (
9896
<main className="max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-5 md:gap-4">
99-
<div className="col-span-1">
100-
<div className="hidden md:block">
101-
{mounted && (
102-
<iframe
103-
key={theme}
104-
src={
105-
theme === "dark"
106-
? "https://hw.glich.co/resources/embed/daily/dsa?theme=dark"
107-
: "https://hw.glich.co/resources/embed/daily/dsa?theme=light"
108-
}
109-
width="100%"
110-
height="400"
111-
title="Daily DSA Challenge"
112-
></iframe>
113-
)}
114-
</div>
115-
<div className="flex justify-center">
116-
<span className="text-xs hidden md:block">
117-
Daily DSA Challenge by{" "}
118-
<a
119-
href="https://hw.glich.co/resources/daily"
120-
target="_blank"
121-
className="underline hover:text-blue-500 duration-300"
122-
>
123-
Hello World
124-
</a>
125-
</span>
126-
</div>
127-
</div>
97+
98+
<DailyDSAEmbed mobile={false} theme={theme} />
12899
<article className="col-span-4 max-w-4xl bg-white dark:bg-neutral-950 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden mb-8">
129100
{/* Queue Array Implementation Overview */}
130101
<section className="p-6 border-b border-gray-100 dark:border-gray-700">
@@ -261,33 +232,7 @@ const content = () => {
261232
</article>
262233

263234
{/* Mobile iframe at bottom */}
264-
<div className="block md:hidden w-full">
265-
{mounted && (
266-
<iframe
267-
key={theme}
268-
src={
269-
theme === "dark"
270-
? "https://hw.glich.co/resources/embed/daily/dsa?theme=dark"
271-
: "https://hw.glich.co/resources/embed/daily/dsa?theme=light"
272-
}
273-
width="100%"
274-
height="320"
275-
title="Daily DSA Challenge"
276-
></iframe>
277-
)}
278-
<div className="flex justify-center pb-8">
279-
<span className="text-xs">
280-
Daily DSA Challenge by{" "}
281-
<a
282-
href="https://hw.glich.co/resources/daily"
283-
target="_blank"
284-
className="underline hover:text-blue-500 duration-300"
285-
>
286-
Hello World
287-
</a>
288-
</span>
289-
</div>
290-
</div>
235+
<DailyDSAEmbed mobile theme={theme} />
291236
</main>
292237
);
293238
};

app/visualizer/queue/implementation/linkedList/content.jsx

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
"use client";
22
import { useEffect, useState } from "react";
3+
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
34

45
const content = () => {
56
const [theme, setTheme] = useState("light");
6-
const [mounted, setMounted] = useState(false);
7-
87
useEffect(() => {
98
const updateTheme = () => {
109
const savedTheme = localStorage.getItem("theme") || "light";
1110
setTheme(savedTheme);
1211
};
1312

1413
updateTheme();
15-
setMounted(true);
1614

1715
window.addEventListener("storage", updateTheme);
1816
window.addEventListener("themeChange", updateTheme);
@@ -71,33 +69,7 @@ const content = () => {
7169
return (
7270
<main className="max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-5 md:gap-4">
7371
<div className="col-span-1">
74-
<div className="hidden md:block">
75-
{mounted && (
76-
<iframe
77-
key={theme}
78-
src={
79-
theme === "dark"
80-
? "https://hw.glich.co/resources/embed/daily/dsa?theme=dark"
81-
: "https://hw.glich.co/resources/embed/daily/dsa?theme=light"
82-
}
83-
width="100%"
84-
height="400"
85-
title="Daily DSA Challenge"
86-
></iframe>
87-
)}
88-
</div>
89-
<div className="flex justify-center">
90-
<span className="text-xs hidden md:block">
91-
Daily DSA Challenge by{" "}
92-
<a
93-
href="https://hw.glich.co/resources/daily"
94-
target="_blank"
95-
className="underline hover:text-blue-500 duration-300"
96-
>
97-
Hello World
98-
</a>
99-
</span>
100-
</div>
72+
<DailyDSAEmbed mobile={false} theme={theme} />
10173
</div>
10274
<article className="col-span-4 max-w-4xl bg-white dark:bg-neutral-950 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden mb-8">
10375
{/* Queue Linked List Implementation Overview */}
@@ -220,33 +192,7 @@ const content = () => {
220192
</article>
221193

222194
{/* Mobile iframe at bottom */}
223-
<div className="block md:hidden w-full">
224-
{mounted && (
225-
<iframe
226-
key={theme}
227-
src={
228-
theme === "dark"
229-
? "https://hw.glich.co/resources/embed/daily/dsa?theme=dark"
230-
: "https://hw.glich.co/resources/embed/daily/dsa?theme=light"
231-
}
232-
width="100%"
233-
height="320"
234-
title="Daily DSA Challenge"
235-
></iframe>
236-
)}
237-
<div className="flex justify-center pb-8">
238-
<span className="text-xs">
239-
Daily DSA Challenge by{" "}
240-
<a
241-
href="https://hw.glich.co/resources/daily"
242-
target="_blank"
243-
className="underline hover:text-blue-500 duration-300"
244-
>
245-
Hello World
246-
</a>
247-
</span>
248-
</div>
249-
</div>
195+
<DailyDSAEmbed mobile theme={theme} />
250196
</main>
251197
);
252198
};

app/visualizer/queue/operations/enqueue-dequeue/content.jsx

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
"use client";
22
import ComplexityGraph from "@/app/components/ui/graph";
33
import { useEffect, useState } from "react";
4+
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
45

56
const content = () => {
67
const [theme, setTheme] = useState('light');
7-
const [mounted, setMounted] = useState(false);
8-
98
useEffect(() => {
109
const updateTheme = () => {
1110
const savedTheme = localStorage.getItem('theme') || 'light';
1211
setTheme(savedTheme);
1312
};
1413

1514
updateTheme();
16-
setMounted(true);
1715

1816
window.addEventListener('storage', updateTheme);
1917
window.addEventListener('themeChange', updateTheme);
@@ -65,33 +63,7 @@ const content = () => {
6563
return (
6664
<main className="max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-5 md:gap-4">
6765
<div className="col-span-1">
68-
<div className="hidden md:block">
69-
{mounted && (
70-
<iframe
71-
key={theme}
72-
src={
73-
theme === "dark"
74-
? "https://hw.glich.co/resources/embed/daily/dsa?theme=dark"
75-
: "https://hw.glich.co/resources/embed/daily/dsa?theme=light"
76-
}
77-
width="100%"
78-
height="400"
79-
title="Daily DSA Challenge"
80-
></iframe>
81-
)}
82-
</div>
83-
<div className="flex justify-center">
84-
<span className="text-xs hidden md:block">
85-
Daily DSA Challenge by{" "}
86-
<a
87-
href="https://hw.glich.co/resources/daily"
88-
target="_blank"
89-
className="underline hover:text-blue-500 duration-300"
90-
>
91-
Hello World
92-
</a>
93-
</span>
94-
</div>
66+
<DailyDSAEmbed mobile={false} theme={theme} />
9567
</div>
9668
<article className="col-span-4 max-w-4xl bg-white dark:bg-neutral-950 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden mb-8">
9769
{/* What is a Queue? */}
@@ -249,33 +221,7 @@ const content = () => {
249221
</article>
250222

251223
{/* Mobile iframe at bottom */}
252-
<div className="block md:hidden w-full">
253-
{mounted && (
254-
<iframe
255-
key={theme}
256-
src={
257-
theme === "dark"
258-
? "https://hw.glich.co/resources/embed/daily/dsa?theme=dark"
259-
: "https://hw.glich.co/resources/embed/daily/dsa?theme=light"
260-
}
261-
width="100%"
262-
height="320"
263-
title="Daily DSA Challenge"
264-
></iframe>
265-
)}
266-
<div className="flex justify-center pb-8">
267-
<span className="text-xs">
268-
Daily DSA Challenge by{" "}
269-
<a
270-
href="https://hw.glich.co/resources/daily"
271-
target="_blank"
272-
className="underline hover:text-blue-500 duration-300"
273-
>
274-
Hello World
275-
</a>
276-
</span>
277-
</div>
278-
</div>
224+
<DailyDSAEmbed mobile theme={theme} />
279225
</main>
280226
);
281227
};

0 commit comments

Comments
 (0)