<!DOCTYPE html>
<head>
    {% load static %}
    <title>Pariksha</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,300;0,400;0,700;1,400&display=swap" rel="stylesheet">
    <link rel="preconnect" href="https://fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css2?family=Slabo+13px&display=swap" rel="stylesheet">
    <script>
        function start_quiz(x) {
            window.open("/quiz/?q="+x, "_blank", "fullscreen=yes");
        }
    </script>
    <style>
        @media all and (min-width: 800px) {
            .profile {
                text-align: center;
            }
            .cards {
                display: flex;
                flex-direction: row;
                justify-content: center;
                flex-wrap: wrap;
            }
            .menu_card_wrapper {
                margin: 50px;
                display: flex;
                flex-direction: column;
            }
            .menu_card {
                text-decoration: none;
                width: 300px;
                margin: 10px;
                height: 400px;
                display: flex;
                align-self: center;
                justify-content: center;
                box-shadow: 1px 1px 5px rgb(158, 158, 158);
                transition: height 0.2s;
            }
            .menu_card:hover {
                box-shadow: 1px 1px 5px rgb(87, 87, 87);
            }
            .img_wrapper {
                min-width: 200px;
                display:block;
                text-align: center;
                margin-bottom: 20px;
            }
        }

        @media all and (max-width: 800px) {
            .menu_card_wrapper {
                width: 100%;
                margin-top: 20px;
                display: flex;
                flex-direction: row;
            }
            .menu_card {
                text-decoration: none;
                width: 100%;
                min-height: 150px;
                display: flex;
                align-self: center;
                justify-content: center;
            }
            .img_wrapper {
                min-width: 200px;
                display:block;
                text-align: center;
            }
        }

        * {
            font-family: 'Source Sans Pro', sans-serif;
        }
        body {
            margin: 0px;
            background: url("{% static 'img/study.jpg' %}");
        }
        .menu_card_content > h1 {
            margin-top: 0px;
            margin-bottom: 0px;
        }
        .menu_card_content > p {
            margin-right: 30px;
        }
        .profile {
            margin: 50px;
        }
        .profile h3 {
            margin-top: 0px;
            margin-bottom: 0px;
        }
        .profile h1 {
            margin-top: 0px;
            margin-bottom: 0px;
            font-size: 2.3em;
            font-family: 'Slabo 13px', serif;
        }


        #menucard_ongoingquizzes {
            background-color: #00fff0;
            transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
        }
        #menucard_ongoingquizzes:hover {
            background-color: #2595d6;
            color: white;
        }

        #menucard_prevquiz {
            background-color: #f0dcc8;
            transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
        }
        #menucard_prevquiz:hover {
            background-color: #ce9a66;
            color: white;
        }

        #menucard_logout {
            background-color: #ffeada;
            transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
        }
        #menucard_logout:hover {
            background-color: #d4b59e;
        }
    </style>
</head>
<body>
    <section class="profile">
        <h3>Welcome,</h3>
        <h1>Student {{user}}</h1>
    </section>

    <section class="cards">
    <a class="menu_card" id="menucard_ongoingquizzes" href="/ongoing_quiz/">
            <div class="menu_card_wrapper">
            <div class="img_wrapper"><img height="100px" src="{% static 'img/ongoing_quiz.svg' %}"></div>
            <div class="menu_card_content">
                <h1>Ongoing Quizzes</h1>
                <p>Ready for Quiz? You can start any one quiz from the list of ongoing quizzes.</p>
            </div>
            </div>
        </a>
    <a class="menu_card" id="menucard_prevquiz" href="/submissions/">
            <div class="menu_card_wrapper">
            <div class="img_wrapper"><img height="100px" src="{% static 'img/previous_quiz.svg' %}"></div>
            <div class="menu_card_content">
                <h1>Previous Quizzes</h1>
                <p>See your result of all previous attempted quizzes.</p>
            </div>
            </div>
        </a>

        <a class="menu_card" id="menucard_logout" href='{% url "logout" %}?next=/'>
            <div class="menu_card_wrapper">
            <div class="img_wrapper"><img height="90px" src="{% static 'img/menu_logout.svg' %}"></div>
            <div class="menu_card_content">
                <h1>Logout</h1>
                <p></p>
            </div>
            </div>
        </a>

    </section>

        <!--{%for quiz in quizId%}
        <br><h1><a onclick="start_quiz({{quiz.0}})">Start Quiz Code:{{quiz.1}}</a></h1>
        {%endfor%}
    <br><h1><a href="/submissions/">View Previous Quizzes</a></h1> -->
</body>
</html>
