aboutsummaryrefslogtreecommitdiff
path: root/src/partials/TechnologyBadge.astro
blob: 09cd377d185efb7d1c17fbcb03013b9997f54652 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
---
interface Technology {
	name: string;
	colour: string;
	text?: "light" | "dark";
	icon: string;
}

export const technologies: { [key: string]: Technology } = {
	java: {
		name: "Java",
		colour: "#e76f00",
		icon: "java",
	},
	dotnet: {
		name: ".NET",
		colour: "#512bd4",
		icon: "dotnet",
	},
	go: {
		name: "Go",
		colour: "#00add8",
		icon: "go",
	},
	mysql: {
		name: "MySQL",
		colour: "#3a75b0",
		icon: "mysql",
	},
	mongodb: {
		name: "MongoDB",
		colour: "#4db33d",
		icon: "mongodb",
	},
	sqlserver: {
		name: "SQL Server",
		colour: "#cc2927",
		icon: "sqlserver",
	},
	php: {
		name: "PHP",
		colour: "#8892be",
		icon: "php",
	},
	python: {
		name: "Python",
		colour: "#306998",
		icon: "python",
	},
	javascript: {
		name: "JavaScript",
		colour: "#ffe70b",
		text: "dark",
		icon: "javascript",
	},
	typescript: {
		name: "TypeScript",
		colour: "#007acc",
		icon: "typescript",
	},
	azure: {
		name: "Azure",
		colour: "#0089d6",
		icon: "azure",
	},
	linux: {
		name: "Linux",
		colour: "#010101",
		icon: "linux",
	},
	windows: {
		name: "Windows",
		colour: "#0078d6",
		icon: "windows",
	},
	astro: {
		name: "Astro",
		colour: "#3d50f5",
		icon: "astro",
	},
	rabbitmq: {
		name: "RabbitMQ",
		colour: "#ff6600",
		icon: "rabbitmq",
	},
};

interface Props {
	// tech must be name of the key of one of the technologies
	code: string;

	size?: "small" | "large";
}

const { code, size } = Astro.props;
const tech = technologies[code] as Technology;
---

<span class={`pill-${size ?? "small"} text-${tech.text ?? "light"}`}>
	{tech.name}
</span>

<style define:vars={{ colour: tech.colour }}>
	span {
		display: inline-block;
		background-color: var(--colour);
		font-weight: bold;
		text-transform: uppercase;
		border-radius: 0.5em;
		padding: 0.5em 1em;
	}

	.text-dark {
		color: #000;
	}

	.text-light {
		color: #fff;
	}

	.pill-small {
		padding: 0.35em 0.5em;
		border-radius: 0.25em;

		font-size: 0.75em;
	}

	.pill-large {
		padding: 0.35 0.75em;
		border-radius: 0.5em;

		font-size: 0.75em;
	}
</style>