Nav.svelte 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <script>
  2. import { stores } from "@sapper/app";
  3. let { session } = stores();
  4. export let segment;
  5. </script>
  6. <style lang="css">
  7. nav {
  8. @apply .w-2/12 .bg-gray-800 .rounded-l-sm .overflow-y-auto .flex .flex-col;
  9. }
  10. .user-box {
  11. @apply .flex .items-center p-2 bg-gray-dark;
  12. & > img {
  13. @apply .w-1/5 .rounded-full;
  14. }
  15. & > div {
  16. @apply .m-2 .font-bold .text-gray-100;
  17. }
  18. }
  19. .button-list {
  20. @apply .flex .flex-col .m-2 p-2;
  21. & > h2 {
  22. @apply .text-lg .my-1 .text-white .font-bold .uppercase .mt-2;
  23. }
  24. & > a {
  25. @apply .bg-gray-800 .px-2 .py-1 .rounded-sm .font-medium;
  26. &:hover {
  27. @apply .bg-gray-700;
  28. }
  29. &[data-active="true"] {
  30. @apply .bg-blue-800;
  31. }
  32. }
  33. }
  34. </style>
  35. <nav role="navigation">
  36. <div class="user-box">
  37. <img alt="User Avatar" src={$session.user.avatarURL} />
  38. <div>{$session.user.username}</div>
  39. </div>
  40. <div class="button-list">
  41. <h2>Features</h2>
  42. <a data-active={segment === 'contest'} href="dashboard/contest">Contest</a>
  43. </div>
  44. </nav>