feat(pony): make Ponystalden reachable from game scene; prominent home button

This commit is contained in:
agent
2026-09-28 17:07:58 +00:00
parent 7efb23ff26
commit cd6385a4cc
3 changed files with 44 additions and 1 deletions
+35
View File
@@ -164,6 +164,15 @@ body {
transform: scale(1.05);
}
/* The second, clearly-separate option on the home screen. */
.btn-farm {
background: linear-gradient(135deg, #ff7eb6, #ff5aa3);
color: #ffffff;
font-size: 1.05rem;
margin-top: var(--space-md);
box-shadow: 0 4px 14px rgba(255, 90, 163, 0.4);
}
.btn-back {
background: rgba(255, 255, 255, 0.2);
color: var(--color-white);
@@ -1227,6 +1236,32 @@ body {
gap: var(--space-sm);
}
/* In-game: spread the bar so the Ponystalden button sits left, volume right. */
.game .top-bar {
justify-content: space-between;
}
.topbar-farm {
order: -1;
margin-right: auto;
display: inline-flex;
align-items: center;
gap: 0.35rem;
background: linear-gradient(135deg, #7be05a, #37c06b);
color: #0c3d17;
border: none;
padding: 0.5rem 0.9rem;
border-radius: 999px;
font-size: 0.95rem;
font-weight: 800;
cursor: pointer;
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
.topbar-farm:active {
transform: scale(0.95);
}
/* --- Volume control --- */
.volume-control {
display: flex;
+1
View File
@@ -367,6 +367,7 @@ function App() {
volume={volume}
setVolume={setVolume}
avatarConfig={avatarConfig}
onNavigate={navigateTo}
/>
)}
+8 -1
View File
@@ -17,7 +17,7 @@ import { DEFAULT_APPEARANCE } from '../pixelPony/spriteData';
export default function GameScenePage({
data, onRollDice, onVoiceAnswer, onInteract, rolling = false,
interactionBusy = false, volume, setVolume, avatarConfig,
interactionBusy = false, volume, setVolume, avatarConfig, onNavigate,
}) {
const previousHistoryLength = useRef(data.history?.length || 0);
const [narrationStatus, setNarrationStatus] = useState('idle');
@@ -106,6 +106,13 @@ export default function GameScenePage({
>
<SceneMusic sceneType={volume > 0 ? 'game' : 'none'} />
<div className="top-bar">
<button
className="topbar-farm"
onClick={() => { onNavigate && onNavigate('farm'); }}
aria-label="Gå til Ponystalden og styr ponyen"
>
<span aria-hidden="true">🌾</span> Ponystalden
</button>
<VolumeControl volume={volume} onChange={setVolume} />
</div>
<FloatingBg />