import './style.css' import { escapeHtml, resolveSiteConfig } from './site-config.js' const site = resolveSiteConfig(import.meta.env, window.__SITE_CONFIG__) document.title = site.title for (const [selector, content] of [ ['meta[name="description"]', site.metaDescription], ['meta[property="og:title"]', site.title], ['meta[property="og:description"]', site.metaDescription], ]) { document.querySelector(selector).content = content } function registrationItem(number, url) { if (!number) return '' return url ? `${escapeHtml(number)}` : `${escapeHtml(number)}` } const registrationItems = registrationItem(site.icpNumber, site.icpUrl) + registrationItem(site.publicSecurityNumber, site.publicSecurityUrl) const arrow = '' const spark = '' document.querySelector('#app').innerHTML = `

A LITTLE PATIENCE. A LOT TO LOOK FORWARD TO.

美好的事,
即将发生。

${escapeHtml(site.description).replace(/\r?\n/g, '
')}

看看我们在做什么
✳好东西,值得等一等。
FIG. 001让想象,慢慢成形。
01 / WHAT'S NEXT

每一步,都离见面更近。

  1. 从一个想法开始

    让灵感有了方向

    已启程
  2. 把细节变成惊喜

    用心打磨,渐入佳境

    进行中
  3. 然后,与你相遇

    敬请期待正式上线

    即将到来
${spark}

把期待,传递出去。

复制下方链接,分享给同样保持好奇的人。

` const clock = document.querySelector('#clock') const timeFormatter = new Intl.DateTimeFormat('en-GB', { timeZone: 'Asia/Shanghai', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false, }) function updateClock() { const now = new Date() clock.textContent = timeFormatter.format(now) clock.dateTime = now.toISOString() } updateClock() setInterval(updateClock, 1000) let toastTimeout function showToast(message) { const toast = document.querySelector('#toast') clearTimeout(toastTimeout) toast.textContent = message toast.classList.add('is-visible') toastTimeout = setTimeout(() => toast.classList.remove('is-visible'), 3500) } const shareDialog = document.querySelector('#share-dialog') const shareInput = document.querySelector('#share-url') const shareUrl = new URL(window.location.href) shareUrl.hash = '' shareInput.value = shareUrl.href async function copyLink() { if (!navigator.clipboard?.writeText) return false try { await navigator.clipboard.writeText(shareUrl.href) return true } catch { return false } } document.querySelector('#share-button').addEventListener('click', async () => { if (navigator.share) { try { await navigator.share({ title: site.title, text: site.metaDescription, url: shareUrl.href, }) return } catch (error) { if (error.name === 'AbortError') return } } if (await copyLink()) { showToast('链接已复制,把这份期待分享出去吧。') } else { document.querySelector('#dialog-hint').textContent = '' shareDialog.showModal() shareInput.focus() shareInput.select() } }) document.querySelector('#dialog-copy').addEventListener('click', async () => { if (await copyLink()) { shareDialog.close() showToast('链接已复制,把这份期待分享出去吧。') } else { shareInput.focus() shareInput.select() const shortcut = /Mac|iPhone|iPad/.test(navigator.userAgent) ? '⌘ C' : 'Ctrl + C' document.querySelector('#dialog-hint').textContent = `链接已选中,请按 ${shortcut} 或长按链接复制。` } }) document.querySelector('#dialog-close').addEventListener('click', () => shareDialog.close()) shareDialog.addEventListener('click', (event) => { if (event.target !== shareDialog) return const rect = shareDialog.getBoundingClientRect() if (event.clientX < rect.left || event.clientX > rect.right || event.clientY < rect.top || event.clientY > rect.bottom) { shareDialog.close() } })