Skip to content
Merged
69 changes: 1 addition & 68 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@
"astro": "astro"
},
"dependencies": {
"astro": "^7.3.1",
"three": "^0.185.1"
"astro": "^7.3.1"
},
"allowScripts": {
"esbuild": true
},
"devDependencies": {
"@types/three": "^0.185.4"
}
}
6 changes: 4 additions & 2 deletions web/src/components/DesktopSimulator.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
*
* Implements hardware-accelerated CSS 3D transforms, multi-window concurrency (VS Code & Terminal),
* authentic FlowSnap Menu Bar popover, Windows 11-style top-edge layout picker with true 70/30 proportions,
* liquid glass HUD snap preview, and buttery 120 FPS pointer drag physics.
* liquid glass HUD snap preview, and 60 FPS pointer drag physics, paced by
* LiveResizeThrottler at ~16.6ms to match the shipped app.
*/
import { getI18n, type Locale } from '../i18n';
import { RELEASE_METADATA } from '../data/distribution-data';
import '../styles/desktop-simulator.css';

interface Props {
Expand Down Expand Up @@ -232,7 +234,7 @@ const t = getI18n(lang);
<div class="popover-header">
<div class="popover-title-row">
<span class="popover-brand">{t.simulator.menuTitle}</span>
<span class="popover-badge">v1.3.1</span>
<span class="popover-badge">{RELEASE_METADATA.version}</span>
</div>
<span class="popover-focus-label">{t.simulator.targetLabel} <strong id="popover-target-name">SnapEngine.swift</strong></span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/DistributionHub.astro
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const { lang = 'en' } = Astro.props;
gap: 24px;
}

