raliz #1
@ -1,5 +1,4 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import dynamic from "next/dynamic";
|
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import "@/deps/live2d.min.js";
|
import "@/deps/live2d.min.js";
|
||||||
import useVoice2Txt from "@/hooks/useVoice2txt";
|
import useVoice2Txt from "@/hooks/useVoice2txt";
|
||||||
@ -7,6 +6,7 @@ import useTxt2Voice from "@/hooks/useTxt2Voice";
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import * as PIXI from "pixi.js";
|
import * as PIXI from "pixi.js";
|
||||||
import { Live2DModel } from "pixi-live2d-display/cubism2";
|
import { Live2DModel } from "pixi-live2d-display/cubism2";
|
||||||
|
import { useSearchParams } from "next/navigation";
|
||||||
|
|
||||||
// fake list
|
// fake list
|
||||||
const opList = [
|
const opList = [
|
||||||
@ -35,7 +35,21 @@ const opList = [
|
|||||||
//import "@/deps/live2dcubismcore.min.js"
|
//import "@/deps/live2dcubismcore.min.js"
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
const [useVoice, setUseVoice] = useState(false);
|
const [useVoice, setUseVoice] = useState(false);
|
||||||
|
const query = useSearchParams();
|
||||||
|
const characterId = query.get("id");
|
||||||
|
const token = query.get("token");
|
||||||
|
const voice2txt = (txt: string) => {
|
||||||
|
fetch("xxxx/voice/txt2voice", {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Authorization": `${token}`,
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
txt: txt,
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
}
|
||||||
function draggable(model: any) {
|
function draggable(model: any) {
|
||||||
model.buttonMode = true;
|
model.buttonMode = true;
|
||||||
model.on("pointerdown", (e: any) => {
|
model.on("pointerdown", (e: any) => {
|
||||||
@ -60,8 +74,6 @@ export default function Home() {
|
|||||||
foreground.alpha = 0.2;
|
foreground.alpha = 0.2;
|
||||||
|
|
||||||
model.addChild(foreground);
|
model.addChild(foreground);
|
||||||
// 这里先叉了
|
|
||||||
// checkbox("Model Frames", (checked: any) => (foreground.visible = checked));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addHitAreaFrames(model: any) {
|
function addHitAreaFrames(model: any) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user