Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 51 additions & 3 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ button:disabled {
.tutorial-examples {
display: grid;
gap: 12px;
grid-template-columns: 1fr 1fr;
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tutorial-example-card {
background: #f4f1e9;
Expand All @@ -672,8 +672,12 @@ button:disabled {
display: block;
height: 160px;
image-rendering: pixelated;
object-fit: contain;
width: 100%;
}
.tutorial-example-card .tutorial-yoke-preview {
image-rendering: auto;
}
.tutorial-example-card > div {
align-content: start;
border-top: 1px solid var(--line);
Expand Down Expand Up @@ -704,6 +708,29 @@ button:disabled {
justify-self: start;
margin-top: auto;
}
.tutorial-example-card .tutorial-yoke-shortcut {
background: transparent;
border-color: transparent;
box-shadow: none;
color: var(--accent-deep);
font-size: 12px;
font-weight: 600;
margin-top: 7px;
min-height: 28px;
padding: 3px 6px;
text-decoration: underline;
text-underline-offset: 3px;
}
.tutorial-example-card .tutorial-yoke-shortcut:hover:not(:disabled) {
background: var(--accent-soft);
border-color: transparent;
box-shadow: none;
transform: none;
}
.tutorial-example-card .tutorial-yoke-shortcut:focus-visible {
outline: 2px solid var(--accent-deep);
outline-offset: 2px;
}
.tutorial-limit-note {
color: #943f32;
font-size: 11px;
Expand All @@ -717,6 +744,21 @@ button:disabled {
position: fixed;
z-index: 60;
}
.tour-layer-guided {
pointer-events: auto;
}
.yoke-tour-editor {
background: var(--panel);
inset: 0;
overflow: auto;
padding: 18px;
position: fixed;
z-index: 46;
}
.yoke-tour-editor > h2 {
font-size: 16px;
margin: 0 0 12px;
}
.tour-dim {
background: rgba(31, 36, 33, 0.62);
inset: 0;
Expand All @@ -741,10 +783,18 @@ button:disabled {
border-radius: 13px;
box-shadow: 0 18px 48px rgba(28, 34, 30, 0.28);
display: grid;
max-height: calc(100dvh - 24px);
overflow: auto;
padding: 17px;
pointer-events: auto;
position: fixed;
}
.tour-card.tour-card-centered {
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: min(350px, calc(100vw - 24px));
}
.tour-card-progress {
align-items: center;
color: var(--muted);
Expand Down Expand Up @@ -5094,8 +5144,6 @@ select:focus {
border-top: 0;
}
.tour-card {
max-height: calc(100vh - 24px);
overflow: auto;
width: auto;
}
}
Expand Down
3 changes: 3 additions & 0 deletions components/chart-maker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export function ChartMaker({
useState<SelectionClipboard | null>(null);
const [knitModeOpen, setKnitModeOpen] = useState(false);
const [newYokeOpen, setNewYokeOpen] = useState(false);
const [tourFileOpen, setTourFileOpen] = useState(false);
const [patternImporterOpen, setPatternImporterOpen] = useState(false);
const [dimensionDraft, setDimensionDraft] = useSyncedDraft(
`${activeTabId}:${document.width}:${document.height}`,
Expand Down Expand Up @@ -1178,10 +1179,12 @@ export function ChartMaker({
onImportPattern={() => setPatternImporterOpen(true)}
onNewBlank={addTab}
onNewYoke={() => setNewYokeOpen(true)}
tourOpen={tourFileOpen}
tabsFull={tabs.length >= MAX_CHART_TABS}
onNavigateAway={confirmLeavingEditor}
/>
<OnboardingTour
onTourFileOpen={setTourFileOpen}
tabsFull={tabs.length >= MAX_CHART_TABS}
onOpenExample={openTutorialExample}
/>
Expand Down
7 changes: 5 additions & 2 deletions components/export-tools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type Props = {
onNewBlank?: () => void;
onNewYoke?: () => void;
tabsFull?: boolean;
tourOpen?: boolean;
onNavigateAway?: (event: { preventDefault(): void }) => void;
};

Expand Down Expand Up @@ -210,6 +211,7 @@ export function ExportTools({
onNewBlank,
onNewYoke,
tabsFull,
tourOpen = false,
onNavigateAway,
}: Props) {
const inputRef = useRef<HTMLInputElement>(null);
Expand Down Expand Up @@ -354,7 +356,7 @@ export function ExportTools({
/>
<button
className="secondary-button"
aria-expanded={open}
aria-expanded={open || tourOpen}
onClick={() => {
setOpen((value) => !value);
setChoosingChartImage(false);
Expand All @@ -365,7 +367,7 @@ export function ExportTools({
>
File
</button>
{open ? (
{open || tourOpen ? (
<div
className="file-menu-popover"
role="menu"
Expand All @@ -384,6 +386,7 @@ export function ExportTools({
</button>
<button
role="menuitem"
data-tour="new-circular-yoke"
disabled={tabsFull || !onNewYoke}
onClick={() => {
setOpen(false);
Expand Down
Loading
Loading