<template>
    <nav>
        <h1>set destination</h1>
        <div>
            <input type="checkbox" id="navmenu" class="navmenu">
            <ul>
                <li v-for="link in Links">
                    <!-- <img src="../assets/images/star.gif"><RouterLink :to="link.url">{{ link.name }}</RouterLink><img src="../assets/images/star.gif"> -->
                    <RouterLink :to="link.url"><img src="../assets/images/star.gif"><span class="font">></span> {{
                        link.name
                    }} <img src="../assets/images/star.gif"></RouterLink>
                    <!-- <RouterLink :to="link.url">> {{ link.name }}</RouterLink> -->
                </li>
            </ul>
            <div id="toggle" class="info">
                <label for="navmenu"><span id="openmenu">
                        <div class="burger"></div>
                        <div class="burger"></div>
                        <div class="burger"></div>
                    </span><span class="font" id="closemenu">X</span></label>
            </div>
        </div>
    </nav>
</template>
<script setup lang="ts">
const Links = [
    { name: "home", url: "/" },
    { name: "pets", url: "/pets" },
    { name: "links", url: "/links" },
    { name: "portfolio", url: "/portfolio" }
]
</script>
<style scoped>
nav {
    border: 2px solid rgba(222, 222, 108, 1);
    min-width: 20%;
    height: fit-content;
    padding: .5em;

    @media screen and (max-width: 600px) {
        padding: 2px;
    }
}

h1 {
    text-align: center;
    font-size: 40px;
    text-decoration: underline;
    margin-bottom: 1em;

    @media screen and (max-width: 600px) {
        font-size: 24px;
    }
}

ul {
    list-style-type: none;
    padding: 0;
    text-align: center;
    display: flex;
    flex-direction: column;

    @media screen and (max-width: 1250px) {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: .5em;

        li {
            border: rgba(222, 222, 108, 1) solid 2px;
            width: fit-content;
            height: fit-content;
            /* padding: 1em; */
            margin: 0;

            a {
                width: 250px;
                height: 100px;
                display: flex;
                justify-content: center;
                align-items: center;
                background-color: black;
            }

            @media screen and (max-width: 600px) {
                a {
                    width: 175px;
                    height: 50px;
                    font-size: 20px;
                }

                span {
                    font-size: 28px;
                    margin-right: .5em;
                }
            }
        }
    }
}

li {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: .5em 0;

    height: 32px;
}

#toggle {
    text-align: center;
    border: 2px solid;
    margin: .5em;

    @media screen and (min-width: 451px) {
        display: none;
    }
}

label {
    text-align: center;
}

input {
    display: none;
}

@media screen and (max-width: 450px) {
    ul {
        display: none;
    }
}

#closemenu {
    display: none;
}

#openmenu {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    user-select: none;

    justify-content: space-evenly;
    align-items: center;
}

.burger {
    height: 2px;
    width: 32px;
    background-color: #fefefe;
}

.navmenu:checked~* #openmenu {
    display: none;
}

.navmenu:checked~* #closemenu {
    display: block;
    cursor: pointer;
    user-select: none;
    color: #fefefe;
}

.navmenu:checked+ul {
    display: flex;
}

span {
    height: 32px;
}

a {
    text-decoration: none;
    color: #fefefe;

    img {
        display: none;
    }
}

a:hover {
    text-decoration: underline;

    img {
        display: inline;
    }

    span {
        display: none;
    }
}

a:active {
    color: rgba(222, 222, 108, 1);
}
</style>