-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
449 lines (404 loc) · 25.3 KB
/
index.html
File metadata and controls
449 lines (404 loc) · 25.3 KB
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Open-CP | Code, Learn, Compete</title>
<!-- Favicon -->
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon.png" />
<!-- SEO Meta -->
<meta name="description"
content="Open Competitive Programming is a free, open-source hub that unifies world-class programming challenges with a modern coding environment." />
<meta name="keywords"
content="competitive programming, coding challenges, Project Euler, Code Jam, Kick Start, IEEEXtreme, open source, Google Competitions, Hashcode" />
<meta name="robots" content="index, follow" />
<link rel="canonical" href="https://open-cp.eu" />
<!-- Open Graph -->
<meta property="og:type" content="website" />
<meta property="og:title" content="Open-CP | Code, Learn, Compete" />
<meta property="og:description"
content="Solve world-class coding challenges in a single, distraction-free workspace and level up your skills." />
<meta property="og:url" content="https://open-cp.eu" />
<meta property="og:image" content="https://open-cp.eu/images/logo-bg-dark.png">
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Open-CP | Code, Learn, Compete" />
<meta name="twitter:description"
content="Solve world-class coding challenges in a unified, distraction-free workspace." />
<meta name="twitter:image" content="https://open-cp.eu/images/logo-bg-dark.png" />
<!-- Tailwind via CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap" rel="stylesheet" />
<!-- Pyodide -->
<script src="https://cdn.jsdelivr.net/pyodide/v0.25.0/full/pyodide.js"></script>
<!-- Ace core -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.5/ace.js" type="text/javascript"
charset="utf-8"></script>
<!-- Autocomplete/snippets support -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.7/ext-language_tools.min.js" type="text/javascript"
charset="utf-8"></script>
<!-- Global Styles -->
<style>
html {
scroll-behavior: smooth;
}
body {
font-family: "Inter", sans-serif;
}
</style>
</head>
<body class="bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 text-white min-h-screen flex flex-col">
<!-- Navigation -->
<header class="w-full py-4 px-6 md:px-12 flex items-center justify-between reveal opacity-0 translate-y-6">
<h1 class="text-2xl font-extrabold tracking-tight">
<img src="images/logo-transparent-bg-black.png" class="h-24" />
</h1>
<nav class="hidden md:flex gap-8 text-sm font-semibold">
<a href="#vision" class="hover:text-cyan-400 transition m-3">Vision</a>
<a href="#community" class="hover:text-cyan-400 transition m-3">Community</a>
<a href="#ecosystem" class="hover:text-cyan-400 transition m-3">Ecosystem</a>
<a href="#cta" class="hover:text-cyan-400 transition m-3">Try it</a>
<a href="https://github.com/Open-Competitive-Programming/" target="_blank" rel="noopener noreferrer"
class="ml-4 inline-flex items-center bg-cyan-500 hover:bg-cyan-600 text-white font-semibold py-2 px-4 rounded-lg transition">
<!-- GitHub Octocat Icon -->
<svg class="h-5 w-5 mr-2 fill-current" viewBox="0 0 24 24" aria-hidden="true">
<path d="M12 0C5.37 0 0 5.37 0 12c0 5.303 3.438 9.8 8.205 11.387.6.113.82-.26.82-.577
0-.285-.01-1.04-.015-2.04-3.338.726-4.042-1.61-4.042-1.61-.546-1.387-1.333-1.757-1.333-1.757
-1.089-.745.084-.73.084-.73 1.205.084 1.84 1.237 1.84 1.237 1.07 1.835 2.807 1.305 3.492.998
.108-.775.418-1.305.76-1.605-2.665-.303-5.466-1.332-5.466-5.931
0-1.31.47-2.381 1.236-3.221-.124-.303-.536-1.523.117-3.176
0 0 1.008-.322 3.301 1.23.957-.266 1.984-.399 3.003-.404
1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23
.655 1.653.243 2.873.12 3.176.77.84 1.235 1.911 1.235 3.221
0 4.61-2.803 5.625-5.475 5.921.43.371.815 1.102.815 2.222
0 1.606-.014 2.898-.014 3.293 0 .32.216.694.825.576C20.565 21.796 24 17.298 24 12
24 5.37 18.63 0 12 0z" />
</svg>
View on GitHub
</a>
<a href="https://www.linkedin.com/company/open-cp/" target="_blank" rel="noopener noreferrer"
class="ml-0 inline-flex items-center bg-blue-700 hover:bg-blue-800 text-white font-semibold py-2 px-4 rounded-lg transition">
<!-- GitHub Octocat Icon -->
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"
class="h-5 w-5 mr-2">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M8 11v5" />
<path d="M8 8v.01" />
<path d="M12 16v-5" />
<path d="M16 16v-3a2 2 0 1 0 -4 0" />
<path d="M3 7a4 4 0 0 1 4 -4h10a4 4 0 0 1 4 4v10a4 4 0 0 1 -4 4h-10a4 4 0 0 1 -4 -4z" />
</svg>
Follow us on LinkedIn
</a>
</nav>
</header>
<!-- Hero -->
<section class="flex-1 flex flex-col items-center text-center px-6 md:px-0 reveal opacity-0 translate-y-6">
<div class="max-w-3xl pt-20 md:pt-32">
<h2 class="text-4xl md:text-6xl font-extrabold leading-tight mb-6">
Solve world-class <span class="text-cyan-400">coding challenges</span><br class="hidden md:block" />
& grow <span class="text-blue-500">deeper skills</span>
</h2>
<p class="text-lg md:text-xl text-slate-300 mb-10">
Open-CP initiative envisions a free, open-source hub that unifies Project Euler, Code Jam, Kick Start,
IEEEXtreme, and community tasks
in one distraction-free platform fostering high-performance workspaces.
</p>
<!-- "Try it" turned into a button so we can attach JS handlers -->
<button id="tryButton"
class="inline-block bg-cyan-500 hover:bg-cyan-400 active:bg-cyan-600 text-slate-900 font-bold py-3 px-8 rounded-full shadow-lg transition mb-4">
Try it! →
</button>
</div>
<!-- Decorative SVG -->
<svg class="absolute pointer-events-none opacity-10 w-[80rem] -z-10 -translate-y-20" viewBox="0 0 1024 1024"
aria-hidden="true">
<defs>
<linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#06b6d4;stop-opacity:1" />
<stop offset="100%" style="stop-color:#3b82f6;stop-opacity:1" />
</linearGradient>
</defs>
<circle cx="512" cy="512" r="512" fill="url(#grad)" />
</svg>
</section>
<!-- Features -->
<section id="vision" class="py-24 px-6 md:px-20 bg-slate-900/60 backdrop-blur reveal opacity-0 translate-y-6">
<div class="max-w-5xl mx-auto">
<h3 class="text-3xl md:text-4xl font-extrabold mb-12 text-center">Why Open-CP?</h3>
<div class="grid md:grid-cols-3 gap-12">
<div class="flex flex-col items-center text-center">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="h-12 w-12 mb-4 text-cyan-400">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M8 9l3 3l-3 3" />
<path d="M13 15h3" />
<path d="M3 7a4 4 0 0 1 4 -4h10a4 4 0 0 1 4 4v10a4 4 0 0 1 -4 4h-10a4 4 0 0 1 -4 -4z" />
</svg>
<h4 class="font-bold text-lg mb-2">Unified Library</h4>
<p class="text-slate-400">Solve classic and contest-grade challenges from multiple sources without switching
tabs.</p>
</div>
<div class="flex flex-col items-center text-center">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="h-12 w-12 mb-4 text-cyan-400">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M10 13a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
<path d="M8 21v-1a2 2 0 0 1 2 -2h4a2 2 0 0 1 2 2v1" />
<path d="M15 5a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
<path d="M17 10h2a2 2 0 0 1 2 2v1" />
<path d="M5 5a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
<path d="M3 13v-1a2 2 0 0 1 2 -2h2" />
</svg>
<h4 class="font-bold text-lg mb-2">
Collaborative
</h4>
<p class="text-slate-400">
Open collaborative environment for everyone to contribute problems, from individuals to institutions
</p>
</div>
<div class="flex flex-col items-center text-center">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="h-12 w-12 mb-4 text-cyan-400">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M3 17h4v4h-4z" />
<path d="M17 3h4v4h-4z" />
<path d="M11 19h5.5a3.5 3.5 0 0 0 0 -7h-8a3.5 3.5 0 0 1 0 -7h4.5" />
</svg>
<h4 class="font-bold text-lg mb-2">Visual Learning</h4>
<p class="text-slate-400">Interactive walkthroughs and step-by-step visualizations deepen algorithmic insight.
</p>
</div>
<div class="flex flex-col items-center text-center">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"
class="h-12 w-12 mb-4 text-cyan-400">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M5.931 6.936l1.275 4.249m5.607 5.609l4.251 1.275" />
<path d="M11.683 12.317l5.759 -5.759" />
<path d="M5.5 5.5m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0" />
<path d="M18.5 5.5m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0" />
<path d="M18.5 18.5m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0" />
<path d="M8.5 15.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" />
</svg>
<h4 class="font-bold text-lg mb-2">Federation</h4>
<p class="text-slate-400">Interconnect platform instances via ActivityPub, enabling cross-instance
challenges and community growth.</p>
</p>
</div>
<div class="flex flex-col items-center text-center">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"
class="h-12 w-12 mb-4 text-cyan-400">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M15 15m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" />
<path d="M13 17.5v4.5l2 -1.5l2 1.5v-4.5" />
<path d="M10 19h-5a2 2 0 0 1 -2 -2v-10c0 -1.1 .9 -2 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -1 1.73" />
<path d="M6 9l12 0" />
<path d="M6 12l3 0" />
<path d="M6 15l2 0" />
</svg>
<h4 class="font-bold text-lg mb-2">OpenCP Problem Standard</h4>
<p class="text-slate-400">OPS is an open schema for creating, sharing, and deploying programming problems,
ensuring consistency and interoperability across providers.</p>
</div>
<div class="flex flex-col items-center text-center">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"
class="h-12 w-12 mb-4 text-cyan-400">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M4 13a8 8 0 0 1 7 7a6 6 0 0 0 3 -5a9 9 0 0 0 6 -8a3 3 0 0 0 -3 -3a9 9 0 0 0 -8 6a6 6 0 0 0 -5 3" />
<path d="M7 14a6 6 0 0 0 -3 6a6 6 0 0 0 6 -3" />
<path d="M15 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />
</svg>
<h4 class="font-bold text-lg mb-2">Future Proof</h4>
<p class="text-slate-400">
Open-CP is designed to harmonize with Generative AI
and Quantum Computing problems.
</p>
</div>
</div>
</div>
</section>
<!-- Ecosystem -->
<section id="community" class="py-24 px-6 md:px-20 reveal opacity-0 translate-y-6">
<div class="max-w-4xl mx-auto text-center">
<h3 class="text-3xl md:text-4xl font-extrabold mb-6">Built by & for the community</h3>
<p class="text-slate-300 max-w-3xl mx-auto mb-10">
Open-CP aims to thrive on collaboration with universities, contest organizers, and open‑source contributors.
Join us on <a href="https://github.com/Open-Competitive-Programming" target="_blank"
class="text-cyan-400 underline hover:text-cyan-300">GitHub</a> and <a
class="text-cyan-400 underline hover:text-cyan-300" href="https://www.linkedin.com/company/open-cp"
target="_blank">LinkedIn</a>, to track our effort and don't hesitate to
contribute by sharing
problems or ideas. Start shaping the future of competitive programming!
</p>
<div class="flex flex-wrap justify-center gap-6 opacity-80">
<img src="images/project-euler-logo.jpg" alt="Project Euler logo" class="h-12" />
<img src="images/codejam-logo.png" alt="Code Jam logo" class="h-12" />
<img src="images/hashcode-logo.jpg" alt="Hashcode logo" class="h-12" />
<img src="images/ieeextreme-logo.gif" alt="IEEEXtreme logo" class="h-12" />
</div>
</div>
</section>
<section id="ecosystem" class="py-24 px-6 md:px-20 bg-slate-900/60 backdrop-blur reveal opacity-0 translate-y-6">
<div class="mt-16 text-center">
<h3 class="text-3xl md:text-4xl font-extrabold mb-6">Architecture</h3>
<p class="text-slate-300 max-w-3xl mx-auto mb-10">
Open-CP is designed with a Kubernetes-native architecture, making it cloud-ready and easily deployable
on-premise.
This ensures scalability, reliability, and flexibility across diverse environments.
Security and privacy are at the core of the platform, leveraging containerization, network policies, and
encryption
to protect user data and maintain compliance with modern standards.
</p>
<div class="max-w-5xl mx-auto">
<div class="flex flex-col items-center text-center">
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="none" class="h-14 mb-4 text-cyan-400">
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
<g id="SVGRepo_iconCarrier">
<path fill="#131c2f"
d="M4.5 14.569c.214.278.539.431.874.431h5.251c.335 0 .66-.165.875-.434l3.258-4.178c.214-.278.288-.633.214-.978l-1.165-5.207a1.128 1.128 0 00-.606-.777l-4.714-2.31A1.062 1.062 0 008.002 1c-.168 0-.335.038-.485.115l-4.715 2.32a1.129 1.129 0 00-.605.777L1.032 9.42c-.084.345 0 .7.214.978L4.5 14.568z">
</path>
<path fill="#21d3ee" fill-rule="evenodd"
d="M12.741 9.128c.098.002.196.01.293.024l.058.013.031.008a.308.308 0 01.26.371.306.306 0 01-.396.223h-.004l-.003-.001-.003-.002a1.58 1.58 0 00-.03-.006l-.05-.01a2.55 2.55 0 01-.274-.106 2.867 2.867 0 00-.533-.157.242.242 0 00-.171.064 4.656 4.656 0 00-.131-.023 3.971 3.971 0 01-1.764 2.212c.015.042.032.083.051.123a.239.239 0 00-.023.18c.074.17.165.332.271.484.06.078.114.16.164.244l.028.057.012.025a.306.306 0 01-.381.44.308.308 0 01-.172-.18l-.01-.02a1.57 1.57 0 01-.028-.058 2.546 2.546 0 01-.089-.28 2.837 2.837 0 00-.21-.512.242.242 0 00-.156-.095l-.03-.053-.035-.064a3.97 3.97 0 01-2.823-.007l-.07.125a.25.25 0 00-.132.064 2.13 2.13 0 00-.237.548 2.518 2.518 0 01-.088.28 1.196 1.196 0 01-.025.05l-.013.027v.001a.306.306 0 01-.421.173.308.308 0 01-.173-.314.306.306 0 01.041-.12l.014-.03.026-.052c.05-.085.104-.166.164-.244.108-.156.2-.322.277-.496a.302.302 0 00-.028-.173l.056-.133A3.972 3.972 0 014.22 9.532l-.134.023a.34.34 0 00-.176-.062 2.871 2.871 0 00-.533.156c-.09.04-.181.075-.274.105a1.017 1.017 0 01-.05.011l-.03.007H3.02l-.002.002h-.005a.308.308 0 01-.397-.349.306.306 0 01.261-.245l.005-.001h.002l.006-.002c.024-.006.054-.014.076-.018.097-.013.195-.021.293-.023.186-.013.37-.043.549-.09a.422.422 0 00.131-.133l.128-.037a3.938 3.938 0 01.625-2.752l-.098-.087a.338.338 0 00-.062-.176 2.854 2.854 0 00-.455-.319 2.557 2.557 0 01-.254-.148l-.048-.038-.015-.013-.004-.003a.323.323 0 01-.076-.45.295.295 0 01.244-.107.365.365 0 01.213.08l.022.017c.016.013.034.026.046.037.072.067.139.139.202.213.125.137.263.262.412.372.056.03.121.036.182.018l.11.078a3.938 3.938 0 012.552-1.224l.008-.129a.332.332 0 00.099-.158 2.844 2.844 0 00-.034-.553 2.56 2.56 0 01-.042-.29v-.082-.005A.306.306 0 018 2.82a.308.308 0 01.306.337v.087a2.529 2.529 0 01-.041.29 2.85 2.85 0 00-.035.553.242.242 0 00.1.153v.007l.007.129c.967.088 1.87.522 2.54 1.223l.116-.082a.34.34 0 00.186-.02c.149-.11.287-.236.412-.373.063-.075.13-.146.202-.213l.051-.04.017-.014a.307.307 0 11.381.477l-.024.02c-.015.012-.03.025-.043.034a2.537 2.537 0 01-.254.148 2.87 2.87 0 00-.455.32.241.241 0 00-.058.172l-.05.044-.058.053c.542.806.77 1.783.637 2.745l.123.036c.031.055.077.101.133.132.179.048.363.078.548.09zM7.291 5.24c.107-.024.216-.043.326-.056l-.09 1.6-.008.004a.268.268 0 01-.293.256.27.27 0 01-.135-.05l-.002.001-1.316-.93c.419-.41.945-.696 1.518-.825zm1.618 1.75l1.308-.924a3.182 3.182 0 00-1.833-.882l.09 1.598h.002a.268.268 0 00.294.256.27.27 0 00.135-.05l.004.002zm2.248 1.656L9.609 8.2l-.002-.006a.27.27 0 01-.185-.343.27.27 0 01.08-.12L9.5 7.73l1.195-1.067c.366.594.527 1.29.46 1.983zM9.096 9.5l.618 1.49a3.148 3.148 0 001.275-1.598l-1.593-.269-.002.003a.26.26 0 00-.166.023.27.27 0 00-.13.348l-.002.003zm-.385 1.905c-.573.13-1.17.1-1.727-.088l.777-1.4h.001a.27.27 0 01.475-.001h.006l.779 1.402a3.286 3.286 0 01-.311.087zm-2.418-.422l.611-1.474-.004-.006a.268.268 0 00-.297-.37L6.6 9.13l-1.579.267a3.16 3.16 0 001.272 1.586zm-.997-4.32l1.201 1.071-.001.007a.269.269 0 01-.106.462l-.001.005-1.54.443a3.134 3.134 0 01.447-1.988zm2.95 1.154h-.492l-.307.38.11.476.443.213.442-.212.11-.476-.306-.381z"
clip-rule="evenodd"></path>
</g>
</svg>
<h4 class="font-bold text-lg mb-2">Kubernetes Native</h4>
<p class="text-slate-400">Deployable on any Kubernetes Cluster via <a href="https://jsonnet.org"
class="text-cyan-400 underline hover:text-cyan-300" target="_blank">Jsonnet</a> & <a
href="https://grafana.com/oss/tanka/" class="text-cyan-400 underline hover:text-cyan-300"
target="_blank">Tanka</a> generated
manifests.</p>
</div>
<div class="flex flex-col items-center text-center mt-6">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"
class="h-12 w-12 mb-4 text-cyan-400">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M3 20h7" />
<path d="M14 20h7" />
<path d="M10 20a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
<path d="M12 16v2" />
<path
d="M8 16.004h-1.343c-2.572 -.004 -4.657 -2.011 -4.657 -4.487c0 -2.475 2.085 -4.482 4.657 -4.482c.393 -1.762 1.794 -3.2 3.675 -3.773c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.913 0 3.464 1.56 3.464 3.486c0 1.927 -1.551 3.487 -3.465 3.487h-2.535" />
</svg>
<h4 class="font-bold text-lg mb-2">Cloud Ready</h4>
<p class="text-slate-400">Optimized for deployment on cloud and on-premise infrastructure, ensuring high
availability.
</p>
</div>
<div class="flex flex-col items-center text-center mt-6">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"
class="h-12 w-12 mb-4 text-cyan-400">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M13.5 21h-6.5a2 2 0 0 1 -2 -2v-6a2 2 0 0 1 2 -2h10a2 2 0 0 1 1.74 1.012" />
<path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0" />
<path d="M8 11v-4a4 4 0 1 1 8 0v4" />
<path d="M19 16l-2 3h4l-2 3" />
</svg>
<h4 class="font-bold text-lg mb-2">Security & Privacy</h4>
<p class="text-slate-400">
Built with security in mind, Open-CP accounts for data protection and user privacy.
</p>
</div>
</div>
</div>
</section>
<!-- Challenge CTA -->
<section id="cta" class="py-24 px-6 md:px-20">
<div class="max-w-3xl mx-auto bg-slate-700 p-8 rounded-2xl shadow-2xl border border-slate-700">
<h3 class="text-2xl md:text-3xl font-extrabold mb-4 text-center">Challenge: Add Two Numbers</h3>
<p class="text-slate-300 mb-6 text-center">Write a program that reads two integers <code>a</code> and
<code>b</code> from standard input and prints their sum.
</p>
<label for="editor" class="block mb-2 font-semibold">Python code:</label>
<!-- Ace Editor container -->
<div id="editor" class="w-full rounded-lg font-mono text-sm leading-tight bg-slate-900" style="height:300px">
</div>
<button id="run"
class="mt-4 bg-cyan-500 hover:bg-cyan-400 active:bg-cyan-600 text-slate-900 font-bold py-2 px-6 rounded-full">Run</button>
<pre id="output" class="mt-6 bg-black text-green-400 p-4 rounded-lg whitespace-pre-wrap"></pre>
</div>
</section>
<!-- Footer -->
<footer class="mt-auto py-8 text-center text-sm text-slate-500">
© 2025 Open-CP. Built with ❤ by the open-source community.
</footer>
<!-- Simple Scroll Reveal Animation & Challenge Logic -->
<script>
// Reveal animation
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.remove('opacity-0', 'translate-y-6');
entry.target.classList.add('opacity-100', 'translate-y-0', 'transition-all', 'duration-700');
observer.unobserve(entry.target);
}
});
}, { threshold: 0.1 });
document.querySelectorAll('.reveal').forEach(el => observer.observe(el));
// Load Pyodide once and cache the promise
const pyodideReadyPromise = loadPyodide();
// Initialize Ace editor once DOM is ready
document.addEventListener('DOMContentLoaded', () => {
const editor = ace.edit('editor', {
mode: 'ace/mode/python',
theme: 'ace/theme/twilight',
selectionStyle: 'text'
});
editor.session.setValue(`# Write your code here\n# For example:\na, b = map(int, input().split())\nprint(a + b)`);
editor.setOptions({
enableBasicAutocompletion: true,
enableLiveAutocompletion: true,
enableSnippets: true,
fontSize: '14px'
});
// Handle "Try it" button click
document.getElementById('tryButton').addEventListener('click', async () => {
const ctaSection = document.getElementById('cta');
ctaSection.classList.remove('hidden');
ctaSection.scrollIntoView({ behavior: 'smooth' });
setTimeout(() => editor.resize(), 0);
});
// Run code on button click
document.getElementById('run').addEventListener('click', async () => {
const pyodide = await pyodideReadyPromise; // Wait for Pyodide to be ready
const userCode = editor.getValue();
const testInput = "2 3\n"; // simple test case
const expectedOutput = "5";
// Prepare Python to capture input/output
const wrapper = `\nimport sys, builtins, io\n_input_iter = iter(${JSON.stringify(testInput)}.splitlines())\nbuiltins.input = lambda: next(_input_iter)\n_stdout_buffer = io.StringIO()\nsys.stdout = _stdout_buffer\n` + userCode + `\nresult = _stdout_buffer.getvalue().strip()\n`;
try {
await pyodide.runPythonAsync(wrapper);
const result = pyodide.globals.get('result');
const outputBox = document.getElementById('output');
if (result === expectedOutput) {
outputBox.textContent = `✅ Correct! Output: ${result}`;
outputBox.classList.remove('text-red-400');
outputBox.classList.add('text-green-400');
} else {
outputBox.textContent = `❌ Incorrect. Your output: ${result} (expected ${expectedOutput})`;
outputBox.classList.remove('text-green-400');
outputBox.classList.add('text-red-400');
}
} catch (err) {
document.getElementById('output').textContent = '❌ Error: ' + err;
document.getElementById('output').classList.remove('text-green-400');
document.getElementById('output').classList.add('text-red-400');
}
});
});
</script>
</body>
</html>