This commit is contained in:
BIN
src/lib/assets/krgblush.png
Executable file
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
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
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
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 |
@ -1,17 +1,29 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount } from "svelte";
|
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 content = '嗨小朋友们大家好!\n你们认识我是谁吗?';
|
||||||
|
let style = 'say';
|
||||||
|
|
||||||
|
let images = {
|
||||||
|
'say': krgsay,
|
||||||
|
'cry': krgcry,
|
||||||
|
'hungry': krghungry,
|
||||||
|
'blush': krgblush
|
||||||
|
};
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
(window as any)['setContent'] = (_content: string) => {
|
(window as any)['setContent'] = (_content: string, _style: string = "say") => {
|
||||||
content = _content;
|
content = _content;
|
||||||
|
style = _style;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
</script>
|
</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 class="inner">{ content }</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user