You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

36 lines
1.4 KiB

import "@hotwired/turbo-rails"
import { Application } from "@hotwired/stimulus"
import LanguageMenuController from "language_menu_controller"
import CarouselController from "carousel_controller"
import IntroController from "intro_controller"
import ChanceController from "chance_controller"
import ShareController from "share_controller"
import ModalController from "modal_controller"
import RatingController from "rating_controller"
import StartController from "start_controller"
const application = Application.start()
application.register("language-menu", LanguageMenuController)
application.register("carousel", CarouselController)
application.register("intro", IntroController)
application.register("chance", ChanceController)
application.register("share", ShareController)
application.register("modal", ModalController)
application.register("rating", RatingController)
application.register("start", StartController)
// The whole game runs inside one turbo-frame so the URL never changes. Frame
// navigations don't reset scroll the way a full page visit does, so each new
// screen would otherwise open at the previous screen's scroll offset.
document.addEventListener("turbo:frame-render", (event) => {
if (event.target.id === "game") window.scrollTo(0, 0)
})
// Configure Stimulus development experience
application.debug = false
window.Stimulus = application
export { application }