diff --git a/new-web/bun.lockb b/new-web/bun.lockb
index bbaa631..94657ec 100755
Binary files a/new-web/bun.lockb and b/new-web/bun.lockb differ
diff --git a/new-web/package.json b/new-web/package.json
index 33882d9..d513cff 100644
--- a/new-web/package.json
+++ b/new-web/package.json
@@ -17,6 +17,7 @@
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"autoprefixer": "^10.4.20",
"clsx": "^2.1.1",
+ "cmdk-sv": "^0.0.18",
"lucide-svelte": "^0.453.0",
"mode-watcher": "^0.4.1",
"postcss": "^8.4.47",
@@ -36,6 +37,10 @@
"@iconify/svelte": "^4.0.2",
"bits-ui": "^0.21.16",
"copy-to-clipboard": "^3.3.3",
- "svelte-bricks": "^0.2.1"
+ "es-toolkit": "^1.25.2",
+ "medium-zoom": "^1.1.0",
+ "svelte-bricks": "^0.2.1",
+ "svelte-lazy": "^1.2.9",
+ "svelte-markdown": "^0.4.1"
}
}
diff --git a/new-web/src/app.css b/new-web/src/app.css
index 61368fa..5150d81 100644
--- a/new-web/src/app.css
+++ b/new-web/src/app.css
@@ -4,7 +4,7 @@
@layer base {
:root {
- --background: 0 0% 100%;
+ --background: 0, 0%, 97%;
--foreground: 240 10% 3.9%;
--muted: 240 4.8% 95.9%;
@@ -37,7 +37,7 @@
}
.dark {
- --background: 240 10% 3.9%;
+ --background: 240 10% 12%;
--foreground: 0 0% 98%;
--muted: 240 3.7% 15.9%;
@@ -76,3 +76,8 @@
@apply bg-background text-foreground;
}
}
+
+.medium-zoom-overlay,
+.medium-zoom-image--opened {
+ z-index: 999;
+}
diff --git a/new-web/src/lib/components/ui/command/command-dialog.svelte b/new-web/src/lib/components/ui/command/command-dialog.svelte
new file mode 100644
index 0000000..a136629
--- /dev/null
+++ b/new-web/src/lib/components/ui/command/command-dialog.svelte
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
diff --git a/new-web/src/lib/components/ui/command/command-empty.svelte b/new-web/src/lib/components/ui/command/command-empty.svelte
new file mode 100644
index 0000000..3a0819d
--- /dev/null
+++ b/new-web/src/lib/components/ui/command/command-empty.svelte
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/new-web/src/lib/components/ui/command/command-group.svelte b/new-web/src/lib/components/ui/command/command-group.svelte
new file mode 100644
index 0000000..22f49a4
--- /dev/null
+++ b/new-web/src/lib/components/ui/command/command-group.svelte
@@ -0,0 +1,18 @@
+
+
+
+
+
diff --git a/new-web/src/lib/components/ui/command/command-input.svelte b/new-web/src/lib/components/ui/command/command-input.svelte
new file mode 100644
index 0000000..3c50f23
--- /dev/null
+++ b/new-web/src/lib/components/ui/command/command-input.svelte
@@ -0,0 +1,23 @@
+
+
+
+
+
+
diff --git a/new-web/src/lib/components/ui/command/command-item.svelte b/new-web/src/lib/components/ui/command/command-item.svelte
new file mode 100644
index 0000000..a75acc8
--- /dev/null
+++ b/new-web/src/lib/components/ui/command/command-item.svelte
@@ -0,0 +1,24 @@
+
+
+
+
+
diff --git a/new-web/src/lib/components/ui/command/command-list.svelte b/new-web/src/lib/components/ui/command/command-list.svelte
new file mode 100644
index 0000000..8ceda03
--- /dev/null
+++ b/new-web/src/lib/components/ui/command/command-list.svelte
@@ -0,0 +1,15 @@
+
+
+
+
+
diff --git a/new-web/src/lib/components/ui/command/command-separator.svelte b/new-web/src/lib/components/ui/command/command-separator.svelte
new file mode 100644
index 0000000..71688b8
--- /dev/null
+++ b/new-web/src/lib/components/ui/command/command-separator.svelte
@@ -0,0 +1,10 @@
+
+
+
diff --git a/new-web/src/lib/components/ui/command/command-shortcut.svelte b/new-web/src/lib/components/ui/command/command-shortcut.svelte
new file mode 100644
index 0000000..c89bd61
--- /dev/null
+++ b/new-web/src/lib/components/ui/command/command-shortcut.svelte
@@ -0,0 +1,16 @@
+
+
+
+
+
diff --git a/new-web/src/lib/components/ui/command/command.svelte b/new-web/src/lib/components/ui/command/command.svelte
new file mode 100644
index 0000000..3889696
--- /dev/null
+++ b/new-web/src/lib/components/ui/command/command.svelte
@@ -0,0 +1,22 @@
+
+
+
+
+
diff --git a/new-web/src/lib/components/ui/command/index.ts b/new-web/src/lib/components/ui/command/index.ts
new file mode 100644
index 0000000..d8a2e7c
--- /dev/null
+++ b/new-web/src/lib/components/ui/command/index.ts
@@ -0,0 +1,37 @@
+import { Command as CommandPrimitive } from "cmdk-sv";
+
+import Root from "./command.svelte";
+import Dialog from "./command-dialog.svelte";
+import Empty from "./command-empty.svelte";
+import Group from "./command-group.svelte";
+import Item from "./command-item.svelte";
+import Input from "./command-input.svelte";
+import List from "./command-list.svelte";
+import Separator from "./command-separator.svelte";
+import Shortcut from "./command-shortcut.svelte";
+
+const Loading = CommandPrimitive.Loading;
+
+export {
+ Root,
+ Dialog,
+ Empty,
+ Group,
+ Item,
+ Input,
+ List,
+ Separator,
+ Shortcut,
+ Loading,
+ //
+ Root as Command,
+ Dialog as CommandDialog,
+ Empty as CommandEmpty,
+ Group as CommandGroup,
+ Item as CommandItem,
+ Input as CommandInput,
+ List as CommandList,
+ Separator as CommandSeparator,
+ Shortcut as CommandShortcut,
+ Loading as CommandLoading,
+};
diff --git a/new-web/src/lib/components/ui/dialog/dialog-content.svelte b/new-web/src/lib/components/ui/dialog/dialog-content.svelte
index 9f7eab8..c573f02 100644
--- a/new-web/src/lib/components/ui/dialog/dialog-content.svelte
+++ b/new-web/src/lib/components/ui/dialog/dialog-content.svelte
@@ -26,14 +26,14 @@
)}
{...$$restProps}
>
-
-
+
+
diff --git a/new-web/src/lib/components/ui/skeleton/index.ts b/new-web/src/lib/components/ui/skeleton/index.ts
new file mode 100644
index 0000000..186db21
--- /dev/null
+++ b/new-web/src/lib/components/ui/skeleton/index.ts
@@ -0,0 +1,7 @@
+import Root from "./skeleton.svelte";
+
+export {
+ Root,
+ //
+ Root as Skeleton,
+};
diff --git a/new-web/src/lib/components/ui/skeleton/skeleton.svelte b/new-web/src/lib/components/ui/skeleton/skeleton.svelte
new file mode 100644
index 0000000..7e5d18b
--- /dev/null
+++ b/new-web/src/lib/components/ui/skeleton/skeleton.svelte
@@ -0,0 +1,11 @@
+
+
+
diff --git a/new-web/src/lib/elements/BlogCard.svelte b/new-web/src/lib/elements/BlogCard.svelte
index b6ce6bd..8f38579 100644
--- a/new-web/src/lib/elements/BlogCard.svelte
+++ b/new-web/src/lib/elements/BlogCard.svelte
@@ -1,5 +1,7 @@
+
+
diff --git a/new-web/src/lib/elements/Header.svelte b/new-web/src/lib/elements/Header.svelte
index 8fb002f..12fe6cc 100644
--- a/new-web/src/lib/elements/Header.svelte
+++ b/new-web/src/lib/elements/Header.svelte
@@ -5,14 +5,22 @@
import ReportProblem from './ReportProblem.svelte';
import PayButtons from './PayButtons.svelte';
import ExtensionsButton from './ExtensionsButton.svelte';
-
+ import Icon from '@iconify/svelte';
+ import SearchDialog from './SearchDialog.svelte';
import { Menu } from 'lucide-svelte';
+ import { Button } from '$lib/components/ui/button/index.js';
+
let isNavOpen = false;
const toggleNav = () => {
isNavOpen = !isNavOpen;
};
+
+ let isSearchOpen = false;
+ const toggleSearch = () => {
+ isSearchOpen = !isSearchOpen;
+ };
-
+
Freedium Freedium βeta
-
-
-
+
+
+
+ Search
+
+
-
+
+
+
@@ -46,9 +57,34 @@
url="https://liberapay.com/ZhymabekRoman/"
icon="simple-icons:liberapay"
/>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {#if isNavOpen}
+
+ {/if}
+
+
diff --git a/new-web/src/lib/elements/ImageZoom.svelte b/new-web/src/lib/elements/ImageZoom.svelte
new file mode 100644
index 0000000..808de89
--- /dev/null
+++ b/new-web/src/lib/elements/ImageZoom.svelte
@@ -0,0 +1,33 @@
+
+
+
diff --git a/new-web/src/lib/elements/Mansonry.svelte b/new-web/src/lib/elements/Mansonry.svelte
deleted file mode 100644
index 93d27e6..0000000
--- a/new-web/src/lib/elements/Mansonry.svelte
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/new-web/src/lib/elements/ReportProblem.svelte b/new-web/src/lib/elements/ReportProblem.svelte
index 9cf4985..36a748a 100644
--- a/new-web/src/lib/elements/ReportProblem.svelte
+++ b/new-web/src/lib/elements/ReportProblem.svelte
@@ -53,6 +53,10 @@
Suggestion
+
+
+ Vulnerability (XSS, etc.)
+
Other
diff --git a/new-web/src/lib/elements/SearchDialog.svelte b/new-web/src/lib/elements/SearchDialog.svelte
new file mode 100644
index 0000000..ff7ee99
--- /dev/null
+++ b/new-web/src/lib/elements/SearchDialog.svelte
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+ {#if loading}
+ {#each Array(3) as _}
+
+ {/each}
+ {:else}
+ {#each searchResults as post}
+
+
+
+
{post.title}
+
{formatDate(post.date)}
+
{post.excerpt}
+
+
+ {/each}
+ {/if}
+ {#if searchResults.length === 0 && !loading}
+
+
+ Start typing post name to search or enter URL.
+ For example:
+
+ - https://medium.com/post-test-1
+ - How to create a blog post
+
+
+ {/if}
+
+
diff --git a/new-web/src/lib/utils/dateFormatter.js b/new-web/src/lib/utils/dateFormatter.js
new file mode 100644
index 0000000..0b43fbc
--- /dev/null
+++ b/new-web/src/lib/utils/dateFormatter.js
@@ -0,0 +1,9 @@
+export function formatDate(isoString) {
+ const date = new Date(isoString);
+
+ return new Intl.DateTimeFormat('en-US', {
+ year: 'numeric',
+ month: 'long',
+ day: 'numeric'
+ }).format(date);
+}
diff --git a/new-web/src/routes/+page.svelte b/new-web/src/routes/+page.svelte
index d284597..06f1eb1 100644
--- a/new-web/src/routes/+page.svelte
+++ b/new-web/src/routes/+page.svelte
@@ -1,9 +1,9 @@
@@ -125,3 +122,5 @@
+
+
diff --git a/new-web/src/routes/[slug]/+page.js b/new-web/src/routes/[slug]/+page.js
new file mode 100644
index 0000000..16cc4f4
--- /dev/null
+++ b/new-web/src/routes/[slug]/+page.js
@@ -0,0 +1,5 @@
+export const load = ({ params }) => {
+ return {
+ slug: params.slug
+ };
+};
diff --git a/new-web/src/routes/[slug]/+page.svelte b/new-web/src/routes/[slug]/+page.svelte
new file mode 100644
index 0000000..b78f40e
--- /dev/null
+++ b/new-web/src/routes/[slug]/+page.svelte
@@ -0,0 +1,164 @@
+
+
+
+ {data.title} - Freedium
+
+
+
+
+
+
+
+
+
+
+ Original article
+
+
+
+
+ {#if data.postImage}
+
+ {/if}
+
+ {formatDate(data.date)}
+ {data.title}
+
+
+
+
{data.author.name}
+
{data.author.role}
+
+
+
+
+
+
+ {#if contentLoaded}
+
+ {:else}
+
Loading content...
+ {/if}
+
+
+
+
+
+
+
+
+