You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
779 B

4 years ago
  1. <script lang="ts">
  2. import { createEventDispatcher } from "svelte";
  3. import type { ModalData } from "../stores/modal";
  4. import modalStore from "../stores/modal";
  5. export let open: ModalData = {name: "none"};
  6. const dispatch = createEventDispatcher();
  7. function handleClick() {
  8. dispatch("click", {open});
  9. if (open.name !== "none") {
  10. modalStore.set(open);
  11. }
  12. }
  13. </script>
  14. <div on:click={handleClick} class="option"><slot></slot></div>
  15. <style>
  16. div.option {
  17. display: inline-block;
  18. font-size: 0.9em;
  19. padding: 0.125em 0.75ch;
  20. cursor: pointer;
  21. color: #aa8822;
  22. user-select: none;
  23. -webkit-user-select: none;
  24. -moz-user-select: none;
  25. }
  26. div.option:hover {
  27. color: #FC1;
  28. text-decoration: underline;
  29. }
  30. </style>