Skip to content

Commit f654858

Browse files
committed
Use banner for attack and operations mode instead of notification
1 parent cfcba63 commit f654858

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

public/css/world-map.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
display: block;
6060
width: 100%;
6161
background: #1a1a1a;
62-
height: calc(100vh - 350px);
62+
height: calc(100vh - 150px);
6363
min-height: 400px;
6464
}
6565

@@ -698,7 +698,7 @@
698698
.attack-mode-banner {
699699
display: none;
700700
position: fixed;
701-
top: 0;
701+
bottom: 0;
702702
left: 0;
703703
width: 100%;
704704
padding: 12px 20px;
@@ -708,7 +708,7 @@
708708
text-align: center;
709709
z-index: 10001;
710710
font-size: 14px;
711-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
711+
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.5);
712712
}
713713

714714
.attack-mode-banner button {

public/js/world/attack.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212

1313
const attackUnitsModal = document.getElementById('attackUnitsModal');
1414
const confirmAttackUnitsBtn = document.getElementById('confirmAttackUnitsBtn');
15+
const attackModeBanner = document.getElementById('attackModeBanner');
1516

1617
confirmAttackUnitsBtn.onclick = sendAttackFleet;
18+
document.getElementById('cancelAttackModeBtn').onclick = cancelAttackMode;
1719

1820
function getDefaultTileClick() {
1921
return WorldApp.defaultTileClick;
@@ -59,10 +61,9 @@
5961
};
6062

6163
worldMap.render();
62-
showNotification(
63-
'Select one of your ' + result.eligibleRegions.length + ' highlighted region(s) to attack from. Click the target or press Escape to cancel.',
64-
'info'
65-
);
64+
attackModeBanner.style.display = 'flex';
65+
document.getElementById('attackModeText').textContent =
66+
'Attack Mode: Select one of ' + result.eligibleRegions.length + ' highlighted region(s) to attack from. Click target or press Escape to cancel.';
6667
} catch (error) {
6768
console.error('Error loading attack-from regions:', error);
6869
showNotification('An error occurred. Please try again.', 'error');
@@ -82,7 +83,7 @@
8283

8384
worldMap.config.onTileClick = getDefaultTileClick();
8485
worldMap.render();
85-
showNotification('Attack cancelled.', 'info');
86+
attackModeBanner.style.display = 'none';
8687
}
8788

8889
async function showAttackUnitsModal(targetRegion, sourceRegion) {

0 commit comments

Comments
 (0)