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
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ coverage/
neo-companion.sqlite
apps/desktop/src-tauri/target/
apps/desktop/src-tauri/gen/

# Windows reserved device names that may accidentally materialize as files
# (e.g. when a `> nul` redirection is run in a non-Win32 shell context).
nul
CON
PRN
AUX
NUL
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions apps/desktop/src/assets/companion/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { CompanionState } from "@neo-companion/shared";
import focus from "./companion-focus.png";
import happy from "./companion-happy.png";
import idle from "./companion-idle.png";
import sleepy from "./companion-sleepy.png";
import thinking from "./companion-thinking.png";
import warn from "./companion-warn.png";

export const companionStateImages: Record<CompanionState, string> = {
idle,
focus,
happy,
thinking,
warn,
sleepy,
};
7 changes: 5 additions & 2 deletions apps/desktop/src/components/panel/MiniPetAvatar.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<script setup lang="ts">
import type { CompanionState } from "@neo-companion/shared";
import { companionStateImages } from "../../assets/companion";

defineProps<{
state: string;
state: CompanionState;
}>();
</script>

<template>
<div class="mini-pet-avatar" :data-state="state">
<img src="../../assets/companion/companion-full.png" alt="" />
<img :src="companionStateImages[state]" alt="" />
</div>
</template>
35 changes: 23 additions & 12 deletions apps/desktop/src/components/panel/TopNav.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<script setup lang="ts">
import type { CompanionState } from "@neo-companion/shared";
import { companionStateImages } from "../../assets/companion";

defineProps<{
petState: CompanionState; // TODO: Phase 2 — use for dynamic avatar state
petState: CompanionState;
isDark: boolean;
}>();

Expand All @@ -16,19 +17,11 @@ const emit = defineEmits<{
<nav class="panel-topnav" data-tauri-drag-region>
<!-- Pet avatar button -->
<button
class="icon-btn"
class="icon-btn companion-avatar-button"
type="button"
style="padding: 0; overflow: hidden"
:style="{
background: 'radial-gradient(circle at 30% 30%, #ffe0a3, #ffb347 55%, #c2410c 100%)',
boxShadow: '0 6px 20px rgba(255,140,40,.35), inset 0 1px 0 rgba(255,255,255,.6)',
}"
aria-label="NeoCompanion 当前状态"
>
<span style="position: relative; width: 48px; height: 48px; display: block">
<span style="position: absolute; left: 14px; top: 18px; width: 4px; height: 6px; background: #3b1f0a; border-radius: 2px"></span>
<span style="position: absolute; right: 14px; top: 18px; width: 4px; height: 6px; background: #3b1f0a; border-radius: 2px"></span>
<span style="position: absolute; left: 50%; bottom: 14px; width: 14px; height: 5px; border: 2px solid #3b1f0a; border-top: 0; border-radius: 0 0 12px 12px; transform: translateX(-50%)"></span>
</span>
<img class="companion-avatar-image" :src="companionStateImages[petState]" alt="" />
</button>

<!-- Theme toggle + Settings -->
Expand Down Expand Up @@ -57,3 +50,21 @@ const emit = defineEmits<{
</button>
</nav>
</template>

<style scoped>
.companion-avatar-button {
padding: 2px;
overflow: hidden;
background: radial-gradient(circle at 50% 58%, #fff1b8, #f6b24e 62%, #c95d1b 100%);
box-shadow:
0 6px 20px rgba(255, 140, 40, 0.35),
inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.companion-avatar-image {
display: block;
width: 44px;
height: 44px;
object-fit: contain;
}
</style>
4 changes: 2 additions & 2 deletions apps/desktop/src/components/pet/PetStage.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import type { CompanionState } from "@neo-companion/shared";
import companionFull from "../../assets/companion/companion-full.png";
import { companionStateImages } from "../../assets/companion";

defineProps<{
state: CompanionState;
Expand All @@ -16,6 +16,6 @@ const emit = defineEmits<{
<button class="pet-stage" type="button" aria-label="打开 NeoCompanion 面板" @click="emit('click')" @contextmenu.prevent="emit('contextmenu', $event)">
<span class="pet-ambient-glow" aria-hidden="true"></span>
<span class="pet-aura"></span>
<img class="companion-image" :src="companionFull" alt="NeoCompanion 桌宠" />
<img class="companion-image" :src="companionStateImages[state]" alt="NeoCompanion 桌宠" />
</button>
</template>
4 changes: 2 additions & 2 deletions apps/desktop/src/styles/pet.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
z-index: 1;
display: block;
width: auto;
max-width: min(88%, 250px);
max-width: min(94%, 280px);
max-height: 390px;
object-fit: contain;
object-position: center bottom;
Expand Down Expand Up @@ -302,7 +302,7 @@

@media (max-width: 760px) {
.companion-image {
max-width: min(86%, 230px);
max-width: min(94%, 280px);
}
}

Expand Down
Loading