opensource-showcase 0.1.22 → 0.1.24

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"henry-assets.js","sourceRoot":"","sources":["../../src/templates/henry-assets.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,MAAM,CAAC,MAAM,YAAY,GAAW,sonBAAsonB,CAAC;AAC3qnB,MAAM,CAAC,MAAM,WAAW,GAAW,o3mqEAAo3mqE,CAAC;AACx5mqE,MAAM,CAAC,MAAM,WAAW,GAAW,i7nBAAi7nB,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Scrub the embedded sketch with horizontal pointer movement without autoplay or runtime dependencies. */
2
+ export declare const sketchScrollScript = "\n(() => {\n const cover = document.querySelector('.henry-cover');\n const video = document.querySelector('.sketch-art video');\n if (!cover || !video) return;\n const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)');\n const desktop = window.matchMedia('(min-width: 1024px)');\n let frame = 0;\n let seeking = false;\n let target = 0;\n let progress = 0.5;\n\n let initialized = false;\n let lastTime = 0;\n let displayed = 0.5;\n function update(now) {\n frame = 0;\n if (!Number.isFinite(video.duration) || video.duration <= 0) return;\n video.pause();\n const end = Math.max(0, video.duration - 1 / 60);\n const stationary = reduceMotion.matches || !desktop.matches;\n const goal = stationary ? 0.5 : progress;\n const elapsed = lastTime ? Math.min(50, Math.max(1, now - lastTime)) : 16.67;\n lastTime = now;\n // Ease the desired pose independently of the decoder, rather than jumping\n // from the last decoded frame whenever a seek finishes.\n displayed += (goal - displayed) * (1 - Math.exp(-elapsed / 180));\n if (stationary || Math.abs(goal - displayed) < 0.001) displayed = goal;\n target = displayed * end;\n if (!seeking && (!initialized || Math.abs(video.currentTime - target) >= 1 / 120)) {\n seeking = true;\n initialized = true;\n video.currentTime = target;\n }\n if (Math.abs(goal - displayed) >= 0.001) schedule();\n }\n\n function schedule() {\n if (!frame) frame = requestAnimationFrame(update);\n }\n video.addEventListener('seeked', () => { seeking = false; schedule(); });\n video.addEventListener('loadedmetadata', schedule);\n video.addEventListener('error', () => { seeking = false; });\n cover.addEventListener('pointermove', event => {\n if (event.pointerType === 'touch') return;\n const bounds = cover.getBoundingClientRect();\n progress = Math.min(1, Math.max(0, (event.clientX - bounds.left) / Math.max(1, bounds.width)));\n schedule();\n }, { passive: true });\n cover.addEventListener('pointerleave', () => { progress = 0.5; schedule(); });\n window.addEventListener('resize', schedule);\n window.addEventListener('pageshow', schedule);\n window.addEventListener('blur', () => { progress = 0.5; schedule(); });\n reduceMotion.addEventListener('change', schedule);\n desktop.addEventListener('change', schedule);\n schedule();\n})();\n\n(() => {\n const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)');\n if (reduceMotion.matches || !('IntersectionObserver' in window)) return;\n const observer = new window.IntersectionObserver(entries => {\n for (const entry of entries) {\n if (!entry.isIntersecting) continue;\n entry.target.classList.add('is-visible');\n observer.unobserve(entry.target);\n }\n }, { threshold: 0.08 });\n document.querySelectorAll('.organization, .section-heading').forEach(element => {\n element.classList.add('scroll-reveal');\n observer.observe(element);\n });\n reduceMotion.addEventListener('change', () => {\n if (!reduceMotion.matches) return;\n observer.disconnect();\n document.querySelectorAll('.scroll-reveal').forEach(element => element.classList.add('is-visible'));\n });\n})();\n";
3
+ //# sourceMappingURL=sketch-scroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sketch-scroll.d.ts","sourceRoot":"","sources":["../../src/templates/sketch-scroll.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,eAAO,MAAM,kBAAkB,8qGA8E9B,CAAC"}
@@ -0,0 +1,81 @@
1
+ /** Scrub the embedded sketch with horizontal pointer movement without autoplay or runtime dependencies. */
2
+ export const sketchScrollScript = `
3
+ (() => {
4
+ const cover = document.querySelector('.henry-cover');
5
+ const video = document.querySelector('.sketch-art video');
6
+ if (!cover || !video) return;
7
+ const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
8
+ const desktop = window.matchMedia('(min-width: 1024px)');
9
+ let frame = 0;
10
+ let seeking = false;
11
+ let target = 0;
12
+ let progress = 0.5;
13
+
14
+ let initialized = false;
15
+ let lastTime = 0;
16
+ let displayed = 0.5;
17
+ function update(now) {
18
+ frame = 0;
19
+ if (!Number.isFinite(video.duration) || video.duration <= 0) return;
20
+ video.pause();
21
+ const end = Math.max(0, video.duration - 1 / 60);
22
+ const stationary = reduceMotion.matches || !desktop.matches;
23
+ const goal = stationary ? 0.5 : progress;
24
+ const elapsed = lastTime ? Math.min(50, Math.max(1, now - lastTime)) : 16.67;
25
+ lastTime = now;
26
+ // Ease the desired pose independently of the decoder, rather than jumping
27
+ // from the last decoded frame whenever a seek finishes.
28
+ displayed += (goal - displayed) * (1 - Math.exp(-elapsed / 180));
29
+ if (stationary || Math.abs(goal - displayed) < 0.001) displayed = goal;
30
+ target = displayed * end;
31
+ if (!seeking && (!initialized || Math.abs(video.currentTime - target) >= 1 / 120)) {
32
+ seeking = true;
33
+ initialized = true;
34
+ video.currentTime = target;
35
+ }
36
+ if (Math.abs(goal - displayed) >= 0.001) schedule();
37
+ }
38
+
39
+ function schedule() {
40
+ if (!frame) frame = requestAnimationFrame(update);
41
+ }
42
+ video.addEventListener('seeked', () => { seeking = false; schedule(); });
43
+ video.addEventListener('loadedmetadata', schedule);
44
+ video.addEventListener('error', () => { seeking = false; });
45
+ cover.addEventListener('pointermove', event => {
46
+ if (event.pointerType === 'touch') return;
47
+ const bounds = cover.getBoundingClientRect();
48
+ progress = Math.min(1, Math.max(0, (event.clientX - bounds.left) / Math.max(1, bounds.width)));
49
+ schedule();
50
+ }, { passive: true });
51
+ cover.addEventListener('pointerleave', () => { progress = 0.5; schedule(); });
52
+ window.addEventListener('resize', schedule);
53
+ window.addEventListener('pageshow', schedule);
54
+ window.addEventListener('blur', () => { progress = 0.5; schedule(); });
55
+ reduceMotion.addEventListener('change', schedule);
56
+ desktop.addEventListener('change', schedule);
57
+ schedule();
58
+ })();
59
+
60
+ (() => {
61
+ const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
62
+ if (reduceMotion.matches || !('IntersectionObserver' in window)) return;
63
+ const observer = new window.IntersectionObserver(entries => {
64
+ for (const entry of entries) {
65
+ if (!entry.isIntersecting) continue;
66
+ entry.target.classList.add('is-visible');
67
+ observer.unobserve(entry.target);
68
+ }
69
+ }, { threshold: 0.08 });
70
+ document.querySelectorAll('.organization, .section-heading').forEach(element => {
71
+ element.classList.add('scroll-reveal');
72
+ observer.observe(element);
73
+ });
74
+ reduceMotion.addEventListener('change', () => {
75
+ if (!reduceMotion.matches) return;
76
+ observer.disconnect();
77
+ document.querySelectorAll('.scroll-reveal').forEach(element => element.classList.add('is-visible'));
78
+ });
79
+ })();
80
+ `;
81
+ //# sourceMappingURL=sketch-scroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sketch-scroll.js","sourceRoot":"","sources":["../../src/templates/sketch-scroll.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EjC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opensource-showcase",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "description": "CLI tool to curate and showcase your open source contributions",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",