Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
c = c.split('__SUPABASE_URL__').join(process.env.SUPABASE_URL);
c = c.split('__SUPABASE_KEY__').join(process.env.SUPABASE_KEY);
fs.writeFileSync(f, c);
console.log('✅ Supabase credentials injected');
console.log('Supabase credentials injected');
"
else
echo "⚠️ Secrets not found — placeholders remain (OK for forks)"
echo "Secrets not found — placeholders remain (OK for forks)"
fi

- name: Setup Pages
Expand Down
3 changes: 2 additions & 1 deletion js/features/points.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ window.AppPoints = (function (utils) {
pointB = b;
}
function readPoint(ix, iy) {
const gx = parseFloat(ix.value), gy = parseFloat(iy.value);
const gx = parseFloat(String(ix.value).replace(',', '.'));
const gy = parseFloat(String(iy.value).replace(',', '.'));
if (isNaN(gx) || isNaN(gy)) return null;
const maxGame = mapSize / 100;
return {
Expand Down
5 changes: 3 additions & 2 deletions js/features/share.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// js/features/share.js — Шаринг ссылок и toast-уведомления

window.AppShare = (function(utils) {
window.AppShare = (function (utils) {
let toastTimer = null;
function generateUrl(pointA, pointB, currentWeapon, mapSize) {
const params = new URLSearchParams();
Expand Down Expand Up @@ -37,7 +37,8 @@ window.AppShare = (function(utils) {
toast = document.createElement('div');
toast.id = 'toast';
toast.className = 'toast';
document.querySelector('.map-wrap').appendChild(toast);
const wrap = document.querySelector('.map-wrap') || document.body;
wrap.appendChild(toast);
}
toast.textContent = message;
toast.className = 'toast ' + type;
Expand Down
8 changes: 7 additions & 1 deletion js/map/interactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,13 @@ window.MapInteractions = (function () {
const cursorCoords = document.getElementById('cursorCoords');
if (cursorCoords) {
const wpt = utils.screenToWorld(p.x, p.y, view);
cursorCoords.innerHTML = `<span>x${utils.gameCoord(wpt.x)}</span><span>y${utils.gameCoord(wpt.y)}</span>`;
cursorCoords.textContent = '';
const xSpan = document.createElement('span');
xSpan.textContent = `x${utils.gameCoord(wpt.x)}`;
const ySpan = document.createElement('span');
ySpan.textContent = `y${utils.gameCoord(wpt.y)}`;
cursorCoords.appendChild(xSpan);
cursorCoords.appendChild(ySpan);
Comment on lines +115 to +121

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (performance): Avoid allocating new span elements on every mouse move to reduce DOM churn.

Since this runs on every mouse move, repeatedly creating and appending new spans can add unnecessary DOM churn and GC pressure. Consider creating the spans once and just updating their textContent to improve responsiveness, particularly on lower-end devices.

const wrap = canvas.parentElement.getBoundingClientRect();
let lx = p.x + 14;
let ly = p.y + 18;
Expand Down
Loading