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
Binary file added .github/pr-assets/studio-companion/en-390.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/pr-assets/studio-companion/zh-1440.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"dependencies": {
"@astryxdesign/core": "^0.6.5",
"@astryxdesign/theme-neutral": "^0.6.5",
"@botharness/pixel-avatar": "^0.10.0",
"@botharness/pixel-avatar": "^0.10.2",
"@botharness/pixel-banner": "^0.1.0",
"@botharness/pixel-morph": "^0.2.0",
"@fontsource/fusion-pixel-12px-proportional-sc": "^5.3.0",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ allowBuilds:

# Our own BotPixel packages are trusted the day they are published.
minimumReleaseAgeExclude:
- '@botharness/pixel-avatar@0.10.0'
- '@botharness/pixel-avatar@0.10.2'
- '@botharness/pixel-morph@0.1.0 || 0.2.0'
- '@botharness/pixel-banner@0.1.0'
6 changes: 5 additions & 1 deletion src/AvatarApp.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Theme } from '@astryxdesign/core/theme';
import { useEffect, useState } from 'react';
import { useAvatarDesign } from './avatarDesign';
import { BotCompanion } from './components/BotCompanion';
import { Playground } from './components/Playground';
import { SiteHeader } from './components/SiteHeader';
import { COPY, LINKS } from './content';
Expand All @@ -9,7 +10,8 @@ import { pixelTheme } from './theme';

/**
* The Avatar Studio at /avatar: the stage, the part editor and the color and shape panel side by
* side. The design is the same one the home page shows, kept in this browser.
* side, with the companion walking along the bottom in the design being edited. The design is the
* same one the home page shows, kept in this browser.
*/
export function AvatarApp() {
const lang = pathLang();
Expand Down Expand Up @@ -50,6 +52,8 @@ export function AvatarApp() {
· <a href={lang === 'zh' ? '/privacy/' : '/en/privacy/'}>{copy.footer.privacy}</a>
</p>
</footer>
{/* the same companion as on the home page, wearing the design as it is edited */}
<BotCompanion lang={lang} design={design} />
</Theme>
);
}
7 changes: 4 additions & 3 deletions src/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export function normalizeRef(url: URL): URL | null {
export function pageKind(pathname: string) {
const path = pathname.replace(/^\/en(?=\/|$)/, '') || '/';
if (path === '/') return 'home';
const first = path.split('/')[1] ?? '';
// dev and direct links may name the file (/avatar.html) where the site serves /avatar
const first = (path.split('/')[1] ?? '').replace(/\.html$/, '');
return ['market', 'avatar', 'docs', 'privacy', 'changelog'].includes(first) ? first : 'other';
}

Expand Down Expand Up @@ -116,8 +117,8 @@ function consentBar(posthog: PostHog, register: () => void) {
posthog.capture('$pageview', utm, { $set_once: initial });
},
);
// The React homepage asks through its Bot; generated pages retain their consent region.
if (status !== 'pending' || pageKind(location.pathname) === 'home') return;
// The home page and the Avatar Studio ask through their Bot; other pages keep the consent bar.
if (status !== 'pending' || ['home', 'avatar'].includes(pageKind(location.pathname))) return;
const t = CONSENT_COPY[pathLang()];
const bar = document.createElement('div');
bar.className = 'consent-bar frame';
Expand Down
3 changes: 0 additions & 3 deletions src/components/FaceEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ function colorShown(recipe: Recipe, fields: Fields, key: string): boolean {
const [field, slot] = piece;
const value = fields[field] ?? (field === 'rightSideHair' ? fields.sideHair : undefined);
if (field === 'strand') return value !== undefined && value !== 'none';
// BotPixel 0.10 draws bun and odango back hair in the hair color, ignoring backHairColor
if (field === 'backHair' && (value === 'bun' || value === 'odango'))
return wornPart(recipe, slot) !== undefined;
return (value !== undefined && value !== 'none') || wornPart(recipe, slot) !== undefined;
}

Expand Down
Loading