easter-egg-quest 1.0.17 → 1.0.18

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.
@@ -82,19 +82,14 @@ const DEFAULT_SCRIPT = {
82
82
  ],
83
83
  stage3Success: [
84
84
  "rhythm was the answer",
85
- "not stopping, not rushing",
86
- "but the dance between them",
87
- "the third egg appears",
88
- "for those who breathe"
85
+ "you found the third egg",
86
+ "nice work"
89
87
  ],
90
88
  // ── Finale ────────────────────────────────────────────────────────────
91
89
  finale: [
92
- "you were looking for three eggs",
93
- "but you found something else",
94
- "stillness",
95
- "motion",
96
- "rhythm",
97
- "this is where life appears"
90
+ "all three eggs found",
91
+ "stillness, motion, rhythm",
92
+ "that's the whole set"
98
93
  ],
99
94
  // ── Results / Share ───────────────────────────────────────────────────
100
95
  results: [
@@ -3724,16 +3719,16 @@ const _ResultsRenderer = class _ResultsRenderer {
3724
3719
  inner.appendChild(badgesDiv);
3725
3720
  const invite = document.createElement("div");
3726
3721
  invite.className = "eeq-share-invite";
3727
- invite.textContent = "share your result with friends 🥚";
3722
+ invite.textContent = "share or copy your result";
3728
3723
  inner.appendChild(invite);
3729
3724
  const actions = document.createElement("div");
3730
3725
  actions.className = "eeq-results-actions";
3731
3726
  const shareBtn = document.createElement("button");
3732
3727
  shareBtn.className = "eeq-btn eeq-btn-share";
3733
- shareBtn.title = "share result";
3728
+ shareBtn.title = "share or copy result";
3734
3729
  shareBtn.innerHTML = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M4.5 10.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm7-4a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0 8a2 2 0 1 1 0-4 2 2 0 0 1 0 4z" stroke="currentColor" stroke-width="1.2"/><path d="M6.3 9.2l3.4 1.6M6.3 7.8l3.4-1.6" stroke="currentColor" stroke-width="1.2"/></svg>';
3735
3730
  const shareLabel = document.createElement("span");
3736
- shareLabel.textContent = "share";
3731
+ shareLabel.textContent = "share / copy";
3737
3732
  shareBtn.appendChild(shareLabel);
3738
3733
  actions.appendChild(shareBtn);
3739
3734
  const finishBtn = document.createElement("button");
@@ -3967,6 +3962,7 @@ const _ResultsRenderer = class _ResultsRenderer {
3967
3962
  _copyShareImage(s) {
3968
3963
  var _a2;
3969
3964
  const canvas = this._renderCard(s);
3965
+ const shareText = this._buildShareText(s);
3970
3966
  const dataUrl = canvas.toDataURL("image/png");
3971
3967
  const byteString = atob(dataUrl.split(",")[1]);
3972
3968
  const ab = new ArrayBuffer(byteString.length);
@@ -3980,17 +3976,35 @@ const _ResultsRenderer = class _ResultsRenderer {
3980
3976
  navigator.share({
3981
3977
  files: [file],
3982
3978
  title: "Easter Egg Quest",
3983
- text: `«${s.behaviorProfile.title}»`
3979
+ text: shareText
3984
3980
  }).catch(() => {
3985
3981
  });
3986
3982
  return;
3987
3983
  }
3984
+ navigator.share({
3985
+ title: "Easter Egg Quest",
3986
+ text: shareText
3987
+ }).catch(() => {
3988
+ });
3989
+ return;
3988
3990
  }
3989
3991
  if (navigator.clipboard && typeof ClipboardItem !== "undefined") {
3990
3992
  navigator.clipboard.write([
3991
3993
  new ClipboardItem({ "image/png": blob })
3992
3994
  ]).then(() => {
3993
- this._flashButton(".eeq-btn-share", "copied!");
3995
+ this._flashButton(".eeq-btn-share", "image copied");
3996
+ }).catch(() => {
3997
+ this._copyShareText(shareText, blob);
3998
+ });
3999
+ return;
4000
+ }
4001
+ this._copyShareText(shareText, blob);
4002
+ }
4003
+ _copyShareText(text, blob) {
4004
+ var _a2;
4005
+ if ((_a2 = navigator.clipboard) == null ? void 0 : _a2.writeText) {
4006
+ navigator.clipboard.writeText(text).then(() => {
4007
+ this._flashButton(".eeq-btn-share", "text copied");
3994
4008
  }).catch(() => {
3995
4009
  this._downloadBlob(blob);
3996
4010
  });
@@ -3998,6 +4012,11 @@ const _ResultsRenderer = class _ResultsRenderer {
3998
4012
  }
3999
4013
  this._downloadBlob(blob);
4000
4014
  }
4015
+ _buildShareText(s) {
4016
+ const time = formatTime(s.totalTime);
4017
+ const eggs = `${s.eggsFound}/3 eggs`;
4018
+ return `Easter Egg Quest: ${s.behaviorProfile.title} • ${time} • ${eggs}`;
4019
+ }
4001
4020
  _downloadBlob(blob) {
4002
4021
  const url = URL.createObjectURL(blob);
4003
4022
  const a = document.createElement("a");
@@ -4077,10 +4096,10 @@ const _ResultsRenderer = class _ResultsRenderer {
4077
4096
  ctx.fillText(labels.join(" · "), W / 2, divY + 92);
4078
4097
  ctx.font = "14px Georgia, serif";
4079
4098
  ctx.fillStyle = "rgba(232,224,214,0.55)";
4080
- ctx.fillText("Happy Easter! 🐰🥚", W / 2, divY + 130);
4099
+ ctx.fillText("All three eggs found", W / 2, divY + 130);
4081
4100
  ctx.font = "11px Georgia, serif";
4082
4101
  ctx.fillStyle = "rgba(232,224,214,0.3)";
4083
- ctx.fillText("Wishing you joy, peace, and light", W / 2, divY + 150);
4102
+ ctx.fillText("Share or copy your result", W / 2, divY + 150);
4084
4103
  ctx.font = "9px Georgia, serif";
4085
4104
  ctx.fillStyle = "rgba(232,224,214,0.12)";
4086
4105
  ctx.fillText("easter egg quest", W / 2, H - 16);