forked from eranation/eranation.github.io
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
108 lines (101 loc) · 6.02 KB
/
Copy pathindex.html
File metadata and controls
108 lines (101 loc) · 6.02 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
---
layout: default
title: null
---
<div class="flex min-h-[70vh] flex-col justify-center border-b border-zinc-200 [background:radial-gradient(120%_90%_at_20%_0%,#f2ece4_0%,#fafafa_55%,#f4f4f5_100%)] dark:border-zinc-800 dark:[background:radial-gradient(120%_90%_at_20%_0%,#27221e_0%,#17171a_55%,#101013_100%)]">
<div class="mx-auto max-w-6xl px-4 py-8 sm:px-6 lg:py-10">
<div class="grid items-center gap-12 lg:grid-cols-[5fr_6fr]">
<div>
<h1 class="text-4xl font-semibold tracking-tight text-zinc-900 sm:text-5xl dark:text-white">Learn Scala in your browser</h1>
<p class="mt-3 max-w-xl text-lg leading-relaxed text-zinc-600 dark:text-zinc-300">
Interactive, bite-sized tutorials with a live editor on every page.
</p>
<div class="mt-6 flex flex-wrap items-center gap-x-5 gap-y-3">
<a href="/tour/interactive_tour_of_scala_scalculator.html" class="rounded-lg bg-orange-600 px-6 py-3 font-medium text-white shadow-lg shadow-orange-600/25 hover:bg-orange-700 dark:shadow-orange-950/40">Start the Basic Scala Tutorial</a>
<a href="/tour/scala3_intro.html" class="font-medium text-zinc-700 hover:text-zinc-900 dark:text-zinc-300 dark:hover:text-white">What's new in Scala 3 →</a>
</div>
<p class="mt-4 max-w-xl text-sm leading-relaxed text-zinc-500">
Free and open source. The code runs on <a class="underline decoration-zinc-300 underline-offset-2 hover:text-zinc-700 dark:decoration-zinc-700 dark:hover:text-zinc-300" href="https://scastie.scala-lang.org" target="_blank" rel="noopener">Scastie</a>,
the Scala Center's playground. Nothing to install, no account needed.
</p>
<form action="https://scalatutorials.us4.list-manage.com/subscribe/post?u=88bb0ae2c547a703dfa7bb4df&id=89b98532cc" method="post" target="_blank" class="mt-6 max-w-md border-t border-zinc-200 pt-5 dark:border-zinc-800">
<label for="mce-EMAIL" class="block text-sm text-zinc-600 dark:text-zinc-400">Sign up to be notified when more tutorials are available</label>
<div class="mt-2.5 flex gap-2">
<input type="email" value="" name="EMAIL" id="mce-EMAIL" required placeholder="email address"
class="w-full min-w-0 flex-1 rounded-lg border border-zinc-300 bg-white px-3.5 py-2.5 text-sm text-zinc-900 placeholder-zinc-400 focus:border-zinc-500 focus:outline-none dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100 dark:placeholder-zinc-600">
<button type="submit" name="subscribe" class="shrink-0 rounded-lg bg-emerald-500 px-4 py-2.5 text-sm font-medium text-white hover:bg-emerald-600">Subscribe</button>
</div>
<div style="position:absolute;left:-5000px" aria-hidden="true">
<input type="text" name="b_88bb0ae2c547a703dfa7bb4df_89b98532cc" tabindex="-1" value="">
</div>
</form>
</div>
<div class="laptop-stage">
<div class="laptop mx-auto lg:ml-auto">
<div class="laptop-screen">
<div class="laptop-camera"></div>
<div class="laptop-display">
<pre id="hero-embed" class="h-full overflow-auto p-4 font-mono text-sm text-zinc-800 dark:text-zinc-100">//Press Run to try it!
//e.g. Project Euler problem #1:
(1 until 1000).filter(x =>
x % 3 == 0 || x % 5 == 0).sum</pre>
</div>
</div>
<div class="laptop-base"><div class="laptop-notch"></div></div>
</div>
</div>
</div>
</div>
</div>
<div class="mx-auto max-w-5xl px-4 py-6 sm:px-6">
<dl class="grid gap-6 sm:grid-cols-3 sm:gap-0 sm:divide-x sm:divide-zinc-200 dark:sm:divide-zinc-800">
<div class="sm:px-8 sm:first:pl-0 sm:last:pr-0">
<dt class="font-semibold text-zinc-900 dark:text-zinc-100">Run as you read</dt>
<dd class="mt-1.5 text-sm leading-relaxed text-zinc-600 dark:text-zinc-400">Every lesson has a live editor powered by Scastie, the Scala Center's playground.</dd>
</div>
<div class="sm:px-8 sm:first:pl-0 sm:last:pr-0">
<dt class="font-semibold text-zinc-900 dark:text-zinc-100">Small steps</dt>
<dd class="mt-1.5 text-sm leading-relaxed text-zinc-600 dark:text-zinc-400">Forty-odd focused pages, from arithmetic to classes. Each one takes a minute or two.</dd>
</div>
<div class="sm:px-8 sm:first:pl-0 sm:last:pr-0">
<dt class="font-semibold text-zinc-900 dark:text-zinc-100">Scala 3 ready</dt>
<dd class="mt-1.5 text-sm leading-relaxed text-zinc-600 dark:text-zinc-400">The tour targets Scala 3, with a dedicated section on what changed since Scala 2.</dd>
</div>
</dl>
</div>
<script defer src="https://scastie.scala-lang.org/embedded.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
if (!window.scastie || !document.getElementById("hero-embed")) return;
var dark = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
var isMac = /Mac|iP(hone|ad|od)/.test(navigator.platform || "");
document.documentElement.style.setProperty("--run-kbd", isMac ? '"⌘ ↩"' : '"Ctrl+↩"');
if (!isMac) {
var titleTimer = setInterval(function () {
var btns = document.querySelectorAll(".scastie li.run-button");
if (btns.length) {
btns.forEach(function (b) { b.setAttribute("title", "Run (Ctrl+Enter)"); });
clearInterval(titleTimer);
}
}, 500);
setTimeout(function () { clearInterval(titleTimer); }, 15000);
}
try {
scastie.Embedded("#hero-embed", {
theme: dark ? "dark" : "light",
isWorksheetMode: true,
targetType: "scala3"
});
} catch (e) { console.warn("Scastie embed failed:", e); }
document.addEventListener("keydown", function (ev) {
if (ev.key !== "Enter" || !(ev.metaKey || ev.ctrlKey)) return;
var active = document.activeElement;
if (active && active.closest && active.closest(".scastie")) return;
var runBtn = document.querySelector(".scastie li.run-button");
if (runBtn) {
ev.preventDefault();
runBtn.click();
}
});
});
</script>