DEV Community

Cover image for Footer & HUD Controls Refactor
Weird Codes
Weird Codes

Posted on • Originally published at weirdcodes.itch.io

Footer & HUD Controls Refactor

ЁЯЫая╕П Devlog тАФ Footer & HUD Controls Refactor

Version: v0.0.9-patch

Date: 2026-08-10

Author: Weired Codes

Tags: ui mobile hud layout fix


ЁЯЗоЁЯЗ│ рд╣рд┐рдВрджреА рд╡рд┐рд╡рд░рдг

рдХреНрдпрд╛ рдмрджрд▓рд╛?

рдЗрд╕ рдкреИрдЪ рдореЗрдВ Footer рдФрд░ HUD Controls рдХреЛ canvas рдХреЗ рдЕрдВрджрд░ рд╕реЗ рдирд┐рдХрд╛рд▓рдХрд░ screen рдХреЗ bottom рдкрд░ рдПрдХ рд╕реНрдерд╛рдпреА fixed bar рдореЗрдВ рд░рдЦрд╛ рдЧрдпрд╛ рд╣реИред

рдкрд╣рд▓реЗ #ui-footer рдФрд░ #hud-controls рджреЛрдиреЛрдВ #gameContainer рдХреЗ рдЕрдВрджрд░ position: absolute рдкрд░ рдереЗ тАФ рдЗрд╕рд╕реЗ mobile рдкрд░ canvas рдХреЗ рд╕рд╛рде scale рд╣реЛрдиреЗ рдХреА рд╡рдЬрд╣ рд╕реЗ рд╡реЗ рдмрд╣реБрдд рдЫреЛрдЯреЗ рдФрд░ рдЕрдЬреАрдм рджрд┐рдЦрддреЗ рдереЗред

рдЕрдм рдпреЗ рджреЛрдиреЛрдВ canvas рд╕реЗ рдкреВрд░реА рддрд░рд╣ рдЕрд▓рдЧ, screen bottom рдкрд░ fixed рд╣реИрдВ тАФ scale рд╕реЗ рдкреНрд░рднрд╛рд╡рд┐рдд рдирд╣реАрдВ рд╣реЛрддреЗред


рдкрд░рд┐рд╡рд░реНрддрди рд╕реВрдЪреА

рдлрд╝рд╛рдЗрд▓ рдкрд░рд┐рд╡рд░реНрддрди
index.html #ui-footer рдХреЛ #gameContainer рд╕реЗ рдмрд╛рд╣рд░, #touch-controls рдХреЗ рдмрд╛рдж body-level рдкрд░ рд░рдЦрд╛
index.html #hud-controls (volume slider, mute, help, gyro) рдХреЛ #ui-footer рдХреЗ рдЕрдВрджрд░ move рдХрд┐рдпрд╛
index.html #gameContainer рд╕реЗ рдкреБрд░рд╛рдиреЗ #hud-controls рдФрд░ #ui-footer рдХреЗ HTML blocks рд╣рдЯрд╛рдП
style.css #ui-footer тЖТ position: fixed; bottom: 0; height: 34px; z-index: 80
style.css #hud-controls тЖТ position: fixed рд╣рдЯрд╛рдпрд╛, margin-left: auto рд╕реЗ footer рдореЗрдВ right-align рдХрд┐рдпрд╛
style.css #touch-controls тЖТ margin-bottom: 34px рдЬреЛрдбрд╝рд╛ рддрд╛рдХрд┐ footer рд╕реЗ overlap рди рд╣реЛ
style.css #touch-controls тЖТ align-items: center; flex: 1 тАФ full available space use рдХрд░реЗ
style.css .touch-cluster тЖТ flex: 1 рдЬреЛрдбрд╝рд╛ тАФ рддреАрдиреЛрдВ clusters рдмрд░рд╛рдмрд░ space рдореЗрдВ spread рд╣реЛрдВ
style.css .touch-cluster-left тЖТ justify-content: flex-start
style.css .touch-cluster-right тЖТ justify-content: flex-end

рдХреНрдпреЛрдВ рдЬрд╝рд░реВрд░реА рдерд╛?

  • Mobile рдкрд░ #gameContainer scale рд╣реЛрддрд╛ рд╣реИ (scaleGame() рд╕реЗ) тАФ рдЙрд╕рдХреЗ рдЕрдВрджрд░ рдХреЗ absolute elements рднреА scale рд╣реЛ рдЬрд╛рддреЗ рдереЗ, рдЬрд┐рд╕рд╕реЗ footer рдФрд░ controls рдмрд╣реБрдд рдЫреЛрдЯреЗ рджрд┐рдЦрддреЗ рдереЗред
  • Touch controls рдФрд░ footer overlap рдХрд░ рд░рд╣реЗ рдереЗред
  • HUD controls canvas рдХреЗ рдКрдкрд░ position: fixed рдкрд░ рдереЗ тАФ footer рдХреЗ рдмрд╛рд╣рд░, рдЬреЛ visually inconsistent рдерд╛ред

рдкрд╣рд▓реЗ рдФрд░ рдмрд╛рдж

рд╕реНрдерд┐рддрд┐ рдкрд╣рд▓реЗ рдмрд╛рдж
Footer position #gameContainer рдХреЗ рдЕрдВрджрд░, position: absolute Body-level, position: fixed; bottom: 0
HUD controls Canvas рдХреЗ рдКрдкрд░ fixed, рдЕрд▓рдЧ Footer рдХреЗ рдЕрдВрджрд░, right-aligned
Touch controls overlap Footer рд╕реЗ overlap рд╣реЛрддреЗ рдереЗ margin-bottom: 34px рд╕реЗ clear
Touch clusters spacing space-between рдкрд░ cramped flex: 1 рд╕реЗ full width рдореЗрдВ spread
Mobile scale effect Footer рднреА canvas рдХреЗ рд╕рд╛рде shrink рд╣реЛрддрд╛ рдерд╛ Scale рд╕реЗ рдкреВрд░реА рддрд░рд╣ independent

ЁЯЗмЁЯЗз English Summary

What changed?

The #ui-footer and #hud-controls (volume slider, mute, help, gyro buttons) have been moved out of the game canvas and into a fixed bottom bar at the screen level.

Previously both elements lived inside #gameContainer with position: absolute, which caused them to shrink along with the canvas on mobile due to scaleGame() scaling. They were also overlapping with the touch controls.

Now the footer is a scale-independent, fixed bottom bar тАФ always readable and accessible regardless of canvas scale.

Key fixes

  • Footer is now position: fixed; bottom: 0; z-index: 80 тАФ always on screen bottom.
  • HUD controls sit inside the footer, right-aligned via margin-left: auto.
  • Touch controls have margin-bottom: 34px to clear the footer.
  • Touch clusters use flex: 1 for even distribution across full width.
  • iPhone safe-area (env(safe-area-inset-bottom)) respected in footer padding.

ЁЯУБ Files Changed

index.html
style.css
Enter fullscreen mode Exit fullscreen mode

Developed by Weired Codes тАФ рдореЛрдХреНрд╖, рдПрдХ рдЖрдзреНрдпрд╛рддреНрдорд┐рдХ рдЦреЗрд▓ред

Top comments (0)