diff --git a/bun.lockb b/bun.lockb index fb03fc2..40448cf 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 7503821..a128817 100644 --- a/package.json +++ b/package.json @@ -20,20 +20,15 @@ "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-separator": "^1.1.0", "@radix-ui/react-slot": "^1.1.0", - "@types/leaflet": "^1.9.12", - "@types/react": "^18.3.3", - "@types/react-dom": "^18.3.0", "astro": "^4.11.6", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "dayjs": "^1.11.11", "htmx.org": "^1.9.12", - "hyperscript.org": "^0.9.12", "kysely": "^0.26.3", "leaflet": "^1.9.4", "lit": "^3.1.4", "lucide-react": "^0.309.0", - "nanoid": "^5.0.7", "react": "^18.3.1", "react-dom": "^18.3.1", "tailwind-merge": "^2.4.0", @@ -43,6 +38,9 @@ "typescript": "^5.5.3" }, "devDependencies": { + "@types/leaflet": "^1.9.12", + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", "@types/bun": "^1.1.6", "@types/google.maps": "^3.55.11", "@types/toastify-js": "^1.12.3" diff --git a/public/css/tailwind.css b/public/css/tailwind.css deleted file mode 100644 index 73750ce..0000000 --- a/public/css/tailwind.css +++ /dev/null @@ -1,1276 +0,0 @@ -/* -! tailwindcss v3.4.4 | MIT License | https://tailwindcss.com -*/ - -/* -1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) -2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) -*/ - -*, -::before, -::after { - box-sizing: border-box; - /* 1 */ - border-width: 0; - /* 2 */ - border-style: solid; - /* 2 */ - border-color: #e5e7eb; - /* 2 */ -} - -::before, -::after { - --tw-content: ''; -} - -/* -1. Use a consistent sensible line-height in all browsers. -2. Prevent adjustments of font size after orientation changes in iOS. -3. Use a more readable tab size. -4. Use the user's configured `sans` font-family by default. -5. Use the user's configured `sans` font-feature-settings by default. -6. Use the user's configured `sans` font-variation-settings by default. -7. Disable tap highlights on iOS -*/ - -html, -:host { - line-height: 1.5; - /* 1 */ - -webkit-text-size-adjust: 100%; - /* 2 */ - -moz-tab-size: 4; - /* 3 */ - -o-tab-size: 4; - tab-size: 4; - /* 3 */ - font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; - /* 4 */ - font-feature-settings: normal; - /* 5 */ - font-variation-settings: normal; - /* 6 */ - -webkit-tap-highlight-color: transparent; - /* 7 */ -} - -/* -1. Remove the margin in all browsers. -2. Inherit line-height from `html` so users can set them as a class directly on the `html` element. -*/ - -body { - margin: 0; - /* 1 */ - line-height: inherit; - /* 2 */ -} - -/* -1. Add the correct height in Firefox. -2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) -3. Ensure horizontal rules are visible by default. -*/ - -hr { - height: 0; - /* 1 */ - color: inherit; - /* 2 */ - border-top-width: 1px; - /* 3 */ -} - -/* -Add the correct text decoration in Chrome, Edge, and Safari. -*/ - -abbr:where([title]) { - -webkit-text-decoration: underline dotted; - text-decoration: underline dotted; -} - -/* -Remove the default font size and weight for headings. -*/ - -h1, -h2, -h3, -h4, -h5, -h6 { - font-size: inherit; - font-weight: inherit; -} - -/* -Reset links to optimize for opt-in styling instead of opt-out. -*/ - -a { - color: inherit; - text-decoration: inherit; -} - -/* -Add the correct font weight in Edge and Safari. -*/ - -b, -strong { - font-weight: bolder; -} - -/* -1. Use the user's configured `mono` font-family by default. -2. Use the user's configured `mono` font-feature-settings by default. -3. Use the user's configured `mono` font-variation-settings by default. -4. Correct the odd `em` font sizing in all browsers. -*/ - -code, -kbd, -samp, -pre { - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; - /* 1 */ - font-feature-settings: normal; - /* 2 */ - font-variation-settings: normal; - /* 3 */ - font-size: 1em; - /* 4 */ -} - -/* -Add the correct font size in all browsers. -*/ - -small { - font-size: 80%; -} - -/* -Prevent `sub` and `sup` elements from affecting the line height in all browsers. -*/ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sub { - bottom: -0.25em; -} - -sup { - top: -0.5em; -} - -/* -1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) -2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) -3. Remove gaps between table borders by default. -*/ - -table { - text-indent: 0; - /* 1 */ - border-color: inherit; - /* 2 */ - border-collapse: collapse; - /* 3 */ -} - -/* -1. Change the font styles in all browsers. -2. Remove the margin in Firefox and Safari. -3. Remove default padding in all browsers. -*/ - -button, -input, -optgroup, -select, -textarea { - font-family: inherit; - /* 1 */ - font-feature-settings: inherit; - /* 1 */ - font-variation-settings: inherit; - /* 1 */ - font-size: 100%; - /* 1 */ - font-weight: inherit; - /* 1 */ - line-height: inherit; - /* 1 */ - letter-spacing: inherit; - /* 1 */ - color: inherit; - /* 1 */ - margin: 0; - /* 2 */ - padding: 0; - /* 3 */ -} - -/* -Remove the inheritance of text transform in Edge and Firefox. -*/ - -button, -select { - text-transform: none; -} - -/* -1. Correct the inability to style clickable types in iOS and Safari. -2. Remove default button styles. -*/ - -button, -input:where([type='button']), -input:where([type='reset']), -input:where([type='submit']) { - -webkit-appearance: button; - /* 1 */ - background-color: transparent; - /* 2 */ - background-image: none; - /* 2 */ -} - -/* -Use the modern Firefox focus style for all focusable elements. -*/ - -:-moz-focusring { - outline: auto; -} - -/* -Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) -*/ - -:-moz-ui-invalid { - box-shadow: none; -} - -/* -Add the correct vertical alignment in Chrome and Firefox. -*/ - -progress { - vertical-align: baseline; -} - -/* -Correct the cursor style of increment and decrement buttons in Safari. -*/ - -::-webkit-inner-spin-button, -::-webkit-outer-spin-button { - height: auto; -} - -/* -1. Correct the odd appearance in Chrome and Safari. -2. Correct the outline style in Safari. -*/ - -[type='search'] { - -webkit-appearance: textfield; - /* 1 */ - outline-offset: -2px; - /* 2 */ -} - -/* -Remove the inner padding in Chrome and Safari on macOS. -*/ - -::-webkit-search-decoration { - -webkit-appearance: none; -} - -/* -1. Correct the inability to style clickable types in iOS and Safari. -2. Change font properties to `inherit` in Safari. -*/ - -::-webkit-file-upload-button { - -webkit-appearance: button; - /* 1 */ - font: inherit; - /* 2 */ -} - -/* -Add the correct display in Chrome and Safari. -*/ - -summary { - display: list-item; -} - -/* -Removes the default spacing and border for appropriate elements. -*/ - -blockquote, -dl, -dd, -h1, -h2, -h3, -h4, -h5, -h6, -hr, -figure, -p, -pre { - margin: 0; -} - -fieldset { - margin: 0; - padding: 0; -} - -legend { - padding: 0; -} - -ol, -ul, -menu { - list-style: none; - margin: 0; - padding: 0; -} - -/* -Reset default styling for dialogs. -*/ - -dialog { - padding: 0; -} - -/* -Prevent resizing textareas horizontally by default. -*/ - -textarea { - resize: vertical; -} - -/* -1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) -2. Set the default placeholder color to the user's configured gray 400 color. -*/ - -input::-moz-placeholder, textarea::-moz-placeholder { - opacity: 1; - /* 1 */ - color: #9ca3af; - /* 2 */ -} - -input::placeholder, -textarea::placeholder { - opacity: 1; - /* 1 */ - color: #9ca3af; - /* 2 */ -} - -/* -Set the default cursor for buttons. -*/ - -button, -[role="button"] { - cursor: pointer; -} - -/* -Make sure disabled buttons don't get the pointer cursor. -*/ - -:disabled { - cursor: default; -} - -/* -1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) -2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) - This can trigger a poorly considered lint error in some tools but is included by design. -*/ - -img, -svg, -video, -canvas, -audio, -iframe, -embed, -object { - display: block; - /* 1 */ - vertical-align: middle; - /* 2 */ -} - -/* -Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) -*/ - -img, -video { - max-width: 100%; - height: auto; -} - -/* Make elements with the HTML hidden attribute stay hidden by default */ - -[hidden] { - display: none; -} - -:root { - --background: 0 0% 100%; - --foreground: 222.2 84% 4.9%; - --card: 0 0% 100%; - --card-foreground: 222.2 84% 4.9%; - --popover: 0 0% 100%; - --popover-foreground: 222.2 84% 4.9%; - --primary: 222.2 47.4% 11.2%; - --primary-foreground: 210 40% 98%; - --secondary: 210 40% 96.1%; - --secondary-foreground: 222.2 47.4% 11.2%; - --muted: 210 40% 96.1%; - --muted-foreground: 215.4 16.3% 46.9%; - --accent: 210 40% 96.1%; - --accent-foreground: 222.2 47.4% 11.2%; - --destructive: 0 84.2% 60.2%; - --destructive-foreground: 210 40% 98%; - --border: 214.3 31.8% 91.4%; - --input: 214.3 31.8% 91.4%; - --ring: 222.2 84% 4.9%; - --radius: 0.5rem; -} - -* { - border-color: hsl(var(--border)); -} - -body { - background-color: hsl(var(--background)); - color: hsl(var(--foreground)); -} - -*, ::before, ::after { - --tw-border-spacing-x: 0; - --tw-border-spacing-y: 0; - --tw-translate-x: 0; - --tw-translate-y: 0; - --tw-rotate: 0; - --tw-skew-x: 0; - --tw-skew-y: 0; - --tw-scale-x: 1; - --tw-scale-y: 1; - --tw-pan-x: ; - --tw-pan-y: ; - --tw-pinch-zoom: ; - --tw-scroll-snap-strictness: proximity; - --tw-gradient-from-position: ; - --tw-gradient-via-position: ; - --tw-gradient-to-position: ; - --tw-ordinal: ; - --tw-slashed-zero: ; - --tw-numeric-figure: ; - --tw-numeric-spacing: ; - --tw-numeric-fraction: ; - --tw-ring-inset: ; - --tw-ring-offset-width: 0px; - --tw-ring-offset-color: #fff; - --tw-ring-color: rgb(59 130 246 / 0.5); - --tw-ring-offset-shadow: 0 0 #0000; - --tw-ring-shadow: 0 0 #0000; - --tw-shadow: 0 0 #0000; - --tw-shadow-colored: 0 0 #0000; - --tw-blur: ; - --tw-brightness: ; - --tw-contrast: ; - --tw-grayscale: ; - --tw-hue-rotate: ; - --tw-invert: ; - --tw-saturate: ; - --tw-sepia: ; - --tw-drop-shadow: ; - --tw-backdrop-blur: ; - --tw-backdrop-brightness: ; - --tw-backdrop-contrast: ; - --tw-backdrop-grayscale: ; - --tw-backdrop-hue-rotate: ; - --tw-backdrop-invert: ; - --tw-backdrop-opacity: ; - --tw-backdrop-saturate: ; - --tw-backdrop-sepia: ; - --tw-contain-size: ; - --tw-contain-layout: ; - --tw-contain-paint: ; - --tw-contain-style: ; -} - -::backdrop { - --tw-border-spacing-x: 0; - --tw-border-spacing-y: 0; - --tw-translate-x: 0; - --tw-translate-y: 0; - --tw-rotate: 0; - --tw-skew-x: 0; - --tw-skew-y: 0; - --tw-scale-x: 1; - --tw-scale-y: 1; - --tw-pan-x: ; - --tw-pan-y: ; - --tw-pinch-zoom: ; - --tw-scroll-snap-strictness: proximity; - --tw-gradient-from-position: ; - --tw-gradient-via-position: ; - --tw-gradient-to-position: ; - --tw-ordinal: ; - --tw-slashed-zero: ; - --tw-numeric-figure: ; - --tw-numeric-spacing: ; - --tw-numeric-fraction: ; - --tw-ring-inset: ; - --tw-ring-offset-width: 0px; - --tw-ring-offset-color: #fff; - --tw-ring-color: rgb(59 130 246 / 0.5); - --tw-ring-offset-shadow: 0 0 #0000; - --tw-ring-shadow: 0 0 #0000; - --tw-shadow: 0 0 #0000; - --tw-shadow-colored: 0 0 #0000; - --tw-blur: ; - --tw-brightness: ; - --tw-contrast: ; - --tw-grayscale: ; - --tw-hue-rotate: ; - --tw-invert: ; - --tw-saturate: ; - --tw-sepia: ; - --tw-drop-shadow: ; - --tw-backdrop-blur: ; - --tw-backdrop-brightness: ; - --tw-backdrop-contrast: ; - --tw-backdrop-grayscale: ; - --tw-backdrop-hue-rotate: ; - --tw-backdrop-invert: ; - --tw-backdrop-opacity: ; - --tw-backdrop-saturate: ; - --tw-backdrop-sepia: ; - --tw-contain-size: ; - --tw-contain-layout: ; - --tw-contain-paint: ; - --tw-contain-style: ; -} - -.container { - width: 100%; - margin-right: auto; - margin-left: auto; - padding-right: 2rem; - padding-left: 2rem; -} - -@media (min-width: 640px) { - .container { - max-width: 640px; - } -} - -@media (min-width: 768px) { - .container { - max-width: 768px; - } -} - -@media (min-width: 1024px) { - .container { - max-width: 1024px; - } -} - -@media (min-width: 1280px) { - .container { - max-width: 1280px; - } -} - -@media (min-width: 1536px) { - .container { - max-width: 1536px; - } -} - -.absolute { - position: absolute; -} - -.relative { - position: relative; -} - -.my-6 { - margin-top: 1.5rem; - margin-bottom: 1.5rem; -} - -.my-8 { - margin-top: 2rem; - margin-bottom: 2rem; -} - -.mr-2 { - margin-right: 0.5rem; -} - -.mt-10 { - margin-top: 2.5rem; -} - -.mt-2 { - margin-top: 0.5rem; -} - -.mt-4 { - margin-top: 1rem; -} - -.flex { - display: flex; -} - -.inline-flex { - display: inline-flex; -} - -.grid { - display: grid; -} - -.contents { - display: contents; -} - -.hidden { - display: none; -} - -.h-10 { - height: 2.5rem; -} - -.h-11 { - height: 2.75rem; -} - -.h-4 { - height: 1rem; -} - -.h-6 { - height: 1.5rem; -} - -.h-9 { - height: 2.25rem; -} - -.h-\[1px\] { - height: 1px; -} - -.h-\[450px\] { - height: 450px; -} - -.h-\[475px\] { - height: 475px; -} - -.h-full { - height: 100%; -} - -.min-h-\[80px\] { - min-height: 80px; -} - -.w-10 { - width: 2.5rem; -} - -.w-4 { - width: 1rem; -} - -.w-6 { - width: 1.5rem; -} - -.w-\[1px\] { - width: 1px; -} - -.w-full { - width: 100%; -} - -.max-w-md { - max-width: 28rem; -} - -.max-w-sm { - max-width: 24rem; -} - -.shrink-0 { - flex-shrink: 0; -} - -@keyframes pulse { - 50% { - opacity: .5; - } -} - -.animate-pulse { - animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; -} - -.resize-none { - resize: none; -} - -.scroll-m-20 { - scroll-margin: 5rem; -} - -.flex-col { - flex-direction: column; -} - -.items-center { - align-items: center; -} - -.justify-center { - justify-content: center; -} - -.gap-1 { - gap: 0.25rem; -} - -.gap-1\.5 { - gap: 0.375rem; -} - -.gap-2 { - gap: 0.5rem; -} - -.gap-4 { - gap: 1rem; -} - -.gap-8 { - gap: 2rem; -} - -.space-y-1 > :not([hidden]) ~ :not([hidden]) { - --tw-space-y-reverse: 0; - margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse))); - margin-bottom: calc(0.25rem * var(--tw-space-y-reverse)); -} - -.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { - --tw-space-y-reverse: 0; - margin-top: calc(0.375rem * calc(1 - var(--tw-space-y-reverse))); - margin-bottom: calc(0.375rem * var(--tw-space-y-reverse)); -} - -.overflow-hidden { - overflow: hidden; -} - -.whitespace-nowrap { - white-space: nowrap; -} - -.rounded { - border-radius: 0.25rem; -} - -.rounded-lg { - border-radius: var(--radius); -} - -.rounded-md { - border-radius: calc(var(--radius) - 2px); -} - -.rounded-sm { - border-radius: calc(var(--radius) - 4px); -} - -.border { - border-width: 1px; -} - -.border-2 { - border-width: 2px; -} - -.border-b { - border-bottom-width: 1px; -} - -.border-indigo-800 { - --tw-border-opacity: 1; - border-color: rgb(55 48 163 / var(--tw-border-opacity)); -} - -.border-input { - border-color: hsl(var(--input)); -} - -.border-primary { - border-color: hsl(var(--primary)); -} - -.border-slate-700 { - --tw-border-opacity: 1; - border-color: rgb(51 65 85 / var(--tw-border-opacity)); -} - -.border-zinc-200 { - --tw-border-opacity: 1; - border-color: rgb(228 228 231 / var(--tw-border-opacity)); -} - -.bg-background { - background-color: hsl(var(--background)); -} - -.bg-border { - background-color: hsl(var(--border)); -} - -.bg-card { - background-color: hsl(var(--card)); -} - -.bg-destructive { - background-color: hsl(var(--destructive)); -} - -.bg-green-700 { - --tw-bg-opacity: 1; - background-color: rgb(21 128 61 / var(--tw-bg-opacity)); -} - -.bg-indigo-600 { - --tw-bg-opacity: 1; - background-color: rgb(79 70 229 / var(--tw-bg-opacity)); -} - -.bg-primary { - background-color: hsl(var(--primary)); -} - -.bg-secondary { - background-color: hsl(var(--secondary)); -} - -.bg-slate-900 { - --tw-bg-opacity: 1; - background-color: rgb(15 23 42 / var(--tw-bg-opacity)); -} - -.p-2 { - padding: 0.5rem; -} - -.p-4 { - padding: 1rem; -} - -.p-6 { - padding: 1.5rem; -} - -.px-2 { - padding-left: 0.5rem; - padding-right: 0.5rem; -} - -.px-3 { - padding-left: 0.75rem; - padding-right: 0.75rem; -} - -.px-4 { - padding-left: 1rem; - padding-right: 1rem; -} - -.px-8 { - padding-left: 2rem; - padding-right: 2rem; -} - -.py-2 { - padding-top: 0.5rem; - padding-bottom: 0.5rem; -} - -.pb-0 { - padding-bottom: 0px; -} - -.pb-2 { - padding-bottom: 0.5rem; -} - -.pt-0 { - padding-top: 0px; -} - -.text-center { - text-align: center; -} - -.text-2xl { - font-size: 1.5rem; - line-height: 2rem; -} - -.text-4xl { - font-size: 2.25rem; - line-height: 2.5rem; -} - -.text-lg { - font-size: 1.125rem; - line-height: 1.75rem; -} - -.text-sm { - font-size: 0.875rem; - line-height: 1.25rem; -} - -.text-xl { - font-size: 1.25rem; - line-height: 1.75rem; -} - -.font-extrabold { - font-weight: 800; -} - -.font-medium { - font-weight: 500; -} - -.font-semibold { - font-weight: 600; -} - -.leading-7 { - line-height: 1.75rem; -} - -.leading-none { - line-height: 1; -} - -.tracking-tight { - letter-spacing: -0.025em; -} - -.text-card-foreground { - color: hsl(var(--card-foreground)); -} - -.text-current { - color: currentColor; -} - -.text-destructive-foreground { - color: hsl(var(--destructive-foreground)); -} - -.text-muted-foreground { - color: hsl(var(--muted-foreground)); -} - -.text-primary { - color: hsl(var(--primary)); -} - -.text-primary-foreground { - color: hsl(var(--primary-foreground)); -} - -.text-secondary-foreground { - color: hsl(var(--secondary-foreground)); -} - -.text-white { - --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); -} - -.underline-offset-4 { - text-underline-offset: 4px; -} - -.shadow { - --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); - --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color); - box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); -} - -.shadow-sm { - --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); - --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color); - box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); -} - -.outline { - outline-style: solid; -} - -.ring-offset-background { - --tw-ring-offset-color: hsl(var(--background)); -} - -.blur-2xl { - --tw-blur: blur(40px); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); -} - -.drop-shadow-xl { - --tw-drop-shadow: drop-shadow(0 20px 13px rgb(0 0 0 / 0.03)) drop-shadow(0 8px 5px rgb(0 0 0 / 0.08)); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); -} - -.transition { - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter; - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; -} - -.transition-colors { - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; -} - -.duration-300 { - transition-duration: 300ms; -} - -.duration-700 { - transition-duration: 700ms; -} - -.ease-in-out { - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); -} - -@keyframes enter { - from { - opacity: var(--tw-enter-opacity, 1); - transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0)); - } -} - -@keyframes exit { - to { - opacity: var(--tw-exit-opacity, 1); - transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0)); - } -} - -.duration-300 { - animation-duration: 300ms; -} - -.duration-700 { - animation-duration: 700ms; -} - -.ease-in-out { - animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); -} - -.file\:border-0::file-selector-button { - border-width: 0px; -} - -.file\:bg-inherit::file-selector-button { - background-color: inherit; -} - -.file\:bg-transparent::file-selector-button { - background-color: transparent; -} - -.file\:text-sm::file-selector-button { - font-size: 0.875rem; - line-height: 1.25rem; -} - -.file\:font-medium::file-selector-button { - font-weight: 500; -} - -.placeholder\:text-muted-foreground::-moz-placeholder { - color: hsl(var(--muted-foreground)); -} - -.placeholder\:text-muted-foreground::placeholder { - color: hsl(var(--muted-foreground)); -} - -.placeholder\:text-slate-400::-moz-placeholder { - --tw-text-opacity: 1; - color: rgb(148 163 184 / var(--tw-text-opacity)); -} - -.placeholder\:text-slate-400::placeholder { - --tw-text-opacity: 1; - color: rgb(148 163 184 / var(--tw-text-opacity)); -} - -.first\:mt-0:first-child { - margin-top: 0px; -} - -.hover\:animate-none:hover { - animation: none; -} - -.hover\:bg-accent:hover { - background-color: hsl(var(--accent)); -} - -.hover\:bg-destructive\/90:hover { - background-color: hsl(var(--destructive) / 0.9); -} - -.hover\:bg-green-600:hover { - --tw-bg-opacity: 1; - background-color: rgb(22 163 74 / var(--tw-bg-opacity)); -} - -.hover\:bg-indigo-700:hover { - --tw-bg-opacity: 1; - background-color: rgb(67 56 202 / var(--tw-bg-opacity)); -} - -.hover\:bg-primary\/90:hover { - background-color: hsl(var(--primary) / 0.9); -} - -.hover\:bg-secondary\/80:hover { - background-color: hsl(var(--secondary) / 0.8); -} - -.hover\:text-accent-foreground:hover { - color: hsl(var(--accent-foreground)); -} - -.hover\:underline:hover { - text-decoration-line: underline; -} - -.focus-visible\:outline-none:focus-visible { - outline: 2px solid transparent; - outline-offset: 2px; -} - -.focus-visible\:ring-2:focus-visible { - --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); - --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); - box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); -} - -.focus-visible\:ring-ring:focus-visible { - --tw-ring-color: hsl(var(--ring)); -} - -.focus-visible\:ring-offset-2:focus-visible { - --tw-ring-offset-width: 2px; -} - -.disabled\:pointer-events-none:disabled { - pointer-events: none; -} - -.disabled\:cursor-not-allowed:disabled { - cursor: not-allowed; -} - -.disabled\:opacity-50:disabled { - opacity: 0.5; -} - -.peer:disabled ~ .peer-disabled\:cursor-not-allowed { - cursor: not-allowed; -} - -.peer:disabled ~ .peer-disabled\:opacity-70 { - opacity: 0.7; -} - -.data-\[state\=checked\]\:bg-primary[data-state=checked] { - background-color: hsl(var(--primary)); -} - -.data-\[state\=checked\]\:text-primary-foreground[data-state=checked] { - color: hsl(var(--primary-foreground)); -} - -@media (min-width: 1024px) { - .lg\:text-5xl { - font-size: 3rem; - line-height: 1; - } - - .lg\:text-lg { - font-size: 1.125rem; - line-height: 1.75rem; - } -} - -.\[\&\:not\(\:first-child\)\]\:mt-6:not(:first-child) { - margin-top: 1.5rem; -} diff --git a/public/sample-selfie.webp b/public/sample-selfie.webp deleted file mode 100644 index 91b43b4..0000000 Binary files a/public/sample-selfie.webp and /dev/null differ diff --git a/src/components/LeafletMap/controls.ts b/src/components/LeafletMap/controls.ts deleted file mode 100644 index af3a1cc..0000000 --- a/src/components/LeafletMap/controls.ts +++ /dev/null @@ -1,59 +0,0 @@ -import L, { type LatLngTuple } from "leaflet"; - -const GoToTargetControl = L.Control.extend({ - _targetLocation: null as LatLngTuple | null, - setTargetLocation: function (latlng: LatLngTuple) { - this._targetLocation = latlng; - }, - onAdd: function (map: L.Map) { - const locationButton = document.createElement("button"); - - locationButton.id = "go-to-target-control-button"; - - locationButton.textContent = "Hedefe Git"; - - locationButton.classList.add("custom-map-control-button"); - - L.DomEvent.on(locationButton, "click", () => { - if (!this._targetLocation) return; - map.setView(this._targetLocation, 18); - }); - - return locationButton; - }, -}); - -const GeolocationControl = L.Control.extend({ - _containerEl: null as HTMLButtonElement | null, - _currentLocationMarker: null as L.Marker | null, - setCurrentLocationMarker: function (marker?: L.Marker) { - if (marker) this._currentLocationMarker = marker; - }, - onAdd: function (map: L.Map) { - const locationButton = document.createElement("button"); - - this._containerEl = locationButton; - - locationButton.id = "ask-permission-control-button"; - - locationButton.textContent = "Konumuma Git"; - - locationButton.classList.add("custom-map-control-button"); - - locationButton.type = "button"; - - L.DomEvent.on(locationButton, "click", () => { - console.log(this._currentLocationMarker); - if (this._currentLocationMarker) { - map.setView(this._currentLocationMarker.getLatLng(), 12); - } - }); - - return locationButton; - }, - onRemove: function () { - L.DomEvent.off(this._containerEl!); - }, -}); - -export { GoToTargetControl, GeolocationControl }; diff --git a/src/components/LeafletMap/geolocation.ts b/src/components/LeafletMap/geolocation.ts deleted file mode 100644 index 05b88fc..0000000 --- a/src/components/LeafletMap/geolocation.ts +++ /dev/null @@ -1,63 +0,0 @@ -import Toastify from "toastify-js"; -import L from "leaflet"; -import { currentLocationIcon } from "./icons"; - -function onLocationError(err: L.ErrorEvent) { - let errorMessage; - switch (err.code) { - case 1: - errorMessage = - "Konum izni alınamadı, lütfen tarayıcınızın ve cihazınızın gizlilik ayarlarını kontrol edin."; - break; - case 2: - errorMessage = - "Konumunuz tespit edilemedi, lütfen biraz sonra tekrar deneyiniz."; - break; - case 3: - errorMessage = - "Konum isteği zaman aşımına uğradı, lütfen sayfayı yenileyip tekrar deneyiniz."; - break; - default: - errorMessage = - "Konum izni alınamadı, lütfen tarayıcınızın ve cihazınızın gizlilik ayarlarını kontrol edin."; - break; - } - - Toastify({ - text: errorMessage, - duration: 3000, - gravity: "top", // `top` or `bottom` - position: "center", // `left`, `center` or `right` - stopOnFocus: true, // Prevents dismissing of toast on hover - style: { - background: "black", - borderRadius: "6px", - margin: "16px", - }, - onClick: function () {}, // Callback after click - }).showToast(); -} - -function onLocationSuccess( - locationEvent: L.LocationEvent, - map: L.Map, - currentLocationMarker: L.Marker | undefined -) { - const position = locationEvent.latlng; - - const currentPos = { - lat: position.lat, - lng: position.lng, - }; - - if (currentLocationMarker) { - currentLocationMarker.setLatLng(currentPos); - } else { - currentLocationMarker = L.marker(currentPos, { - icon: currentLocationIcon, - }); - currentLocationMarker.addTo(map); - } -} - -export { onLocationError, onLocationSuccess }; diff --git a/src/components/LeafletMap/icons.ts b/src/components/LeafletMap/icons.ts deleted file mode 100644 index 5e255cf..0000000 --- a/src/components/LeafletMap/icons.ts +++ /dev/null @@ -1,13 +0,0 @@ -import L from "leaflet"; - -var targetLocationIcon = L.icon({ - iconUrl: "goal.svg", - iconSize: [32, 32], -}); - -var currentLocationIcon = L.icon({ - iconUrl: "blue-dot.png", - iconSize: [32, 32], -}); - -export { targetLocationIcon, currentLocationIcon }; diff --git a/src/components/LockedContent/icons.ts b/src/components/LockedContent/icons.ts deleted file mode 100644 index f3ab932..0000000 --- a/src/components/LockedContent/icons.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { html } from "lit"; - -// Locked lock icon -const lockSVG = html` - -`; - -// Unlocked lock icon -const unlockSVG = html` - - - -`; - -export { lockSVG, unlockSVG }; diff --git a/src/components/LockedContent/templates.ts b/src/components/LockedContent/templates.ts deleted file mode 100644 index 5cbee98..0000000 --- a/src/components/LockedContent/templates.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { html } from "lit"; -import { lockSVG, unlockSVG } from "./icons"; - -// This template is shown when user hasn't give geolocation permission yet -// When user click the button user is asked for geolocation permission -function permissionButtonTemplate(onClickHandler: () => void) { - return html` -
- -
-
-

- Ne kadar yaklaştığını görmek için aşağıdaki butona bas. -

- -
-
-
- `; -} - -// This template is shown when user has not given permission -function permissionDeniedButtonTemplate() { - return html`
- -
-
-

- Konumuna erişim izni vermediğin için hedefe ne kadar
- yakın olduğun tespit edilemiyor. -

-
-
-
`; -} - -// This template is shown when user has given permission but has not arrived yet -function lockedButtonTemplate(proximityText: string | undefined) { - return html`
- -
-
-

- İçeriği görmek için konuma gitmelisin! Kalan mesafe: ${proximityText} -

-
-
-
`; -} - -// This template is shown when user has arrived to the target location -// When user click the button counter at the bottom of the page is incremented -// and image is revealed -function unlockedButtonTemplate(onClickHandler: () => void) { - return html`
- - -
-
-

İçeriği görmek için butona bas!

-
-
-
`; -} - -export { - lockedButtonTemplate, - unlockedButtonTemplate, - permissionButtonTemplate, - permissionDeniedButtonTemplate, -}; diff --git a/src/components/leaflet-map.ts b/src/components/leaflet-map.ts deleted file mode 100644 index 61034b1..0000000 --- a/src/components/leaflet-map.ts +++ /dev/null @@ -1,100 +0,0 @@ -// Lit -import { - html, - LitElement, - unsafeCSS, - type CSSResultGroup, - type PropertyValues, -} from "lit"; -import { customElement, property, query, state } from "lit/decorators.js"; - -// Leaflet -import L, { Map } from "leaflet"; -import type { LatLngTuple } from "leaflet"; -import { currentLocationIcon, targetLocationIcon } from "./LeafletMap/icons"; -import { GeolocationControl, GoToTargetControl } from "./LeafletMap/controls"; - -// Styles -import leafletStyles from "leaflet/dist/leaflet.css?inline"; -import globalStyles from "@/styles/globals.css?inline"; -import mapStyles from "@/styles/locked-page.css?inline"; - -@customElement("leaflet-map") -export class LeafletMap extends LitElement { - // Styles - static styles?: CSSResultGroup | undefined = [ - unsafeCSS(leafletStyles), - unsafeCSS(globalStyles), - unsafeCSS(mapStyles), - ]; - - // Div element to initialize Leaflet in - @query("#mapid") - _mapElement!: HTMLDivElement; - - // Properties and states - @property({ type: Object, noAccessor: true }) targetPosition?: LatLngTuple; - @property({ type: Object }) - currentPosition?: LatLngTuple; - - protected _map?: L.Map; - protected _currentLocationMarker?: L.Marker; - - firstUpdated(): void { - if (!this._mapElement || !this.targetPosition) return; - this._map = new Map(this._mapElement).setView(this.targetPosition, 13); - - L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png", { - maxZoom: 19, - attribution: - '© OpenStreetMap', - }).addTo(this._map); - - // Add target location icon marker - L.marker(this.targetPosition, { icon: targetLocationIcon }).addTo( - this._map - ); - - L.circle(this.targetPosition, { - color: "blue", - fillColor: "#30f", - fillOpacity: 0.2, - radius: 50, - }).addTo(this._map); - - // Add target location control - const targetLocationControl = new GoToTargetControl({ - position: "bottomleft", - }); - - targetLocationControl.setTargetLocation(this.targetPosition); - targetLocationControl.addTo(this._map); - } - - protected update(changedProperties: PropertyValues): void { - super.update(changedProperties); - if (changedProperties.get("currentPosition")) { - if (!this._currentLocationMarker && this._map) { - this._currentLocationMarker = L.marker(this.currentPosition!, { - icon: currentLocationIcon, - }); - this._currentLocationMarker.addTo(this._map); - - const geolocationControl = new GeolocationControl({ - position: "bottomleft", - }); - - geolocationControl.setCurrentLocationMarker( - this._currentLocationMarker - ); - geolocationControl.addTo(this._map); - } else if (this._currentLocationMarker) { - this._currentLocationMarker.setLatLng(this.currentPosition!); - } - } - } - - render() { - return html`
`; - } -} diff --git a/src/components/locked-content.ts b/src/components/locked-content.ts deleted file mode 100644 index c3ccf3f..0000000 --- a/src/components/locked-content.ts +++ /dev/null @@ -1,151 +0,0 @@ -// Lit imports -import { LitElement, html, nothing, unsafeCSS, type CSSResultGroup } from "lit"; -import { customElement, property, state } from "lit/decorators.js"; - -// Leaflet -import { type LatLngTuple } from "leaflet"; - -// Styles -import globalStyles from "@/styles/globals.css?inline"; -import lockedContentStyles from "../styles/locked-content.css?inline"; - -// Templates -import { - lockedButtonTemplate, - permissionButtonTemplate, - permissionDeniedButtonTemplate, - unlockedButtonTemplate, -} from "./LockedContent/templates"; - -// Geolocation utils -import { calculateDistance } from "./LockedContent/geolocation"; -import { incrementUnlockCounter } from "./LockedContent/serverUtils"; - -// LockedContent is a custom element watching user location and blurring -// given image until user has arrived a certain position -@customElement("locked-content") -export class LockedContent extends LitElement { - // Constants - geolocationOptions = { - enableHighAccuracy: true, - timeout: 15000, - maximumAge: 0, - }; - - // Tailwind and custom styles - static styles: CSSResultGroup | undefined = [ - unsafeCSS(globalStyles), - unsafeCSS(lockedContentStyles), - ]; - - // Components properties/attributes, no accessor attribute disables detecting - // changes as these are readonly attributes there is no need to attach setters - @property({ noAccessor: true }) readonly imageId?: string; - @property({ noAccessor: true }) readonly imageURL?: string; - @property({ type: Object, noAccessor: true }) - readonly targetPosition?: LatLngTuple; - @property({ type: Object }) - currentPosition?: LatLngTuple; - - // Reactive states, template is rendered according to this states - @state() - protected _unlocked = false; - @state() - protected _arrived = false; - @state() - protected _distanceText?: string; - - private _updateDistanceText(distance: number) { - // Update the proximity text according to the distance remaining - if (distance > 1000) { - this._distanceText = `${(distance / 1000).toFixed()} KM`; - } else if (distance > 100) { - this._distanceText = `${distance.toFixed(0)} M`; - } - } - - private _checkArrived(distance: number) { - // If target is close less then 100 meters user has arrived to target location - if (distance < 100) { - // Update state to reveal the image - this._arrived = true; - } - } - - private _dispatchAskPermissionEvent() { - const event = new Event("askpermission", { bubbles: true, composed: true }); - this.dispatchEvent(event); - } - - // This template is shown when user hasn't give geolocation permission yet - // When user click the button user is asked for geolocation permission - private _permissionButtonTemplate = () => - permissionButtonTemplate(this._dispatchAskPermissionEvent); - - // This template is shown when user has given permission but has not arrived yet - private _lockedButtonTemplate = () => { - // Target position must be set - if (!this.targetPosition || !this.currentPosition) return; - - // Calculate the distance between target and current position in meters - const distance = calculateDistance( - this.currentPosition, - this.targetPosition - ); - - // Update the text based on the distance - this._updateDistanceText(distance); - - this._checkArrived(distance); - - return lockedButtonTemplate(this._distanceText); - }; - - // This template is shown when user has arrived to the target location - // When user click the button counter at the bottom of the page is incremented - // and image is revealed - private _unlockedButtonTemplate = () => - unlockedButtonTemplate(() => { - incrementUnlockCounter(this.imageId); - this._unlocked = true; - }); - - connectedCallback(): void { - super.connectedCallback(); - } - - render() { - let buttonTemplate; - - // Determine which template to show, there are 3 states: - // 1 - No current location provided - // 2 - Current location given but has no arrived to target position yet - // 3 - Arrived to target position - // 4 - User did not give geolocation permission - if (this._arrived) { - buttonTemplate = this._unlockedButtonTemplate; - } else if (this.currentPosition) { - buttonTemplate = this._lockedButtonTemplate; - } else if (!this.currentPosition) { - buttonTemplate = this._permissionButtonTemplate; - } else { - buttonTemplate = permissionDeniedButtonTemplate; - } - - return html` -
-
- - - ${this._unlocked ? nothing : buttonTemplate()} -
-
- `; - } -} diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 7532410..365058c 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,10 +1,6 @@ -import { type ClassValue, clsx } from "clsx" -import { twMerge } from "tailwind-merge" +import { type ClassValue, clsx } from "clsx"; +import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)) -} - -export function remoteLog(data: any) { - fetch("/api/debug", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(data) }) + return twMerge(clsx(inputs)); }