{% extends 'bloonsa_game/base.html' %}
{% load static %}

{% block title %}
    {{ levelTitle }} by {{ levelAuthor }}
{% endblock title %}

{% block head %}
    <script>
        window.RufflePlayer=window.RufflePlayer||{};
        window.RufflePlayer.config={
            "autoplay":"on",
            "unmuteOverlay":"hidden",
            "allowScriptAccess": true,
            "quality": "high",
            "splashScreen": false,
            "menu": false,
            "polyfills": false,
            // "logLevel": "debug",
        };</script>
    <script src="{% static 'bloonsa_game/misc/ruffle/ruffle.js' %}"></script>
    <script src="{% static 'bloonsa_game/js/flash_handler.js' %}"></script>
    <link rel="stylesheet" type="text/css" media="screen" href="{% static 'bloonsa_game/css/game.css' %}"/>
{% endblock head %}

{% block content %}
<div id="bloonsa-game"></div>
<script>
    window.RufflePlayer = window.RufflePlayer || {};
    window.addEventListener("load", (event) => {
        const ruffle = window.RufflePlayer.newest();
        const player = ruffle.createPlayer();
        const container = document.getElementById("bloonsa-game");
        container.appendChild(player);
        player.load({
            url: "{% static 'bloonsa_game/misc/bloons_unlimited.swf' %}?{{ flashVars | safe }}",
            allowScriptAccess: true,
            // backgroundColor: "#000",
         });
        player.style.width = "640px";
        player.style.height = "480px";
    });
</script>
{% include 'bloonsa_game/modules/levelinfo.html' %}
{% endblock content %}