astro-accelerator 5.10.31 → 5.10.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.10.31",
2
+ "version": "5.10.33",
3
3
  "author": "Steve Fenton",
4
4
  "name": "astro-accelerator",
5
5
  "description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
@@ -36,9 +36,9 @@
36
36
  "dependencies": {
37
37
  "@astrojs/mdx": "^4.3.13",
38
38
  "@img/sharp-linux-x64": "^0.34.5",
39
- "astro": "^5.16.8",
40
- "astro-accelerator-utils": "^0.3.65",
41
- "cspell": "^9.4.0",
39
+ "astro": "^5.16.11",
40
+ "astro-accelerator-utils": "^0.3.67",
41
+ "cspell": "^9.6.0",
42
42
  "csv": "^6.4.1",
43
43
  "glob": "^13.0.0",
44
44
  "hast-util-from-selector": "^3.0.1",
@@ -1323,6 +1323,119 @@ figure:focus .magnify-button {
1323
1323
  margin: 0;
1324
1324
  }
1325
1325
 
1326
+ /* Events timeline */
1327
+
1328
+ .timeline {
1329
+ position: relative;
1330
+ }
1331
+
1332
+ .timeline h2,
1333
+ .timeline h3 {
1334
+ margin: 0 0 0.5rem 0;
1335
+ font-size: var(--font-size-h4)
1336
+ }
1337
+
1338
+ .timeline::before {
1339
+ content: '';
1340
+ position: absolute;
1341
+ left: 2rem;
1342
+ top: 0;
1343
+ bottom: 0;
1344
+ width: 0.4rem;
1345
+ background-color: var(--icon-block);
1346
+ }
1347
+
1348
+ .timeline-event {
1349
+ position: relative;
1350
+ margin-bottom: 1rem;
1351
+ padding-left: 4rem;
1352
+ transition: margin-bottom 0.3s ease;
1353
+ }
1354
+
1355
+ .timeline-event::before {
1356
+ content: '';
1357
+ position: absolute;
1358
+ left: 1.5rem;
1359
+ top: 1.5rem;
1360
+ width: 1rem;
1361
+ height: 1rem;
1362
+ background: var(--aft);
1363
+ border: 3px solid var(--icon-block);
1364
+ border-radius: 50%;
1365
+ box-shadow: var(--box-shadow-unselected);
1366
+ transition: all 0.3s ease;
1367
+ z-index: 1;
1368
+ }
1369
+
1370
+ .timeline-event:focus-within {
1371
+ margin-bottom: 2rem;
1372
+ }
1373
+
1374
+ .timeline-event:focus-within::before {
1375
+ background: var(--icon-block);
1376
+ box-shadow: var(--box-shadow);
1377
+ transform: scale(1.2);
1378
+ }
1379
+
1380
+ .timeline-event > button {
1381
+ width: 100%;
1382
+ text-align: left;
1383
+ background: var(--aft-block);
1384
+ color: var(--fore-block);
1385
+ border-radius: 0.5rem;
1386
+ padding: 1.5rem;
1387
+ cursor: pointer;
1388
+ transition: all 0.3s ease;
1389
+ box-shadow: var(--box-shadow-unselected);
1390
+ }
1391
+
1392
+ .timeline-event.event-past > button {
1393
+ opacity: 0.8;
1394
+ background: var(--aft);
1395
+ color: var(--fore);
1396
+ box-shadow: none;
1397
+ }
1398
+
1399
+
1400
+ .timeline-event > button:hover,
1401
+ .timeline-event > button:focus {
1402
+ outline: none;
1403
+ box-shadow: var(--box-shadow);
1404
+ transform: translateX(4px);
1405
+ }
1406
+
1407
+ .timeline time {
1408
+ display: block;
1409
+ font-size: var(--font-size-meta);
1410
+ margin-bottom: 0.5rem;
1411
+ }
1412
+
1413
+ .timeline-location {
1414
+ display: block;
1415
+ font-size: var(--font-size-meta);
1416
+ }
1417
+
1418
+ .timeline-location::before {
1419
+ content: '📍 ';
1420
+ }
1421
+
1422
+ .timeline-details {
1423
+ max-height: 0;
1424
+ overflow: hidden;
1425
+ opacity: 0;
1426
+ font-size: var(--font-size-meta);
1427
+ transition: max-height 0.2s ease, opacity 0.2s ease;
1428
+ }
1429
+
1430
+ .timeline-event:focus-within .timeline-details {
1431
+ max-height: 500px;
1432
+ opacity: 1;
1433
+ }
1434
+
1435
+ .timeline-event.event-past::before {
1436
+ box-shadow: var(--box-shadow-unselected);
1437
+ }
1438
+
1326
1439
  /* Animation */
1327
1440
 
1328
1441
  @media (prefers-reduced-motion: no-preference) {
package/public/js/main.js CHANGED
@@ -19,6 +19,7 @@ import { setExternalLinkAttributes } from './modules/external-links.js';
19
19
  import { monitorInputType } from './modules/input-type.js';
20
20
  import { enableSharing } from './modules/share.js';
21
21
  import { highlightCurrentHeading } from './modules/toc.js';
22
+ import { setTimelineEvents } from './modules/event-timeline.js';
22
23
 
23
24
  const resizedEventName = addResizedEvent();
24
25
 
@@ -36,6 +37,7 @@ addListImageIntersectionObserver('.post-list img');
36
37
  monitorInputType();
37
38
  enableSharing();
38
39
  highlightCurrentHeading('.page-toc a');
40
+ setTimelineEvents();
39
41
 
40
42
  // @ts-ignore
41
43
  const f = site_features ?? {};
@@ -0,0 +1,30 @@
1
+ /**
2
+ * This javascript file comes from Astro Accelerator
3
+ * Edits will be overwritten if you change the file locally
4
+ *
5
+ * @format
6
+ */
7
+
8
+ // @ts-check
9
+
10
+ import { qsa } from './query.js';
11
+
12
+ const dataAttributeName = 'data-timeline';
13
+
14
+ /**
15
+ * Adds a class to past events to handle styling.
16
+ *
17
+ */
18
+ function setTimelineEvents() {
19
+ const today = new Date();
20
+ qsa('[' + dataAttributeName + '] time').forEach((timeEl) => {
21
+ const eventDate = new Date(timeEl.getAttribute('datetime'));
22
+ eventDate.setHours(0, 0, 0, 0);
23
+
24
+ if (eventDate < today) {
25
+ timeEl.closest('.timeline-event').classList.add('event-past');
26
+ }
27
+ });
28
+ }
29
+
30
+ export { setTimelineEvents };
@@ -5,7 +5,7 @@
5
5
  import { Accelerator, PostFiltering } from 'astro-accelerator-utils';
6
6
  import type { MarkdownInstance } from 'astro';
7
7
  import { SITE } from '@config';
8
- import { htmlToText, convert } from 'html-to-text';
8
+ import { convert } from 'html-to-text';
9
9
  import keywordExtractor from 'keyword-extractor';
10
10
 
11
11
  const getData = async () => {