Something went wrong. Try again.
An Android app for exploring the marine life, featuring local names, detailed profiles, and easy search. One-stop-shop for researchers, hob…
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
<template> <div class="fixed top-0 left-0 z-40 h-screen p-4 overflow-y-auto transition-transform bg-white w-48 dark:bg-gray-800" :class="{ 'transform translate-x-0': isOpen, '-translate-x-full': !isOpen }" @click.stop > <div class="pt-14"> <h1 class="text-xl px-2 pb-5 text-primary uppercase font-bold">Fish Finder</h1> <template v-for="(option, index) in options" :key="index"> <button class="w-full transition-colors duration-200 ease-in-out" :class="{ 'bg-blue-100 dark:bg-blue-900': isActive(option.link) }" @click="openPage(option.link)" > <div class="flex items-center gap-2 py-4 px-2 cursor-pointer"> <div v-html="option.icon"></div> <span class="text-md font-bold">{{ option.name }}</span> </div> </button> </template> </div> </div> </template> <script> export default { name: "Sidebar", data() { return { options: [ { name: 'Home', link: '/home', icon: ` <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M8.18533 2.47427C8.1357 2.42341 8.06967 2.39502 8.001 2.39502C7.93232 2.39502 7.86629 2.42341 7.81666 2.47427L1.68001 8.75534C1.65395 8.78205 1.63322 8.81415 1.61907 8.8497C1.60491 8.88524 1.59764 8.92349 1.59768 8.96213L1.59668 14.8571C1.59668 15.1602 1.70906 15.4509 1.9091 15.6653C2.10914 15.8796 2.38045 16 2.66334 16H5.86667C6.00812 16 6.14377 15.9398 6.24379 15.8326C6.34381 15.7255 6.4 15.5801 6.4 15.4286V10.5714C6.4 10.4956 6.4281 10.423 6.47811 10.3694C6.52812 10.3158 6.59594 10.2857 6.66667 10.2857H9.33333C9.40405 10.2857 9.47188 10.3158 9.52189 10.3694C9.5719 10.423 9.59999 10.4956 9.59999 10.5714V15.4286C9.59999 15.5801 9.65618 15.7255 9.7562 15.8326C9.85622 15.9398 9.99188 16 10.1333 16H13.3353C13.6182 16 13.8895 15.8796 14.0896 15.6653C14.2896 15.4509 14.402 15.1602 14.402 14.8571V8.96213C14.402 8.92349 14.3947 8.88524 14.3806 8.8497C14.3664 8.81415 14.3457 8.78205 14.3196 8.75534L8.18533 2.47427Z" fill="black"/> <path d="M15.8303 7.57679L13.337 5.02107V1.14286C13.337 0.991305 13.2808 0.84596 13.1808 0.738796C13.0808 0.631632 12.9451 0.571429 12.8036 0.571429H11.2037C11.0622 0.571429 10.9265 0.631632 10.8265 0.738796C10.7265 0.84596 10.6703 0.991305 10.6703 1.14286V2.28571L8.73966 0.307857C8.55899 0.112143 8.29033 0 7.99999 0C7.71066 0 7.44266 0.112143 7.26199 0.308214L0.172012 7.57607C-0.0353206 7.79036 -0.0613205 8.14286 0.127346 8.375C0.174723 8.4336 0.232732 8.48125 0.297845 8.51506C0.362957 8.54888 0.43381 8.56814 0.506092 8.57168C0.578373 8.57522 0.650571 8.56297 0.718292 8.53566C0.786013 8.50836 0.84784 8.46658 0.90001 8.41286L7.81666 1.33143C7.86629 1.28056 7.93232 1.25218 8.00099 1.25218C8.06967 1.25218 8.1357 1.28056 8.18533 1.33143L15.1026 8.41286C15.2045 8.51755 15.341 8.57469 15.4822 8.57175C15.6233 8.5688 15.7576 8.50601 15.8556 8.39714C16.0603 8.17 16.0433 7.795 15.8303 7.57679Z" fill="black"/> </svg> ` }, { name: 'About Us', link: '/about', icon: ` <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M8.8 5.6H7.2V4H8.8M8.8 12H7.2V7.2H8.8M8 0C6.94943 0 5.90914 0.206926 4.93853 0.608964C3.96793 1.011 3.08601 1.60028 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8C0 10.1217 0.842855 12.1566 2.34315 13.6569C3.08601 14.3997 3.96793 14.989 4.93853 15.391C5.90914 15.7931 6.94943 16 8 16C10.1217 16 12.1566 15.1571 13.6569 13.6569C15.1571 12.1566 16 10.1217 16 8C16 6.94943 15.7931 5.90914 15.391 4.93853C14.989 3.96793 14.3997 3.08601 13.6569 2.34315C12.914 1.60028 12.0321 1.011 11.0615 0.608964C10.0909 0.206926 9.05058 0 8 0Z" fill="#011235"/> </svg> ` }, { name: 'Contact Us', link: '/contact', icon: ` <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M2.66667 12.4444C2.66667 10.6667 6.22222 9.68889 8 9.68889C9.77778 9.68889 13.3333 10.6667 13.3333 12.4444V13.3333H2.66667M10.6667 5.33333C10.6667 6.04058 10.3857 6.71885 9.88562 7.21895C9.38552 7.71905 8.70724 8 8 8C7.29276 8 6.61448 7.71905 6.11438 7.21895C5.61428 6.71885 5.33333 6.04058 5.33333 5.33333C5.33333 4.62609 5.61428 3.94781 6.11438 3.44772C6.61448 2.94762 7.29276 2.66667 8 2.66667C8.70724 2.66667 9.38552 2.94762 9.88562 3.44772C10.3857 3.94781 10.6667 4.62609 10.6667 5.33333ZM0 1.77778V14.2222C0 14.6937 0.187301 15.1459 0.520699 15.4793C0.854097 15.8127 1.30628 16 1.77778 16H14.2222C14.6937 16 15.1459 15.8127 15.4793 15.4793C15.8127 15.1459 16 14.6937 16 14.2222V1.77778C16 1.30628 15.8127 0.854097 15.4793 0.520699C15.1459 0.187301 14.6937 0 14.2222 0H1.77778C1.30628 0 0.854097 0.187301 0.520699 0.520699C0.187301 0.854097 0 1.30628 0 1.77778Z" fill="#011235"/> </svg> ` }, { name: 'Rate Us', link: '/', icon: ` <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M10.3096 5.61155L8.8396 0.771551C8.5496 -0.178448 7.2096 -0.178448 6.9296 0.771551L5.4496 5.61155H0.999597C0.0295973 5.61155 -0.370403 6.86155 0.419597 7.42155L4.0596 10.0216L2.6296 14.6316C2.3396 15.5616 3.4196 16.3116 4.1896 15.7216L7.8796 12.9216L11.5696 15.7316C12.3396 16.3216 13.4196 15.5716 13.1296 14.6416L11.6996 10.0316L15.3396 7.43155C16.1296 6.86155 15.7296 5.62155 14.7596 5.62155H10.3096V5.61155Z" fill="#011235"/> </svg> ` } ] }; }, props: { isOpen: { type: Boolean, default: false } }, methods: { close() { this.$emit('close'); }, openPage(link) { this.$router.push(link); this.close(); }, isActive(link) { return this.$route.path === link; } } }; </script> <style scoped> .bg-blue-100 { background-color: #e6f2ff; } .dark .dark\:bg-blue-900 { background-color: #1e3a8a; } button:hover { background-color: #f0f7ff; } .dark button:hover { background-color: #2c4a8c; } button { transition: background-color 0.2s ease-in-out; } </style>