/* Tier 1: Unified 3-Tab Hero Card Section */
/* Tier 1: Unified 2-Tab Hero Card Section */
.hub-hero-section {
width: 100%;
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/GatekeeperGuide.astro
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const t = getI18n(lang);
<div class="summary-text-group">
<div class="title-row">
<span class="summary-title">{t.distribution.gatekeeper.title}</span>
<span class="gatekeeper-badge">Gatekeeper Help</span>
<span class="gatekeeper-badge">{t.distribution.gatekeeper.badge}</span>
</div>
<span class="summary-hint">{t.distribution.gatekeeper.hint}</span>
</div>
Expand Down
3 changes: 2 additions & 1 deletion web/src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import ThemeToggle from './ThemeToggle.astro';
import { getI18n, type Locale } from '../i18n';
import { RELEASE_METADATA } from '../data/distribution-data';

interface Props {
version?: string;
Expand All @@ -9,7 +10,7 @@ interface Props {
}

const {
version = 'v1.3.1',
version = RELEASE_METADATA.version,
githubUrl = 'https://github.com/ahauy/FlowSnap',
lang = 'en',
} = Astro.props;
Expand Down
12 changes: 12 additions & 0 deletions web/src/components/ShortcutMatrix.astro
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const counts = {
aria-label="Interactive Keyboard Shortcuts Matrix"
data-copy-label={t.shortcuts.controls.copyLabel}
data-copied-label={t.shortcuts.controls.copiedLabel}
data-copy-fail-label={t.clipboard.copyFail}
data-show-all-label={t.shortcuts.controls.showAll}
data-show-fewer-label={t.shortcuts.controls.showFewer}
>
Expand Down Expand Up @@ -157,6 +158,7 @@ const counts = {
</div>

<!-- Zero-Match Empty State -->
<div class="sr-only" aria-live="polite" id="shortcut-copy-status"></div>
<div id="shortcut-empty-state" class="empty-state-card" aria-live="polite" hidden>
<div class="empty-icon-wrap">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="28" height="28" aria-hidden="true">
Expand Down Expand Up @@ -201,6 +203,8 @@ const counts = {

const copyLabel = root.getAttribute('data-copy-label') || 'Copy';
const copiedLabel = root.getAttribute('data-copied-label') || 'Copied!';
const copyFailLabel = root.getAttribute('data-copy-fail-label') || 'Copy failed.';
const copyStatus = root.querySelector<HTMLElement>('#shortcut-copy-status');
const showAllLabel = root.getAttribute('data-show-all-label') || 'Show all 15 shortcuts';
const showFewerLabel = root.getAttribute('data-show-fewer-label') || 'Show fewer shortcuts';

Expand Down Expand Up @@ -361,8 +365,16 @@ const counts = {
if (label) label.textContent = copyLabel;
}, 1500);
}
if (copyStatus) {
copyStatus.textContent = copiedLabel;
setTimeout(() => { copyStatus.textContent = ''; }, 1500);
}
} catch (err) {
console.warn('Clipboard write failed:', err);
if (copyStatus) {
copyStatus.textContent = copyFailLabel;
setTimeout(() => { copyStatus.textContent = ''; }, 4000);
}
}
}

Expand Down
30 changes: 0 additions & 30 deletions web/src/data/distribution-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,7 @@ export interface PrivacyPillarItem {
}

export interface GatekeeperGuideData {
readonly title: string;
readonly summary: string;
readonly command: string;
readonly steps: readonly {
readonly stepNumber: number;
readonly title: string;
readonly instruction: string;
}[];
}

export const RELEASE_METADATA: ReleaseMetadata = {
Expand Down Expand Up @@ -112,28 +105,5 @@ export const PRIVACY_PILLARS: readonly PrivacyPillarItem[] = [
];

export const GATEKEEPER_DATA: GatekeeperGuideData = {
title: 'Encountered macOS Gatekeeper "Unidentified Developer" Warning?',
summary:
"Because FlowSnap is an open-source community utility without Apple Developer Program signing, macOS applies a quarantine flag on first launch.",
command: "xattr -cr /Applications/FlowSnap.app",
steps: [
{
stepNumber: 1,
title: "Drag FlowSnap to Applications",
instruction:
"Open the downloaded FlowSnap.dmg and drag the FlowSnap icon into your /Applications directory as usual.",
},
{
stepNumber: 2,
title: "Remove quarantine attribute via Terminal",
instruction:
"Copy and paste the command below into Terminal, then press Enter to remove the com.apple.quarantine attribute.",
},
{
stepNumber: 3,
title: "Launch and grant Accessibility permissions",
instruction:
"Open FlowSnap from Spotlight or Launchpad, then grant Accessibility access when prompted to enable window snapping.",
},
],
};
4 changes: 3 additions & 1 deletion web/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@
"summary": "Because FlowSnap is community-driven open source (without a commercial paid Apple Developer certificate), macOS applies quarantine flags on first launch.",
"hint": "Two ways through: right-click Open needs no Terminal",
"toggleLabel": "Details",
"badge": "Gatekeeper Help",
"command": "xattr -cr /Applications/FlowSnap.app",
"copyAria": "Copy xattr command to clipboard",
"steps": [
Expand Down Expand Up @@ -478,6 +479,7 @@
"switchToVietnamese": "Switch to Tiếng Việt",
"viewGitHub": "View FlowSnap on GitHub",
"toggleTheme": "Toggle color theme",
"backToTop": "Back to top"
"backToTop": "Back to top",
"skipToContent": "Skip to main content"
}
}
6 changes: 4 additions & 2 deletions web/src/i18n/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
},
{
"id": "telemetry",
"title": "Zero Telemetry & Tracking",
"title": "Không Thu Thập Dữ Liệu & Theo Dõi",
"badge": "Không SDK Theo dõi",
"description": "Tuyệt đối không thu thập dữ liệu phân tích hành vi, thống kê hay thông tin cá nhân của người dùng.",
"details": [
Expand All @@ -302,6 +302,7 @@
"summary": "Vì FlowSnap là phần mềm mã nguồn mở cộng đồng phi thương mại (không mua chứng chỉ Apple Developer trả phí), macOS sẽ gắn thuộc tính cách ly (quarantine) trong lần đầu mở app.",
"hint": "Hai cách vượt qua: click chuột phải rồi chọn Mở, không cần Terminal",
"toggleLabel": "Chi tiết",
"badge": "Trợ giúp Gatekeeper",
"command": "xattr -cr /Applications/FlowSnap.app",
"copyAria": "Sao chép lệnh xattr vào clipboard",
"steps": [
Expand Down Expand Up @@ -478,6 +479,7 @@
"switchToVietnamese": "Chuyển sang tiếng Việt",
"viewGitHub": "Xem FlowSnap trên GitHub",
"toggleTheme": "Đổi màu giao diện",
"backToTop": "Lên đầu trang"
"backToTop": "Lên đầu trang",
"skipToContent": "Bỏ qua tới nội dung chính"
}
}
10 changes: 8 additions & 2 deletions web/src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
import '../styles/design-tokens.css';
import { getI18n } from '../i18n';
import { RELEASE_METADATA } from '../data/distribution-data';

interface Props {
title?: string;
Expand Down Expand Up @@ -45,14 +47,15 @@ const absoluteOgImage = ogImage.startsWith('http')
? ogImage
: `${siteUrl}${basePath || '/FlowSnap'}/${ogImage.replace(/^\//, '')}`;
const ogLocale = lang === 'vi' ? 'vi_VN' : 'en_US';
const t = getI18n(lang);

const jsonLdSchema = {
'@context': 'https://schema.org',
'@type': 'SoftwareApplication',
name: 'FlowSnap',
operatingSystem: 'macOS 14.0+',
applicationCategory: 'UtilitiesApplication',
softwareVersion: '1.3.1',
softwareVersion: RELEASE_METADATA.version,
description: description,
url: canonical,
downloadUrl: 'https://github.com/ahauy/FlowSnap/releases/latest/download/FlowSnap.dmg',
Expand All @@ -72,7 +75,9 @@ const jsonLdSchema = {
---

<!doctype html>
<html lang={lang} data-theme="dark">
<!-- No data-theme here on purpose: the attribute would outrank the
prefers-color-scheme block in design-tokens.css for visitors without JS. -->
<html lang={lang}>
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/svg+xml" href={`${basePath || ''}/favicon.svg`} />
Expand Down Expand Up @@ -140,6 +145,7 @@ const jsonLdSchema = {
</script>
</head>
<body>
<a class="skip-link" href="#main-content">{t.a11y.skipToContent}</a>
<slot />
</body>
</html>
Loading
Loading