[feat] added github stars
This commit is contained in:
@@ -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) => {
|
||||||
|
|||||||
11
src/lib/Others/GithubStars.svelte
Normal file
11
src/lib/Others/GithubStars.svelte
Normal 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}
|
||||||
@@ -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('');
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user