-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
383 lines (350 loc) · 14.9 KB
/
index.html
File metadata and controls
383 lines (350 loc) · 14.9 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
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="FRCsource - Resources and tools for FIRST Robotics Competition teams.">
<meta name="keywords" content="FRC, robotics, FIRST, competition, resources, scouting, programming">
<meta name="author" content="FRCsource Team">
<meta name="robots" content="index, follow">
<title>FRCsource</title>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/5/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
body,h1,h2,h3,h4,h5,h6 {font-family: "Raleway", sans-serif}
</style>
</head>
<body class="w3-light-grey w3-content" style="max-width:1600px">
<!-- Sidebar/menu -->
<nav class="w3-sidebar w3-collapse w3-white w3-animate-left" style="z-index:3;width:300px;" id="mySidebar"><br>
<div class="w3-container">
<a href="#" onclick="w3_close()" class="w3-hide-large w3-right w3-jumbo w3-padding w3-hover-grey" title="close menu">
<i class="fa fa-remove"></i>
</a>
<img src="Assests/logo.jpg" style="width:45%;" class="w3-round"><br><br>
<h4><b>Welcome to FRCsource</b></h4>
<p class="w3-text-grey">For all your scouting and programming needs</p>
</div>
<div class="w3-bar-block">
<a href="#" onclick="w3_close()" class="w3-bar-item w3-button w3-padding w3-text-teal"><i class="fa fa-th-large fa-fw w3-margin-right"></i>Home</a>
<a href="#about" onclick="w3_close()" class="w3-bar-item w3-button w3-padding"><i class="fa fa-user fa-fw w3-margin-right"></i>ABOUT</a>
<a href="Programming/Programming-Index.html" onclick="w3_close()" class="w3-bar-item w3-button w3-padding"><i class="fa fa-th-large fa-fw w3-margin-right"></i>Programming Index</a>
<a href="Scouting/Scouting-Index.html" onclick="w3_close()" class="w3-bar-item w3-button w3-padding"><i class="fa fa-user fa-fw w3-margin-right"></i>Scouting Index</a>
<a href="FRCsource/FRCsource-Index.html" onclick="w3_close()" class="w3-bar-item w3-button w3-padding"><i class="fa fa-envelope fa-fw w3-margin-right"></i>FRCsource Index</a>
</div>
<div class="w3-panel w3-large">
<i class="fa fa-github w3-hover-opacity"></i>
</div>
</nav>
<!-- Overlay effect when opening sidebar on small screens -->
<div class="w3-overlay w3-hide-large w3-animate-opacity" onclick="w3_close()" style="cursor:pointer" title="close side menu" id="myOverlay"></div>
<!-- !PAGE CONTENT! -->
<div class="w3-main" style="margin-left:300px">
<!-- Header -->
<header id="portfolio">
<a href="index.html"><img src="Assests/logo.jpg" style="width:65px;" class="w3-circle w3-right w3-margin w3-hide-large w3-hover-opacity"></a>
<span class="w3-button w3-hide-large w3-xxlarge w3-hover-text-grey" onclick="w3_open()"><i class="fa fa-bars"></i></span>
<div class="w3-container">
<h1><b>Welcome to FRCsource</b></h1>
<div class="w3-section w3-bottombar w3-padding-16">
<span class="w3-margin-right">Filter:</span>
<button class="w3-button w3-black filter-btn" data-filter="ALL">ALL</button>
<button class="w3-button w3-white filter-btn" data-filter="Programming"><i class="fa fa-diamond w3-margin-right"></i>Programming</button>
<button class="w3-button w3-white filter-btn w3-hide-small" data-filter="Scouting"><i class="fa fa-photo w3-margin-right"></i>Scouting</button>
<button class="w3-button w3-white filter-btn w3-hide-small" data-filter="FRCS"><i class="fa fa-map-pin w3-margin-right"></i>FRCsource</button>
<button class="w3-button w3-white filter-btn w3-hide-small" data-filter="Index"><i class="fa fa-map-pin w3-margin-right"></i>Index</button>
<div style="display:inline-block; margin-left:2em; vertical-align:middle;">
<input id="searchBar" class="w3-input w3-border" style="display:inline-block;width:200px;" type="text" placeholder="Search articles...">
</div>
</div>
<div id="search-results" class="w3-panel w3-white w3-card-4" style="display:none;position:absolute;z-index:10;max-width:400px;"></div>
</div>
</header>
<!-- Article Grid (paginated) -->
<div id="article-grid"></div>
<!-- Pagination -->
<div class="w3-center w3-padding-32">
<button id="prevBtn" class="w3-bar-item w3-button w3-hover-black">Previous</button>
<span id="pageNum" class="w3-bar-item w3-black w3-button">1</span>
<button id="nextBtn" class="w3-bar-item w3-button w3-hover-black">Next</button>
</div>
<div class="w3-container w3-padding-large" style="margin-bottom:32px">
<h4><b>FRCsource</b></h4>
<p>Started by a memeber of CORE2062 for Arcvival reasons for scouting it is now a centralized index for FRC guides relating to Custom tutorials, and Knolwege bases powered by the community.</p>
<hr>
</div>
<!-- Footer -->
<footer class="w3-container w3-padding-32 w3-dark-grey">
<div class="w3-row-padding">
<div class="w3-third">
<h3>FOOTER</h3>
<p>This website is made by the FRC community. With speical thanks to Everyone who contributes.</p>
<p>Powered by <a href="https://www.w3schools.com/w3css/default.asp" target="_blank">w3.css</a></p>
</div>
<div class="w3-third">
<h3>Credits</h3>
<ul class="w3-ul w3-hoverable">
<li class="w3-padding-16">
<img src="https://www.w3schools.com/w3images/workshop.jpg" class="w3-left w3-margin-right" style="width:50px">
<span class="w3-large">Special Thanks</span><br>
<span>For credit in helping this website all supporters who helped can be found here</span>
</li>
<li class="w3-padding-16">
<img src="https://www.w3schools.com/w3images/gondol.jpg" class="w3-left w3-margin-right" style="width:50px">
<span class="w3-large">Source Code</span><br>
<span>If you are intrested in help out this project look at the github source code</span>
</li>
</ul>
</div>
<div class="w3-third">
<h3>POPULAR TAGS</h3>
<span class="w3-tag w3-black w3-margin-bottom">Index</span>
<span class="w3-tag w3-grey w3-small w3-margin-bottom">Programming</span>
<span class="w3-tag w3-grey w3-small w3-margin-bottom">Scouting</span>
<span class="w3-tag w3-grey w3-small w3-margin-bottom">FRCsource</span>
<p></p>
</div>
</div>
</footer>
<!-- End page content -->
</div>
<script>
// Script to open and close sidebar
function w3_open() {
document.getElementById("mySidebar").style.display = "block";
document.getElementById("myOverlay").style.display = "block";
}
function w3_close() {
document.getElementById("mySidebar").style.display = "none";
document.getElementById("myOverlay").style.display = "none";
}
// Article data (flat array, with tags)
const articles = [
{
img: 'Assests/programming/Programming.jpg',
alt: 'Programming Index image broke :(',
title: 'Programming Index',
desc: 'A centralized index for all programming resources and tutorials.',
link: 'Programming/Programming-Index.html',
tags: ['Index','Programming']
},
{
img: 'Assests/programming/Programming.jpg',
alt: 'Programming Github image broke :(',
title: 'Github/Git command Index',
desc: 'A centralized index for all git resources and tutorials.',
link: 'Git/Git-Index.html',
tags: ['Index','Programming', 'Scouting']
},
{
img: 'Assests/Scouting/Scouting.jpg',
alt: 'Scouting Index image broke :(',
title: 'Scouting Index',
desc: 'A centralized index for all scouting resources and guides for FRC.',
link: 'Scouting/Scouting-Index.html',
tags: ['Index','Scouting']
},
{
img: 'Assests/index/FRCsourceIndex.png',
alt: 'FRCsource Index image broke :(',
title: 'FRCsource Index',
desc: 'A centralized index for all FRCsource infomartion regarding the website and how to support it.',
link: 'FRCsource/FRCsource-Index.html',
tags: ['Index','FRCS']
},
{
img: 'Assests/programming/Java.jpeg',
alt: 'Java tutorial image broke :(',
title: 'Java tutorial',
desc: 'Here you will find a comprehensive guide to Java programming for base java.',
link: 'https://docs.oracle.com/javase/tutorial/',
tags: ['Programming']
},
{
img: 'Assests/programming/Python.jpg',
alt: 'Python tutorial image broke :(',
title: 'Python tutorial',
desc: 'Here you will find a comprehensive guide to Python programming for base python.',
link: 'https://docs.python.org/3/tutorial/',
tags: ['Programming']
},
{
img: 'Assests/programming/CPlusPlus.png',
alt: 'C++ tutorial image broke :(',
title: 'C++ tutorial',
desc: 'Here you will find a comprehensive guide to C++ programming for base C++.',
link: 'https://www.learncpp.com/',
tags: ['Programming']
},
{
img: 'Assests/Scouting/dice.jpg',
alt: 'Norway',
title: 'Intro To scouting&Game theory',
desc: 'Here you will find a comprehensive guide to scouting and game theory (the study of logical thinking) for FRC.',
link: 'https://en.wikipedia.org/wiki/Game_theory',
tags: ['Scouting']
},
{
img: 'Assests/Scouting/triscout.jpg',
alt: 'This image is broken :(',
title: 'Diffrent types of scouting systems',
desc: 'Here you will find a comprehensive guide to different types of scouting systems for FRC.',
link: 'https://www.chiefdelphi.com/t/scouting-system-ideas/375849',
tags: ['Scouting']
},
{
img: 'https://www.w3schools.com/w3images/p3.jpg',
alt: 'this image is broken :(',
title: 'How to support FRCsource',
desc: 'Here you will find a comprehensive guide to how to support FRCsource.',
link: 'https://www.firstinspires.org/ways-to-help',
tags: ['FRCS']
}
];
let currentPage = 0;
let currentFilter = 'ALL';
const articlesPerPage = 6;
function getFilteredArticles() {
if (currentFilter === 'ALL') return articles;
return articles.filter(article => article.tags.includes(currentFilter));
}
function renderArticles(page) {
const grid = document.getElementById('article-grid');
grid.innerHTML = '';
const filtered = getFilteredArticles();
const start = page * articlesPerPage;
const end = start + articlesPerPage;
const pageArticles = filtered.slice(start, end);
if (pageArticles.length === 0) return;
for (let rowIdx = 0; rowIdx < 2; rowIdx++) {
const row = document.createElement('div');
row.className = 'w3-row-padding';
for (let colIdx = 0; colIdx < 3; colIdx++) {
const articleIdx = rowIdx * 3 + colIdx;
const article = pageArticles[articleIdx];
if (!article) continue;
const col = document.createElement('div');
col.className = 'w3-third w3-container w3-margin-bottom';
col.innerHTML = `
<a href="${article.link}" target="_blank" style="text-decoration:none;color:inherit;">
<img src="${article.img}" alt="${article.alt}" style="width:100%" class="w3-hover-opacity">
<div class="w3-container w3-white">
<p><b>${article.title}</b></p>
<p>${article.desc}</p>
</div>
</a>
`;
row.appendChild(col);
}
grid.appendChild(row);
}
document.getElementById('pageNum').textContent = page + 1;
}
function setFilter(filter) {
currentFilter = filter;
currentPage = 0;
renderArticles(currentPage);
updateFilterButtons();
}
function updateFilterButtons() {
const filterButtons = document.querySelectorAll('.filter-btn');
filterButtons.forEach(btn => {
if (btn.dataset.filter === currentFilter) {
btn.classList.add('w3-black');
btn.classList.remove('w3-white');
} else {
btn.classList.remove('w3-black');
btn.classList.add('w3-white');
}
});
}
document.addEventListener('DOMContentLoaded', function() {
// Add filter button listeners
document.querySelectorAll('.filter-btn').forEach(btn => {
btn.onclick = function() {
setFilter(this.dataset.filter);
};
});
renderArticles(currentPage);
updateFilterButtons();
document.getElementById('nextBtn').onclick = function() {
const filtered = getFilteredArticles();
if ((currentPage + 1) * articlesPerPage < filtered.length) {
currentPage++;
renderArticles(currentPage);
}
};
document.getElementById('prevBtn').onclick = function() {
if (currentPage > 0) {
currentPage--;
renderArticles(currentPage);
}
};
});
</script>
<script>
// --- Search functionality ---
function searchArticles(query) {
let results = [];
if (!query) return results;
let regex;
try {
regex = new RegExp(query, 'i');
} catch (e) {
return [];
}
for (const article of articles) {
if (regex.test(article.title) || regex.test(article.desc)) {
results.push(article);
}
}
return results;
}
function renderSearchResults(results) {
const resultsDiv = document.getElementById('search-results');
if (!results.length) {
resultsDiv.style.display = 'none';
resultsDiv.innerHTML = '';
return;
}
resultsDiv.innerHTML = results.slice(0, 5).map(article => `
<a href="${article.link}" target="_blank" style="text-decoration:none;color:inherit;display:block;padding:8px 0;border-bottom:1px solid #eee;">
<b>${article.title}</b><br>
<span style="font-size:0.9em;color:#555;">${article.desc.substring(0, 60)}${article.desc.length > 60 ? '...' : ''}</span>
</a>
`).join('');
resultsDiv.style.display = 'block';
}
document.addEventListener('DOMContentLoaded', function() {
// ...existing code...
const searchBar = document.getElementById('searchBar');
const resultsDiv = document.getElementById('search-results');
searchBar.addEventListener('input', function() {
const val = searchBar.value.trim();
if (!val) {
resultsDiv.style.display = 'none';
resultsDiv.innerHTML = '';
return;
}
const results = searchArticles(val);
renderSearchResults(results);
});
searchBar.addEventListener('focus', function() {
const val = searchBar.value.trim();
if (val) {
const results = searchArticles(val);
renderSearchResults(results);
}
});
document.addEventListener('click', function(e) {
if (!searchBar.contains(e.target) && !resultsDiv.contains(e.target)) {
resultsDiv.style.display = 'none';
}
});
});
</script>
<!-- End page content -->
</body>
</html>