Skip to content

Commit

Permalink
fix: 메인화면 룰렛게임 로고 수정, 설명 화면 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
bo0216 committed Nov 22, 2023
1 parent b9614ae commit 9903eca
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
22 changes: 13 additions & 9 deletions bj_screen.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ <h1>사다리게임</h1>
<p>&lt; 돌려돌려 사다리 &gt;</p>
</div>
<!--벽돌깨기 -->
<div class="brick" style="display: none;">
<h1>벽돌깨기</h1>
<p>&lt; 돌려돌려 사다리 &gt;</p>
<div class="roulette" style="display: none;">
<h1>룰렛게임</h1>
<p>&lt; 돌려돌려 돌림판 &gt;</p>
</div>
</header>
<main class="text-center">
Expand All @@ -93,9 +93,9 @@ <h1>벽돌깨기</h1>
<img src="./img/main/ladderlogo.png" alt="사다리">
<p>&lt; 사다리 &gt;</p>
</div>
<div class="gamelogo" id="bricklogo">
<img src="./img/main/rpslogo.png" alt="사다리">
<p>&lt; 벽돌깨기 &gt;</p>
<div class="gamelogo" id="roulettelogo">
<img src="./img/main/roulettelogo.png" alt="룰렛">
<p>&lt; 룰렛게임 &gt;</p>
</div>
</div>
</div>
Expand All @@ -111,6 +111,10 @@ <h1>벽돌깨기</h1>
<div class="ladder" style="display: none;">
<p>사다리 게임을 운명을 맡겨보세요</p>
</div>
<!-- 룰렛게임 -->
<div class="roulette" style="display: none;">
<p>돌림판을 돌려서 랜덤 결과를 확인하세요</p>
</div>
</main>
<footer class="text-center">
<!-- 가위바위보 -->
Expand All @@ -127,9 +131,9 @@ <h1>벽돌깨기</h1>
<div class="ladder" style="display: none;">
<button type="button" class="btn btn-outline-light col-3" onclick="location.href='./bj_ladder_screen.html'">게임시작</button>
</div>
<!-- 벽돌깨기게임 -->
<div class="brick" style="display: none;">
<button type="button" class="btn btn-outline-light col-3" onclick="location.href='./bj_brickout_screen.html'">게임시작</button>
<!-- 룰렛게임 -->
<div class="roulette" style="display: none;">
<button type="button" class="btn btn-outline-light col-3" onclick="location.href='./bj_roulette_screen.html'">게임시작</button>
</div>
</footer>
<!--JavaScript at end of body for optimized loading-->
Expand Down
24 changes: 12 additions & 12 deletions bj_screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const START_GAME = 'start_game';
const rpslogo = document.querySelector('#rpslogo');
const whlogo = document.querySelector('#whlogo');
const ladderlogo = document.querySelector('#ladderlogo');
const bricklogo = document.querySelector('#bricklogo');
const roulettelogo = document.querySelector('#roulettelogo');
const backbtn = document.querySelector('#backbtn');

extensionSdk.broadcast.send(START_GAME, 'main');
Expand Down Expand Up @@ -43,10 +43,10 @@ const setLadderDisplay = (action) => {
});
}

const setBrickDisplay = (action) => {
const brickClasses = document.querySelectorAll('.brick');
const setRouletteDisplay = (action) => {
const rouletteClasses = document.querySelectorAll('.roulette');

brickClasses.forEach(function(el) {
rouletteClasses.forEach(function(el) {
el.style.display = action === 'show' ? '' : 'none';
});
}
Expand All @@ -56,7 +56,7 @@ const showGuide = (guide) => {
let rpsDisplay = 'hide';
let whDisplay = 'hide';
let ladderDisplay = 'hide';
let brickDisplay = 'hide';
let rouletteDisplay = 'hide';

switch (guide) {
case 'rps':
Expand All @@ -68,8 +68,8 @@ const showGuide = (guide) => {
case 'ladder':
ladderDisplay = 'show';
break;
case 'brick':
brickDisplay = 'show';
case 'roulette':
rouletteDisplay = 'show';
break;
default:
defaultDisplay = 'show';
Expand All @@ -80,7 +80,7 @@ const showGuide = (guide) => {
setRpsDisplay(rpsDisplay);
set5w1hDisplay(whDisplay);
setLadderDisplay(ladderDisplay);
setBrickDisplay(brickDisplay);
setRouletteDisplay(rouletteDisplay);


backbtn.style.display = '';
Expand All @@ -101,12 +101,12 @@ ladderlogo.addEventListener('click', function() {
showGuide('ladder');
});

//벽돌깨기 안내
bricklogo.addEventListener('click', function() {
showGuide('brick');
// 룰렛게임 안내
roulettelogo.addEventListener('click', function() {
showGuide('roulette');
});

// 뒤로가기 버튼
backbtn.addEventListener('click', function() {
location.reload();
window.location.replace('./bj_screen.html');
});
Binary file added img/main/roulettelogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9903eca

Please sign in to comment.