|
33 | 33 | setTimeout(() => (copied = false), 2000); |
34 | 34 | } |
35 | 35 |
|
| 36 | + function getCurlCommand() { |
| 37 | + if (config.alias) { |
| 38 | + return `curl -fsSL openboot.dev/${config.alias} | bash`; |
| 39 | + } |
| 40 | + return `curl -fsSL openboot.dev/${configUser.username}/${config.slug} | bash`; |
| 41 | + } |
| 42 | +
|
| 43 | + let curlCopied = $state(false); |
| 44 | +
|
| 45 | + function copyCurlCommand() { |
| 46 | + navigator.clipboard.writeText(getCurlCommand()); |
| 47 | + curlCopied = true; |
| 48 | + setTimeout(() => (curlCopied = false), 2000); |
| 49 | + } |
| 50 | +
|
36 | 51 | function getShareUrl() { |
37 | 52 | if (config.alias) { |
38 | 53 | return `https://openboot.dev/${config.alias}`; |
|
217 | 232 | {/if} |
218 | 233 | </button> |
219 | 234 | </div> |
220 | | - <div class="install-actions"> |
| 235 | + <div class="curl-alt"> |
| 236 | + <span class="curl-label">Alternative:</span> |
| 237 | + <code>{getCurlCommand()}</code> |
| 238 | + <button class="copy copy-curl" onclick={copyCurlCommand}> |
| 239 | + {#if curlCopied} |
| 240 | + <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg> |
| 241 | + {:else} |
| 242 | + <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg> |
| 243 | + {/if} |
| 244 | + </button> |
| 245 | + </div> |
| 246 | + <div class="install-actions"> |
221 | 247 | <button class="share-inline" onclick={openShareModal}> |
222 | 248 | <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/></svg> |
223 | 249 | Share |
|
677 | 703 | text-align: left; |
678 | 704 | } |
679 | 705 |
|
| 706 | + .curl-alt { |
| 707 | + display: flex; |
| 708 | + align-items: center; |
| 709 | + gap: 8px; |
| 710 | + margin-bottom: 12px; |
| 711 | + padding: 0 4px; |
| 712 | + } |
| 713 | +
|
| 714 | + .curl-label { |
| 715 | + font-size: 0.85rem; |
| 716 | + color: var(--text-tertiary); |
| 717 | + white-space: nowrap; |
| 718 | + } |
| 719 | +
|
| 720 | + .curl-alt code { |
| 721 | + font-family: 'JetBrains Mono', monospace; |
| 722 | + font-size: 0.85rem; |
| 723 | + color: var(--text-secondary); |
| 724 | + flex: 1; |
| 725 | + text-align: left; |
| 726 | + } |
| 727 | +
|
| 728 | + .copy-curl { |
| 729 | + padding: 6px 10px; |
| 730 | + } |
| 731 | +
|
680 | 732 | .copy { |
681 | 733 | display: flex; |
682 | 734 | align-items: center; |
|
1493 | 1545 | text-align: center; |
1494 | 1546 | } |
1495 | 1547 |
|
| 1548 | + .curl-alt { |
| 1549 | + flex-direction: column; |
| 1550 | + text-align: center; |
| 1551 | + } |
| 1552 | +
|
| 1553 | + .curl-alt code { |
| 1554 | + text-align: center; |
| 1555 | + } |
| 1556 | +
|
1496 | 1557 | .copy { |
1497 | 1558 | width: 100%; |
1498 | 1559 | justify-content: center; |
|
0 commit comments