controllers/game/m_o_t_controller.js

  1. import { Controller } from "@hotwired/stimulus"
  2. /**
  3. * @class Game.MOTController
  4. * @classdesc Stimulus controller for /game/ministry-of-truth.
  5. * @extends Controller
  6. */
  7. export default class MOTController extends Controller {
  8. /**
  9. * Changes the previous history.
  10. * Clicking the back button won't work but type `history.back()` in the console and you'll get the
  11. * next puzzle.
  12. *
  13. * @instance
  14. * @memberof Game.MOTController
  15. * @returns {void} N/A
  16. * */
  17. connect() {
  18. history.pushState(null, "", "/game/back-to-base/")
  19. history.pushState(null, "", "/game/ministry-of-truth/")
  20. window.onpopstate = () => location.reload()
  21. }
  22. }