0
0
mirror of https://github.com/yude-jp/yude.jp synced 2024-12-23 04:30:11 +09:00

Compare commits

...

5 Commits

Author SHA1 Message Date
290ece6aba
Add margin-top on Dynmap button 2021-05-31 10:10:09 +09:00
8d2673ce02
Add copy button for server address 2021-05-31 10:09:14 +09:00
02aa9e97e1
Add server version 2021-05-31 10:06:04 +09:00
6d28753dd7
Restore API source 2021-05-31 10:03:55 +09:00
62925709f8
Add "Retrieving server status..." text 2021-05-31 09:59:14 +09:00
4 changed files with 29 additions and 7 deletions

View File

@ -4,5 +4,7 @@
"no_one": "No one is playing.", "no_one": "No one is playing.",
"offline": "Server is down.", "offline": "Server is down.",
"address": "Server address", "address": "Server address",
"fail": "Failed to retrieve server status." "fail": "Failed to retrieve server status.",
"loading": "Retrieving server status...",
"version": "Version"
} }

View File

@ -4,5 +4,7 @@
"no_one": "現在、誰もログインしていません。", "no_one": "現在、誰もログインしていません。",
"offline": "サーバーがオフラインのようです。", "offline": "サーバーがオフラインのようです。",
"address": "サーバー アドレス", "address": "サーバー アドレス",
"fail": "サーバーの状態を取得できませんでした。" "fail": "サーバーの状態を取得できませんでした。",
"loading": "サーバーの状態を取得しています...",
"version": "バージョン"
} }

View File

@ -31,16 +31,19 @@ export default function Minecraft(props) {
const playing = t('minecraft:playing', {count: player}) const playing = t('minecraft:playing', {count: player})
const no_one = t('minecraft:no_one') const no_one = t('minecraft:no_one')
const offline = t('minecraft:offline') const offline = t('minecraft:offline')
const loading = t('minecraft:loading')
return ( return (
<p className="text-center"> <p className="text-center">
{(() => { {(() => {
if (status) { if (status == true) {
if (player == undefined || player == 0) { if (player == undefined || player == 0) {
return <span>{no_one}</span> return <span>{no_one}</span>
} else { } else {
return <span>{playing}</span> return <span>{playing}</span>
}}else{ }}else if (status == false) {
return <span>{offline}</span> return <span>{offline}</span>
}else {
return <span>{loading}</span>
} }
})()} })()}
</p> </p>

View File

@ -4,7 +4,7 @@ import useTranslation from 'next-translate/useTranslation'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import Minecraft from './components/Minecraft' import Minecraft from './components/Minecraft'
import Image from 'next/image' import Image from 'next/image'
import { faMap } from '@fortawesome/free-solid-svg-icons' import { faMap, faCopy } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import Link from 'next/link' import Link from 'next/link'
@ -14,6 +14,11 @@ export default function About(props) {
const { t, lang } = useTranslation("minecraft") const { t, lang } = useTranslation("minecraft")
const title = t('title') const title = t('title')
const address = t('address') const address = t('address')
const version = t('version')
const copyText = () => {
navigator.clipboard.writeText("yude.jp");
};
return ( return (
<Layout title={title}> <Layout title={title}>
<div> <div>
@ -29,11 +34,21 @@ export default function About(props) {
</div> </div>
<div className="text-center"> <div className="text-center">
<Minecraft /> <Minecraft />
<p>{address}: <code>yude.jp</code></p> <p>
<span>{address}: <code>yude.jp</code></span>
<button
className="bg-pink-600 text-white active:bg-pink-600 font-bold text-sm px-2 py-2 ml-2 rounded shadow hover:shadow-lg outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150"
type="button"
onClick={() => copyText()}
>
<FontAwesomeIcon icon={faCopy} className="w-5 h-5 inline"/>
</button>
</p>
<p>{version}: 1.16.x</p>
<Link href="https://dynmap.yude.jp"> <Link href="https://dynmap.yude.jp">
<a> <a>
<button <button
className="bg-pink-600 text-white active:bg-pink-600 font-bold text-sm px-6 py-3 rounded shadow hover:shadow-lg outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150" className="bg-pink-600 text-white active:bg-pink-600 mt-3 font-bold text-sm px-6 py-3 rounded shadow hover:shadow-lg outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150"
type="button" type="button"
> >
<FontAwesomeIcon icon={faMap} className="w-5 h-5 inline"/> Dynmap <FontAwesomeIcon icon={faMap} className="w-5 h-5 inline"/> Dynmap