Skip to content

Commit

Permalink
add og, dialog etc...
Browse files Browse the repository at this point in the history
  • Loading branch information
L4Ph committed Sep 18, 2024
1 parent c87d765 commit c319770
Show file tree
Hide file tree
Showing 29 changed files with 343 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
packageManager: bun
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: pages deploy ./build --project-name=narrow --branch ${{ github.ref_name == 'main' && 'main' || 'preview' }}
command: pages deploy ./build --project-name=tawri --branch ${{ github.ref_name == 'main' && 'main' || 'preview' }}
- name: Get deployment url
id: deployment_url
run: echo "DEPLOYMENT_URL=${{ steps.cloudflare-wrangler.outputs.deployment-url }}" >> $GITHUB_ENV
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Narrow - Web小説向けエディタ
# Tawri - Web小説向けエディタ

## これはなに?
Web小説向けのシンプルで軽量なエディタです。
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
"dependencies": {
"@fontsource-variable/m-plus-2": "^5.1.0",
"@l4ph/web-novel-parser": "npm:@jsr/l4ph__web-novel-parser",
"@macfja/svelte-persistent-store": "^2.4.1",
"@tauri-apps/api": "^2.0.0-rc.4",
"@tauri-apps/plugin-fs": "^2.0.0-rc.2",
"bits-ui": "^0.21.13",
"clsx": "^2.1.1",
"lucide-svelte": "^0.441.0",
"mode-watcher": "^0.4.1",
"svelte-file-dropzone": "^2.0.8",
"svelte-sonner": "^0.3.28",
Expand Down
76 changes: 38 additions & 38 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "narrow"
name = "tawri"
version = "0.1.0"
description = "A Tauri App"
authors = ["L4Ph"]
Expand All @@ -8,7 +8,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
name = "narrow_lib"
name = "tawri_lib"
crate-type = ["lib", "cdylib", "staticlib"]

[build-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

fn main() {
narrow_lib::run()
tawri_lib::run()
}
6 changes: 3 additions & 3 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"productName": "narrow",
"productName": "tawri",
"version": "0.1.0",
"identifier": "moe.l4ph.narrow",
"identifier": "moe.l4ph.tawri",
"build": {
"beforeDevCommand": "bun run dev",
"devUrl": "http://localhost:1420",
Expand All @@ -11,7 +11,7 @@
"app": {
"windows": [
{
"title": "Narrow-Web小説エディタ",
"title": "Tawri-Web小説エディタ",
"width": 800,
"height": 600
}
Expand Down
11 changes: 11 additions & 0 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,15 @@
"rlig" 1,
"calt" 1;
}
}

@layer utilities {
.hidden-scrollbar {
-ms-overflow-style: none; /* IE, Edge 対応 */
scrollbar-width: none; /* Firefox 対応 */
}
.hidden-scrollbar::-webkit-scrollbar {
/* Chrome, Safari 対応 */
display: none;
}
}
3 changes: 2 additions & 1 deletion src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Web小説向けエディタ</title>
<!-- Open Graph Protocol -->
<title>Tawri-Web小説向けエディタ</title>
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
Expand Down
36 changes: 36 additions & 0 deletions src/lib/components/ui/dialog/dialog-content.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<script lang="ts">
import { Dialog as DialogPrimitive } from "bits-ui";
import X from "lucide-svelte/icons/x";
import * as Dialog from "./index.js";
import { cn, flyAndScale } from "$lib/utils.js";
type $$Props = DialogPrimitive.ContentProps;
let className: $$Props["class"] = undefined;
export let transition: $$Props["transition"] = flyAndScale;
export let transitionConfig: $$Props["transitionConfig"] = {
duration: 200,
};
export { className as class };
</script>

<Dialog.Portal>
<Dialog.Overlay />
<DialogPrimitive.Content
{transition}
{transitionConfig}
class={cn(
"bg-background fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg sm:rounded-lg md:w-full",
className
)}
{...$$restProps}
>
<slot />
<DialogPrimitive.Close
class="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none"
>
<X class="h-4 w-4" />
<span class="sr-only">Close</span>
</DialogPrimitive.Close>
</DialogPrimitive.Content>
</Dialog.Portal>
16 changes: 16 additions & 0 deletions src/lib/components/ui/dialog/dialog-description.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script lang="ts">
import { Dialog as DialogPrimitive } from "bits-ui";
import { cn } from "$lib/utils.js";
type $$Props = DialogPrimitive.DescriptionProps;
let className: $$Props["class"] = undefined;
export { className as class };
</script>

<DialogPrimitive.Description
class={cn("text-muted-foreground text-sm", className)}
{...$$restProps}
>
<slot />
</DialogPrimitive.Description>
16 changes: 16 additions & 0 deletions src/lib/components/ui/dialog/dialog-footer.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script lang="ts">
import type { HTMLAttributes } from "svelte/elements";
import { cn } from "$lib/utils.js";
type $$Props = HTMLAttributes<HTMLDivElement>;
let className: $$Props["class"] = undefined;
export { className as class };
</script>

<div
class={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)}
{...$$restProps}
>
<slot />
</div>
13 changes: 13 additions & 0 deletions src/lib/components/ui/dialog/dialog-header.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script lang="ts">
import type { HTMLAttributes } from "svelte/elements";
import { cn } from "$lib/utils.js";
type $$Props = HTMLAttributes<HTMLDivElement>;
let className: $$Props["class"] = undefined;
export { className as class };
</script>

<div class={cn("flex flex-col space-y-1.5 text-center sm:text-left", className)} {...$$restProps}>
<slot />
</div>
21 changes: 21 additions & 0 deletions src/lib/components/ui/dialog/dialog-overlay.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script lang="ts">
import { Dialog as DialogPrimitive } from "bits-ui";
import { fade } from "svelte/transition";
import { cn } from "$lib/utils.js";
type $$Props = DialogPrimitive.OverlayProps;
let className: $$Props["class"] = undefined;
export let transition: $$Props["transition"] = fade;
export let transitionConfig: $$Props["transitionConfig"] = {
duration: 150,
};
export { className as class };
</script>

<DialogPrimitive.Overlay
{transition}
{transitionConfig}
class={cn("bg-background/80 fixed inset-0 z-50 backdrop-blur-sm", className)}
{...$$restProps}
/>
Loading

0 comments on commit c319770

Please sign in to comment.