yude.jp/pages/minecraft.js

102 lines
3.4 KiB
JavaScript
Raw Normal View History

2021-08-14 10:02:17 +09:00
// Base layout
2021-05-30 12:55:44 +09:00
import Layout from "./components/Layout"
2021-08-14 10:02:17 +09:00
// React Router etc.
import React, { useState, useEffect } from 'react';
2021-05-30 12:55:44 +09:00
import { useRouter } from 'next/router'
2021-08-14 10:02:17 +09:00
// i18n
2021-12-11 18:07:22 +09:00
import { useTranslation, useLanguageQuery, LanguageSwitcher } from 'next-export-i18n';
2021-08-14 10:02:17 +09:00
// Next.js
import Link from 'next/link'
// Custom pages
import Minecraft from './components/Minecraft'
// Font Awesome
2021-05-31 10:09:14 +09:00
import { faMap, faCopy } from '@fortawesome/free-solid-svg-icons'
2021-05-30 13:39:48 +09:00
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
2021-08-14 10:02:17 +09:00
// React Markdown
2021-06-14 18:44:59 +09:00
import ReactMarkdown from "react-markdown"
import gfm from 'remark-gfm';
import ja from '../docs/minecraft/ja.md'
import en from '../docs/minecraft/en.md'
2021-05-30 12:55:44 +09:00
2021-08-14 10:04:46 +09:00
// next-seo
import { NextSeo } from 'next-seo';
2021-05-30 12:55:44 +09:00
export default function About(props) {
2021-12-11 18:55:57 +09:00
const { t } = useTranslation();
const [query] = useLanguageQuery();
2021-08-14 10:02:17 +09:00
// Copy server address to clipboard
2021-05-31 10:09:14 +09:00
const copyText = () => {
navigator.clipboard.writeText("yude.jp");
};
2021-05-31 10:06:04 +09:00
2021-12-11 18:55:57 +09:00
if (!query) {
return <p>Loading...</p>
} else {
2021-05-30 12:55:44 +09:00
return (
2021-08-14 10:04:46 +09:00
<>
<NextSeo
title="yude.jp Minecraft マルチプレイ"
description="yude.jp 上に設置されている Minecraft: Java Edition のマルチプレイサーバーについて"
/>
2021-06-14 12:36:18 +09:00
<Layout title={t('title')}>
2021-08-14 10:02:17 +09:00
2021-05-30 13:39:48 +09:00
<div>
2021-06-14 12:38:00 +09:00
<p className="my-2 text-3xl text-center">{t('title')}</p>
2021-05-30 13:39:48 +09:00
<div className="w-full">
2021-12-11 19:19:50 +09:00
<img
src = "/images/dynmap.png"
2021-09-22 07:13:49 +09:00
alt = "Minecraft brief world map generated by Dynmap"
2021-05-30 13:39:48 +09:00
width = {1354}
height = {619}
/>
</div>
2021-08-14 10:02:17 +09:00
2021-05-30 13:39:48 +09:00
<div className="text-center">
<Minecraft />
2021-05-31 10:09:14 +09:00
<p>
2021-06-14 12:36:18 +09:00
<span>{t('address')}: <code>yude.jp</code></span>
2021-05-31 10:09:14 +09:00
<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>
2021-08-14 10:02:17 +09:00
2021-12-28 05:28:18 +09:00
<p>{t('version')}: 1.18.1</p>
2021-08-14 10:02:17 +09:00
2021-06-23 13:05:02 +09:00
<Link href="https://bluemap.yude.jp">
2021-08-14 10:02:17 +09:00
<a>
<button
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">
<FontAwesomeIcon icon={faMap} className="w-5 h-5 inline"/> BlueMap
</button>
</a>
</Link>
2021-05-30 13:39:48 +09:00
</div>
2021-06-14 18:44:59 +09:00
2021-08-14 10:02:17 +09:00
{/* Load markdown contents */}
2021-12-11 18:55:57 +09:00
{query["lang"] === 'ja' ? (
2021-09-22 07:43:10 +09:00
<ReactMarkdown plugins={[gfm]}>
{ja}
</ReactMarkdown>
) : (
<ReactMarkdown plugins={[gfm]}>
{en}
</ReactMarkdown>
)}
2021-05-30 13:39:48 +09:00
</div>
</Layout>
2021-08-14 10:04:46 +09:00
</>
2021-05-30 12:55:44 +09:00
)
2021-12-11 18:55:57 +09:00
}
2021-05-30 12:55:44 +09:00
}