<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{% block title %}{% endblock %}</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha2/dist/css/bootstrap.min.css" integrity="sha384-aFq/bzH65dt+w6FI2ooMVUpc+21e0SRygnTpmBvdBgSdnuTN7QbdgL+OapgHtvPp" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css">
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
    <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon">
    <!--for python code displaying-->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.3/styles/default.min.css">
</head>
<!--style="background-color: #44d0d0;"-->
<body>
    <nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
        <div class= "container">

            <a class="navbar-brand" href="{{ url_for('index') }}">
                <img src="{{url_for('static', filename='logo.png')}}" alt="Logo" height="60" class="d-inline-block align-text-bottom">
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>

            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav mr-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('index') }}" aria-current="page">Home</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('experiment') }}" aria-current="page">{{title}}</a>
                    </li>


{#                    <li class="nav-item">#}
{#                        <a class="nav-link" href="{{ url_for('help_info') }}">About</a>#}
{#                    </li>#}
                </ul>

                </ul>
            </div>
        </div>
    </nav>

    <div class= "container">
        <div class="flash">
            {% with messages = get_flashed_messages() %}
                {% if messages %}
                <div class="alert alert-warning">
                    Message:
                    {% for message in messages %}
                        <div >
                            {{ message|safe }}
                        </div>
                    {% endfor %}
                </div>
                {% endif %}
            {% endwith %}
        </div>
    </div>
    {% block body %}{% endblock %}

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha2/dist/js/bootstrap.bundle.min.js" integrity="sha384-qKXV1j0HvMUeCBQ+QVp7JcfGl760yU08IQ+GpUo5hlbpg51QRiuqHAJz8+BrxE/N" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.3/highlight.min.js"></script>
    <script>
        window.onload = function() {
            if (localStorage.getItem('is_open')) {
                alert('Application is already running in another tab.');
                window.close(); // Optionally close the tab
            } else {
                localStorage.setItem('is_open', 'true');
            }
        };

        window.onbeforeunload = function() {
            localStorage.removeItem('is_open');
        };

    </script>
</body>
</html>