添加 krg 表情差分
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-03-02 13:49:31 +08:00
parent 41f3eedcbe
commit 6c5e5a7a0c
6 changed files with 15 additions and 3 deletions

BIN
src/lib/assets/krgblush.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

BIN
src/lib/assets/krgcry.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

BIN
src/lib/assets/krghungry.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

BIN
src/lib/assets/krgsay.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

View File

@ -1,17 +1,29 @@
<script lang="ts">
import { onMount } from "svelte";
import krgsay from "$lib/assets/krgsay.png";
import krgsay from "$lib/assets/krgsay.jpg";
import krgcry from "$lib/assets/krgcry.png";
import krghungry from "$lib/assets/krghungry.png";
import krgblush from "$lib/assets/krgblush.png";
let content = '嗨小朋友们大家好!\n你们认识我是谁吗';
let style = 'say';
let images = {
'say': krgsay,
'cry': krgcry,
'hungry': krghungry,
'blush': krgblush
};
onMount(async () => {
(window as any)['setContent'] = (_content: string) => {
(window as any)['setContent'] = (_content: string, _style: string = "say") => {
content = _content;
style = _style;
};
});
</script>
<div id="main" style={`background-image: url(${krgsay}); width: 800px; height: 800px; margin: 20px;`}>
<div id="main" style={`background-image: url(${images[style]}); background-size: contain; width: 800px; height: 800px; margin: 20px;`}>
<div class="inner">{ content }</div>
</div>