LoginSignup
0
0

More than 1 year has passed since last update.

暇つぶしを提案してくれるAPIからタイピングゲームを作って暇つぶしをする

Last updated at Posted at 2022-05-30

タイピングゲーム

スクリーンショット 2022-05-31 4.14.26.png

使用API

退屈を紛らわす手段を提供してくれる The Bored API

JSON形式で下記のように返してくれる。activityが具体的な提案を表示してくれる。

{
"activity": "Play a video game",
"type": "recreational",
"participants": 1,
"price": 0,
"link": "",
"key": "5534113",
"accessibility": 0
}

構成

.
├── README.md
├── audio
│   ├── correctsound.mp3
│   ├── typingsound.mp3
│   └── wrongsound.mp3
├── index.html
├── main.js
├── style.css

主な機能

  • Typing 入力処理 

    • 入力文字の色を追加
    • タイピング音
  • 問題表示

    • 入力文字列と問題が全て一致すると新しいテキストをレンダリングして表示
  • 制限時間, エラー数, スコア 表示

  • 結果の表示

    • WPM (1分あたりの入力文字数)
    • スコア
    • 入力ミスの数
    • ミスタイプしたアルファベット

ソースコード

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0