Skip to content

Commit 0f78bdf

Browse files
authored
Merge pull request #40 from devsdenepal/main
Add color logic
2 parents 68c609a + 44f3bcf commit 0f78bdf

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

src/data/courseData.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,62 @@
1+
const colors = [
2+
{ bg: '00BCD4', fg: 'ffffff' }, // Cyan
3+
{ bg: 'FF9800', fg: 'ffffff' }, // Orange
4+
{ bg: '8BC34A', fg: 'ffffff' }, // Green
5+
{ bg: '3F51B5', fg: 'ffffff' }, // Indigo
6+
{ bg: 'E91E63', fg: 'ffffff' }, // Pink
7+
];
8+
9+
const generateImageURL = (text, index) => {
10+
const { bg, fg } = colors[index % colors.length];
11+
return `https://dummyimage.com/600x400/${bg}/${fg}&text=${encodeURIComponent(text)}`;
12+
};
13+
114
const courses = {
215
'course 1: oh my zsh setup': {
316
title: 'Course 1: OH MY ZSH Setup',
417
author: 'Dev Gautam Kumar',
5-
image: 'https://dummyimage.com/600x400/00BCD4/fff&text=ZSH+Setup', // Cyan
18+
image: generateImageURL('ZSH Setup', 0),
619
description: 'Enhance your terminal experience with OH MY ZSH.',
720
embed_link: 'https://www.youtube.com/embed/dCdX5v3IU60',
821
contentFile: 'course1.md',
922
},
1023
'course 2: getting started with cli': {
1124
title: 'Course 2: Getting Started with CLI',
1225
author: 'Dev Gautam Kumar',
13-
image: 'https://dummyimage.com/600x400/FF9800/fff&text=CLI+PART+1', // Orange
26+
image: generateImageURL('CLI PART 1', 1),
1427
description: 'Kick your journey with CLI.',
1528
embed_link: 'https://www.youtube.com/embed/B4b9pX1lqU4',
1629
contentFile: 'course2.md',
1730
},
1831
'course 3: playing in the shell': {
1932
title: 'Course 3: Playing in the Shell',
2033
author: 'Dev Gautam Kumar',
21-
image: 'https://dummyimage.com/600x400/FF9800/fff&text=Playing+in+the+Shell', // Orange
34+
image: generateImageURL('Playing in the Shell', 2),
2235
description: 'Get familiar with UNIX Shell.',
2336
embed_link: 'https://www.canva.com/design/DAGTIaBPhDM/a_G7XN1OSANZPmkoR_vLnQ/view?embed',
2437
contentFile: 'course3.md',
2538
},
2639
'course 4: introduction to bourne shell': {
2740
title: 'Course 4: Introduction to Bourne Shell',
2841
author: 'Dev Gautam Kumar',
29-
image: 'https://dummyimage.com/600x400/fff&text=B0urn3+$h3ll', // Orange
42+
image: generateImageURL('Bourne Shell', 3),
3043
description: 'Get started with Shell Scripts.',
3144
embed_link: 'https://www.canva.com/design/DAGS2jSbGgI/NHrTUX9491PY9e31licHrA/view?embed',
3245
contentFile: 'course4.md',
3346
},
3447
'course 5: bash scripting basics': {
3548
title: 'Course 5: Bash Scripting Basics',
3649
author: 'Sangharsh',
37-
image: 'https://dummyimage.com/600x400/8BC34A/fff&text=Bash+Scripting+Basics', // Green
50+
image: generateImageURL('Bash Scripting Basics', 4),
3851
description: 'Learn the basics of Bash scripting and automate tasks.',
3952
embed_link: 'https://www.youtube.com/embed/SPwyp2NG-bE',
4053
contentFile: 'course5.md',
4154
},
4255
'course 6: termux for web testing': {
4356
title: 'Course 6: Termux For Web Testing',
4457
author: 'Dev Gautam Kumar',
45-
image: 'https://dummyimage.com/600x400/8BC34A/fff&text=Termux+For+Web+Testing', // Green
46-
description: 'Hello there, I am dropping a Termux Guide mainly focused for Web Bug Hunting . It will help you to save time , esp if you are doing a full time Job like me. This might aid in your journey especially to those who are starting this bug hunting journey on Andorid.',
58+
image: generateImageURL('Termux For Web Testing', 0),
59+
description: 'Hello there, I am dropping a Termux Guide mainly focused for Web Bug Hunting. It will help you to save time, esp if you are doing a full-time job like me. This might aid in your journey, especially to those who are starting this bug hunting journey on Android.',
4760
embed_link: 'https://dummyimage.com/600x400/8BC34A/fff&text=Termux+For+Web+Testing',
4861
contentFile: 'course6.md',
4962
}

0 commit comments

Comments
 (0)