[feat] added github stars

This commit is contained in:
kwaroran
2023-05-07 23:33:53 +09:00
parent 60fa3558c4
commit d6a1d5dfdb
3 changed files with 15 additions and 2 deletions

View File

@@ -12,6 +12,7 @@
import sendSound from '../../etc/send.mp3' import sendSound from '../../etc/send.mp3'
import {cloneDeep} from 'lodash' import {cloneDeep} from 'lodash'
import { processScript } from "src/ts/process/scripts"; import { processScript } from "src/ts/process/scripts";
import GithubStars from "../Others/GithubStars.svelte";
let messageInput = '' let messageInput = ''
let openMenu = false let openMenu = false
@@ -186,6 +187,7 @@
<div class="h-full w-full flex flex-col overflow-y-auto items-center"> <div class="h-full w-full flex flex-col overflow-y-auto items-center">
<h2 class="text-4xl text-white mb-0 mt-6 font-black">RisuAI</h2> <h2 class="text-4xl text-white mb-0 mt-6 font-black">RisuAI</h2>
<h3 class="text-gray-500 mt-1">Version {appVer}</h3> <h3 class="text-gray-500 mt-1">Version {appVer}</h3>
<GithubStars />
</div> </div>
{:else} {:else}
<div class="h-full w-full flex flex-col-reverse overflow-y-auto relative" on:scroll={(e) => { <div class="h-full w-full flex flex-col-reverse overflow-y-auto relative" on:scroll={(e) => {

View File

@@ -0,0 +1,11 @@
<script lang="ts">
import { isTauri } from "src/ts/globalApi";
</script>
<svelte:head>
<script async defer src="https://buttons.github.io/buttons.js"></script>
</svelte:head>
<!-- Place this tag where you want the button to render. -->
{#if isTauri}
<a class="github-button mt-4" href="https://github.com/kwaroran/risuAI" data-color-scheme="no-preference: dark; light: dark; dark: dark;" data-size="large" data-show-count="true" aria-label="Star kwaroran/risuAI on GitHub">Star</a>
{/if}

View File

@@ -52,7 +52,7 @@ async function googleTrans(text:string, reverse:boolean) {
const res = f.data as {sentences:{trans?:string}[]} const res = f.data as {sentences:{trans?:string}[]}
if(typeof(f.data) === 'string'){ if(typeof(f.data) === 'string'){
return res return res as unknown as string
} }
return res.sentences.filter((s) => 'trans' in s).map((s) => s.trans).join(''); return res.sentences.filter((s) => 'trans' in s).map((s) => s.trans).join('');
} }