This commit is contained in:
wataru 2023-02-17 03:47:43 +09:00
parent 84e7ed0c91
commit eab6d2abea
7 changed files with 29 additions and 19 deletions

BIN
client/demo/dist/assets/buymeacoffee.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -36,6 +36,9 @@ const App = () => {
<img src="./assets/icons/help-circle.svg" /> <img src="./assets/icons/help-circle.svg" />
<span>manual</span> <span>manual</span>
</a> </a>
<a className="link" href="https://www.buymeacoffee.com/wokad" target="_blank" rel="noopener noreferrer">
<img className="donate-img" src="./assets/buymeacoffee.png" />
</a>
</span> </span>
<span className="belongings"> <span className="belongings">

View File

@ -1,5 +1,4 @@
import { ClientState, useClient } from "@dannadori/voice-changer-client-js" import { ClientState, useClient } from "@dannadori/voice-changer-client-js"
import { useEffect, useState } from "react"
import { AUDIO_ELEMENT_FOR_PLAY_RESULT } from "../const" import { AUDIO_ELEMENT_FOR_PLAY_RESULT } from "../const"
export type UseVCClientProps = { export type UseVCClientProps = {

View File

@ -497,3 +497,8 @@ body {
width: 50%; width: 50%;
} }
} }
.donate-img {
border-radius: 35px;
height: 2rem;
}

View File

@ -4,31 +4,34 @@ from sio.MMVC_SocketIOServer import MMVC_SocketIOServer
from voice_changer.VoiceChangerManager import VoiceChangerManager from voice_changer.VoiceChangerManager import VoiceChangerManager
from const import frontend_path from const import frontend_path
class MMVC_SocketIOApp(): class MMVC_SocketIOApp():
@classmethod @classmethod
def get_instance(cls, app_fastapi, voiceChangerManager:VoiceChangerManager): def get_instance(cls, app_fastapi, voiceChangerManager: VoiceChangerManager):
if not hasattr(cls, "_instance"): if not hasattr(cls, "_instance"):
sio = MMVC_SocketIOServer.get_instance(voiceChangerManager) sio = MMVC_SocketIOServer.get_instance(voiceChangerManager)
app_socketio = socketio.ASGIApp( app_socketio = socketio.ASGIApp(
sio, sio,
other_asgi_app=app_fastapi, other_asgi_app=app_fastapi,
static_files={ static_files={
'/assets/icons/github.svg': { '/assets/icons/github.svg': {
'filename': f'{frontend_path}/assets/icons/github.svg', 'filename': f'{frontend_path}/assets/icons/github.svg',
'content_type': 'image/svg+xml' 'content_type': 'image/svg+xml'
}, },
'/assets/icons/help-circle.svg': { '/assets/icons/help-circle.svg': {
'filename': f'{frontend_path}/assets/icons/help-circle.svg', 'filename': f'{frontend_path}/assets/icons/help-circle.svg',
'content_type': 'image/svg+xml' 'content_type': 'image/svg+xml'
}, },
'': f'{frontend_path}', '/buymeacoffee.png': {
'filename': f'{frontend_path}/assets/buymeacoffee.png',
'content_type': 'image/png'
},
'': f'{frontend_path}',
'/': f'{frontend_path}/index.html', '/': f'{frontend_path}/index.html',
} }
) )
cls._instance = app_socketio cls._instance = app_socketio
return cls._instance return cls._instance
return cls._instance return cls._instance