Repository navigation
Expand file tree
/
Copy pathenlighten.html
More file actions
227 lines (211 loc) · 9.71 KB
/
Copy pathenlighten.html
File metadata and controls
227 lines (211 loc) · 9.71 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
---
layout: default
title: Enlighten - Free Tech Books Online By RDjarbeng
permalink: /enlighten/
body_class: enlighten-page
description: "Project Enlighten: a curated collection of genuinely good tech books that are legally available to read free online - machine learning, data science, computer vision, programming and IT."
---
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@emailjs/browser@4/dist/email.min.js"></script>
<script type="text/javascript">
(function () {
emailjs.init({
publicKey: "VMNzpaX75utVJ3RFH",
});
})();
</script>
<div class="enlighten-wrap">
<div class="enlighten-intro">
<h1>📚 Enlighten</h1>
<p>A curated shelf of genuinely good tech books that are legally available to read free online. No paywalls, no sketchy downloads - just authors and publishers doing right by readers.</p>
</div>
<div class="learning-path" id="start-here">
<h2>🧭 Start here: a suggested learning path</h2>
<p class="path-desc">New to tech or levelling up? These five, in this order, take you from zero to modern AI.</p>
<div class="path-steps">
{% assign path_slugs = "automate-the-boring-stuff python-for-data-analysis practical-deep-learning-for-coders dive-into-deep-learning foundations-of-computer-vision" | split: " " %}
{% for slug in path_slugs %}
{% assign pbook = site.books | where: "slug", slug | first %}
{% if pbook %}
<a class="path-step" href="{{ pbook.link }}" target="_blank" rel="noopener" title="{{ pbook.title }} - {{ pbook.author }}">
<span class="path-num">{{ forloop.index }}</span>
{{ pbook.title }}
</a>
{% unless forloop.last %}<span class="path-arrow">→</span>{% endunless %}
{% endif %}
{% endfor %}
</div>
</div>
{% assign all_tags = site.books | map: "tags" | join: "," | split: "," | uniq | sort %}
<div class="tag-filter-bar" id="tag-filter-bar">
<span class="tag-filter-label">Filter:</span>
<button class="tag-chip active" data-tag="">All</button>
{% for t in all_tags %}
{% assign tt = t | strip %}
{% if tt != "" %}
<button class="tag-chip" data-tag="{{ tt }}">{{ tt }}</button>
{% endif %}
{% endfor %}
</div>
{% assign cats = site.book_categories | sort: "weight" %}
{% for cat in cats %}
{% assign cat_books = site.books | where: "category", cat.name %}
{% if cat_books.size > 0 %}
<section class="enlighten-section" data-section="{{ cat.name | slugify }}">
<h2>{{ cat.icon }} {{ cat.name }}</h2>
{% if cat.description %}
<p class="section-desc">{{ cat.description }}</p>
{% endif %}
<div class="enlighten-grid">
{% for book in cat_books %}
<a href="{{ book.link }}" target="_blank" rel="noopener" class="book-card"
data-tags="{% for tag in book.tags %}{{ tag | strip }}{% unless forloop.last %},{% endunless %}{% endfor %}">
<div class="book-card-top">
{% if book.format %}<span class="book-format">{{ book.format }}</span>{% endif %}
</div>
<h3>{{ book.title }}</h3>
<p class="book-author">{{ book.author }}</p>
{% if book.known_for %}
<p class="book-known">{{ book.known_for }}</p>
{% endif %}
<p class="book-desc">{{ book.description }}</p>
{% if book.note %}
<p class="book-note">{{ book.note }}</p>
{% endif %}
{% if book.tags and book.tags.size > 0 %}
<div class="book-tags">
{% for tag in book.tags %}<span class="book-tag">{{ tag }}</span>{% endfor %}
</div>
{% endif %}
<div class="book-footer">
<span class="book-cta">Read online →</span>
</div>
</a>
{% endfor %}
</div>
</section>
{% endif %}
{% endfor %}
<section class="suggest-section" id="suggest-a-book">
<div class="suggest-box">
<h2>💡 Suggest a book</h2>
<p>Know a great tech book that's legally free online? Send it my way - if it's good, it joins the shelf (with credit to you if you like).</p>
<form id="enlighten-suggest-form" class="suggest-form">
<div class="form-group" style="display: none;">
<label for="suggest-website-url">Website</label>
<input type="text" id="suggest-website-url" name="website_url" tabindex="-1" autocomplete="off">
</div>
<div class="form-group">
<label for="book_title">Book title* <small>(Required)</small></label>
<input type="text" id="book_title" name="book_title" required placeholder="e.g. The Missing README">
</div>
<div class="form-group">
<label for="book_author">Author(s)* <small>(Required)</small></label>
<input type="text" id="book_author" name="book_author" required placeholder="Who wrote it?">
</div>
<div class="form-group">
<label for="book_link">Link to the free version</label>
<input type="url" id="book_link" name="book_link" placeholder="https:// ...">
</div>
<div class="form-group">
<label for="reason">Why do you recommend it?</label>
<textarea id="reason" name="reason" placeholder="What makes it worth reading?"></textarea>
</div>
<div class="form-group">
<label for="user_name">Your name <small>(so I can credit you)</small></label>
<input type="text" id="user_name" name="user_name" placeholder="Optional">
</div>
<div class="form-group">
<label for="user_email">Your email</label>
<input type="email" id="user_email" name="user_email" placeholder="Optional - if you'd like a reply">
</div>
<input type="submit" value="Send Suggestion" class="submit-btn">
<p id="suggest-form-message" style="display: none;"></p>
<div id="suggest-loading-indicator" style="display: none;">
<p>Sending your suggestion...</p>
</div>
</form>
</div>
</section>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
var chips = document.querySelectorAll("#tag-filter-bar .tag-chip");
function applyFilter(tag) {
document.querySelectorAll(".book-card").forEach(function (card) {
var tags = (card.getAttribute("data-tags") || "").split(",").map(function (s) { return s.trim(); });
card.style.display = (!tag || tags.indexOf(tag) !== -1) ? "" : "none";
});
document.querySelectorAll(".enlighten-section").forEach(function (section) {
var visible = Array.prototype.some.call(section.querySelectorAll(".book-card"), function (c) {
return c.style.display !== "none";
});
section.style.display = visible ? "" : "none";
if (visible) section.classList.add("has-visible");
});
}
chips.forEach(function (chip) {
chip.addEventListener("click", function () {
var wasActive = chip.classList.contains("active");
chips.forEach(function (c) { c.classList.remove("active"); });
if (wasActive) {
chip.classList.add("active");
applyFilter("");
} else {
chip.classList.add("active");
applyFilter(chip.getAttribute("data-tag"));
}
});
});
var form = document.getElementById("enlighten-suggest-form");
if (!form) return;
form.addEventListener("submit", function (event) {
event.preventDefault();
var honeypot = document.getElementById("suggest-website-url");
if (honeypot && honeypot.value) { return; }
var formMessage = document.getElementById("suggest-form-message");
var loadingIndicator = document.getElementById("suggest-loading-indicator");
var parts = [];
parts.push("Book: " + (form.book_title.value || "(not given)"));
parts.push("Author(s): " + (form.book_author.value || "(not given)"));
parts.push("Link: " + (form.book_link.value || "(none provided)"));
parts.push("");
parts.push("Why they recommend it: " + (form.reason.value || "(not given)"));
var from = [];
if (form.user_name.value) { from.push(form.user_name.value); }
if (form.user_email.value) { from.push("<" + form.user_email.value + ">"); }
if (from.length > 0) { parts.push(""); parts.push("Suggested by: " + from.join(" ")); }
var msgField = document.createElement("input");
msgField.type = "hidden";
msgField.name = "message";
msgField.value = parts.join("\n");
form.appendChild(msgField);
var subjectField = document.createElement("input");
subjectField.type = "hidden";
subjectField.name = "subject";
subjectField.value = "Enlighten: Book Suggestion";
form.appendChild(subjectField);
loadingIndicator.style.display = "block";
formMessage.style.display = "none";
formMessage.className = "";
emailjs.sendForm("contact_service", "contact_form", form)
.then(function () {
loadingIndicator.style.display = "none";
formMessage.textContent = "Thanks! Your suggestion has been sent.";
formMessage.className = "success-message";
formMessage.style.display = "block";
form.reset();
})
.catch(function (error) {
loadingIndicator.style.display = "none";
formMessage.textContent = "Failed to send your suggestion. Please try again.";
formMessage.className = "error-message";
formMessage.style.display = "block";
console.error("EmailJS Error:", error);
})
.finally(function () {
msgField.remove();
subjectField.remove();
});
});
});
</script>