-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from teamdev-c/feature-add-explanation-ui
Feature add explanation UI
- Loading branch information
Showing
4 changed files
with
105 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const entrance = document.getElementById("js-entrance"); | ||
const explanationButton = document.getElementById("js-explanation"); | ||
const layout = document.getElementById("js-layout"); | ||
const layoutExplanation = document.getElementById("js-layout-explanation"); | ||
|
||
explanationButton.addEventListener("click", () => { | ||
entrance.classList.add("hidden"); | ||
layoutExplanation.classList.add("explanation"); | ||
layoutExplanation.innerHTML = ` | ||
<div class="explanation_header"> | ||
<button id="js-back"> | ||
<i class="fa-solid fa-arrow-left"></i> | ||
</button> | ||
<h1 class="explanation_header_title">説明</h1> | ||
</div> | ||
<div class="explanation_text">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Voluptas tempore repellat molestiae recusandae esse saepe hic unde sequi temporibus distinctio, nesciunt alias incidunt nostrum iusto voluptatibus. Nihil, quis in! Debitis.</div> | ||
`; | ||
|
||
const backButton = document.getElementById("js-back"); | ||
backButton.addEventListener("click", () => { | ||
layoutExplanation.innerHTML = ""; | ||
layoutExplanation.classList.remove("explanation"); | ||
entrance.classList.remove("hidden"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,28 @@ | ||
"use strict"; | ||
|
||
// keydownイベントの数字と動作の紐づけを行います | ||
// 例えば、{ 37: 'left' }のように定義します | ||
// HTMLのbodyタグに紐づけておきます | ||
// 参考:https://developer.mozilla.org/ja/docs/Web/API/Element/keydown_event | ||
|
||
|
||
|
||
// canvas要素を活用して、描画する各関数を定義します | ||
// 参考:https://developer.mozilla.org/ja/docs/Web/HTML/Element/canvas#%E4%BE%8B | ||
|
||
const H = 600, W = 300; | ||
const ROWS = 20, COLS = 10; | ||
const BLOCK_H = H / ROWS, BLOCK_W = W / COLS; | ||
|
||
// 1つのブロックを描画する関数を作成します | ||
// (x, y)を引数としてとりその位置に表示するようにします | ||
|
||
// canvas上にテトロミノを描画します | ||
// controller.jsから呼び出して、描画の部分だけ切り出すようにします | ||
// 描画するかどうかは、tetris.jsで配列などで管理して、受け渡します | ||
|
||
|
||
|
||
// 各テトロミノを定義します | ||
|
||
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters