controllers/game/r_d_controller.js

  1. import { Controller } from "@hotwired/stimulus"
  2. /**
  3. * @class Game.RDController
  4. * @classdesc Stimulus controller for /game/responsive-design.
  5. * @extends Controller
  6. */
  7. export default class RDController extends Controller {
  8. static targets = [ "alert" ]
  9. /**
  10. * In Dev Tools change the resposive screen size to 320x480 and the path to the next puzzle will
  11. * appear in the red box.
  12. *
  13. * @instance
  14. * @memberof Game.RDController
  15. * @returns {void} N/A
  16. * */
  17. connect() {
  18. window.onresize = () => {
  19. if (window.screen.width === 320 && window.screen.height === 480) {
  20. this.alertTarget.innerHTML = "/game/ministry-of-truth/"
  21. }
  22. }
  23. }
  24. }