Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7798432de6 | ||
|
|
4a4401ddb0 |
@@ -66,6 +66,8 @@ Build it yourself: `docker build -t dahoam .`
|
||||
a link, `/settings`, `/add link`, `/add card` and `/sign out` run commands.
|
||||
- **Wallpaper**: Settings (or the pencil at the bottom right) takes an image URL or an
|
||||
upload (JPEG, PNG, WebP, AVIF, up to 10 MB).
|
||||
- **Clock**: Settings has five fonts and three styles. Glass shows the wallpaper blurred
|
||||
through the digits, Tinted takes its color from the wallpaper.
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE "settings" ADD COLUMN "clock_font" text DEFAULT 'serif' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "settings" ADD COLUMN "clock_style" text DEFAULT 'solid' NOT NULL;
|
||||
@@ -0,0 +1,679 @@
|
||||
{
|
||||
"id": "ac3af713-2f43-44c7-8e48-d840cfee12c0",
|
||||
"prevId": "d6c6160d-4a0a-4e19-a093-40a1963aab9d",
|
||||
"version": "7",
|
||||
"dialect": "postgresql",
|
||||
"tables": {
|
||||
"public.account": {
|
||||
"name": "account",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"account_id": {
|
||||
"name": "account_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"provider_id": {
|
||||
"name": "provider_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"user_id": {
|
||||
"name": "user_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"access_token": {
|
||||
"name": "access_token",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"refresh_token": {
|
||||
"name": "refresh_token",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"id_token": {
|
||||
"name": "id_token",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"access_token_expires_at": {
|
||||
"name": "access_token_expires_at",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"refresh_token_expires_at": {
|
||||
"name": "refresh_token_expires_at",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"scope": {
|
||||
"name": "scope",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"password": {
|
||||
"name": "password",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"account_user_id_idx": {
|
||||
"name": "account_user_id_idx",
|
||||
"columns": [
|
||||
{
|
||||
"expression": "user_id",
|
||||
"isExpression": false,
|
||||
"asc": true,
|
||||
"nulls": "last"
|
||||
}
|
||||
],
|
||||
"isUnique": false,
|
||||
"concurrently": false,
|
||||
"method": "btree",
|
||||
"with": {}
|
||||
}
|
||||
},
|
||||
"foreignKeys": {
|
||||
"account_user_id_user_id_fk": {
|
||||
"name": "account_user_id_user_id_fk",
|
||||
"tableFrom": "account",
|
||||
"tableTo": "user",
|
||||
"columnsFrom": [
|
||||
"user_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
},
|
||||
"public.card": {
|
||||
"name": "card",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "uuid",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"default": "gen_random_uuid()"
|
||||
},
|
||||
"user_id": {
|
||||
"name": "user_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"card_user_id_idx": {
|
||||
"name": "card_user_id_idx",
|
||||
"columns": [
|
||||
{
|
||||
"expression": "user_id",
|
||||
"isExpression": false,
|
||||
"asc": true,
|
||||
"nulls": "last"
|
||||
}
|
||||
],
|
||||
"isUnique": false,
|
||||
"concurrently": false,
|
||||
"method": "btree",
|
||||
"with": {}
|
||||
}
|
||||
},
|
||||
"foreignKeys": {
|
||||
"card_user_id_user_id_fk": {
|
||||
"name": "card_user_id_user_id_fk",
|
||||
"tableFrom": "card",
|
||||
"tableTo": "user",
|
||||
"columnsFrom": [
|
||||
"user_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
},
|
||||
"public.link": {
|
||||
"name": "link",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "uuid",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"default": "gen_random_uuid()"
|
||||
},
|
||||
"user_id": {
|
||||
"name": "user_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"card_id": {
|
||||
"name": "card_id",
|
||||
"type": "uuid",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"position": {
|
||||
"name": "position",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": 0
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"url": {
|
||||
"name": "url",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"icon": {
|
||||
"name": "icon",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"link_user_id_idx": {
|
||||
"name": "link_user_id_idx",
|
||||
"columns": [
|
||||
{
|
||||
"expression": "user_id",
|
||||
"isExpression": false,
|
||||
"asc": true,
|
||||
"nulls": "last"
|
||||
}
|
||||
],
|
||||
"isUnique": false,
|
||||
"concurrently": false,
|
||||
"method": "btree",
|
||||
"with": {}
|
||||
},
|
||||
"link_card_id_idx": {
|
||||
"name": "link_card_id_idx",
|
||||
"columns": [
|
||||
{
|
||||
"expression": "card_id",
|
||||
"isExpression": false,
|
||||
"asc": true,
|
||||
"nulls": "last"
|
||||
}
|
||||
],
|
||||
"isUnique": false,
|
||||
"concurrently": false,
|
||||
"method": "btree",
|
||||
"with": {}
|
||||
}
|
||||
},
|
||||
"foreignKeys": {
|
||||
"link_user_id_user_id_fk": {
|
||||
"name": "link_user_id_user_id_fk",
|
||||
"tableFrom": "link",
|
||||
"tableTo": "user",
|
||||
"columnsFrom": [
|
||||
"user_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"link_card_id_card_id_fk": {
|
||||
"name": "link_card_id_card_id_fk",
|
||||
"tableFrom": "link",
|
||||
"tableTo": "card",
|
||||
"columnsFrom": [
|
||||
"card_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
},
|
||||
"public.session": {
|
||||
"name": "session",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"expires_at": {
|
||||
"name": "expires_at",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"token": {
|
||||
"name": "token",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
},
|
||||
"ip_address": {
|
||||
"name": "ip_address",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"user_agent": {
|
||||
"name": "user_agent",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"user_id": {
|
||||
"name": "user_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"session_user_id_idx": {
|
||||
"name": "session_user_id_idx",
|
||||
"columns": [
|
||||
{
|
||||
"expression": "user_id",
|
||||
"isExpression": false,
|
||||
"asc": true,
|
||||
"nulls": "last"
|
||||
}
|
||||
],
|
||||
"isUnique": false,
|
||||
"concurrently": false,
|
||||
"method": "btree",
|
||||
"with": {}
|
||||
}
|
||||
},
|
||||
"foreignKeys": {
|
||||
"session_user_id_user_id_fk": {
|
||||
"name": "session_user_id_user_id_fk",
|
||||
"tableFrom": "session",
|
||||
"tableTo": "user",
|
||||
"columnsFrom": [
|
||||
"user_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {
|
||||
"session_token_unique": {
|
||||
"name": "session_token_unique",
|
||||
"nullsNotDistinct": false,
|
||||
"columns": [
|
||||
"token"
|
||||
]
|
||||
}
|
||||
},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
},
|
||||
"public.settings": {
|
||||
"name": "settings",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"user_id": {
|
||||
"name": "user_id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"title": {
|
||||
"name": "title",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "'Dahoam'"
|
||||
},
|
||||
"search_engine": {
|
||||
"name": "search_engine",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "'duckduckgo'"
|
||||
},
|
||||
"wallpaper_url": {
|
||||
"name": "wallpaper_url",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"clock_font": {
|
||||
"name": "clock_font",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "'serif'"
|
||||
},
|
||||
"clock_style": {
|
||||
"name": "clock_style",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "'solid'"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"settings_user_id_user_id_fk": {
|
||||
"name": "settings_user_id_user_id_fk",
|
||||
"tableFrom": "settings",
|
||||
"tableTo": "user",
|
||||
"columnsFrom": [
|
||||
"user_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
},
|
||||
"public.user": {
|
||||
"name": "user",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"email": {
|
||||
"name": "email",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"email_verified": {
|
||||
"name": "email_verified",
|
||||
"type": "boolean",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": false
|
||||
},
|
||||
"image": {
|
||||
"name": "image",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {
|
||||
"user_email_unique": {
|
||||
"name": "user_email_unique",
|
||||
"nullsNotDistinct": false,
|
||||
"columns": [
|
||||
"email"
|
||||
]
|
||||
}
|
||||
},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
},
|
||||
"public.verification": {
|
||||
"name": "verification",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"identifier": {
|
||||
"name": "identifier",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"value": {
|
||||
"name": "value",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"expires_at": {
|
||||
"name": "expires_at",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"verification_identifier_idx": {
|
||||
"name": "verification_identifier_idx",
|
||||
"columns": [
|
||||
{
|
||||
"expression": "identifier",
|
||||
"isExpression": false,
|
||||
"asc": true,
|
||||
"nulls": "last"
|
||||
}
|
||||
],
|
||||
"isUnique": false,
|
||||
"concurrently": false,
|
||||
"method": "btree",
|
||||
"with": {}
|
||||
}
|
||||
},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
},
|
||||
"public.wallpaper": {
|
||||
"name": "wallpaper",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"user_id": {
|
||||
"name": "user_id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"mime": {
|
||||
"name": "mime",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"data": {
|
||||
"name": "data",
|
||||
"type": "bytea",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"wallpaper_user_id_user_id_fk": {
|
||||
"name": "wallpaper_user_id_user_id_fk",
|
||||
"tableFrom": "wallpaper",
|
||||
"tableTo": "user",
|
||||
"columnsFrom": [
|
||||
"user_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
}
|
||||
},
|
||||
"enums": {},
|
||||
"schemas": {},
|
||||
"sequences": {},
|
||||
"roles": {},
|
||||
"policies": {},
|
||||
"views": {},
|
||||
"_meta": {
|
||||
"columns": {},
|
||||
"schemas": {},
|
||||
"tables": {}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,13 @@
|
||||
"when": 1794956525569,
|
||||
"tag": "0003_default_title",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 4,
|
||||
"version": "7",
|
||||
"when": 1795017311884,
|
||||
"tag": "0004_clock",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -22,6 +22,8 @@
|
||||
"@dnd-kit/sortable": "^10.0.0",
|
||||
"@dnd-kit/utilities": "^3.2.2",
|
||||
"@fontsource-variable/inter": "^5.3.0",
|
||||
"@fontsource-variable/nunito": "^5.3.0",
|
||||
"@fontsource-variable/roboto-slab": "^5.3.0",
|
||||
"@fontsource/dm-serif-display": "^5.3.0",
|
||||
"@tailwindcss/vite": "^4",
|
||||
"@tanstack/react-devtools": "latest",
|
||||
|
||||
Generated
+16
@@ -178,6 +178,12 @@ importers:
|
||||
'@fontsource-variable/inter':
|
||||
specifier: ^5.3.0
|
||||
version: 5.3.0
|
||||
'@fontsource-variable/nunito':
|
||||
specifier: ^5.3.0
|
||||
version: 5.3.0
|
||||
'@fontsource-variable/roboto-slab':
|
||||
specifier: ^5.3.0
|
||||
version: 5.3.0
|
||||
'@fontsource/dm-serif-display':
|
||||
specifier: ^5.3.0
|
||||
version: 5.3.0
|
||||
@@ -970,6 +976,12 @@ packages:
|
||||
'@fontsource-variable/inter@5.3.0':
|
||||
resolution: {integrity: sha512-OupL48va4JNofb97w6NYeF9S7W/kHNKM0Er8Dem5nqi4jeOLrVJDoE8tZEpnMJmtkvNbB1EIPPwHcdkF6b1oUA==}
|
||||
|
||||
'@fontsource-variable/nunito@5.3.0':
|
||||
resolution: {integrity: sha512-tw0ch7evIDSwoeUy+0XzocYHfbRWLeCRPJy22KgbrLjDLAbNw/fErBiil10Ssrs3Sjr55zaZrr36a975j8cBkQ==}
|
||||
|
||||
'@fontsource-variable/roboto-slab@5.3.0':
|
||||
resolution: {integrity: sha512-eByKAjLM9td0qsXCOZhlUGfhsjen//epd6/cAJOg+o73RtYBijrI1jz+lTp2X0ebwTCLmKB1+Kt/QiRMgmNPTw==}
|
||||
|
||||
'@fontsource/dm-serif-display@5.3.0':
|
||||
resolution: {integrity: sha512-ecRclUcYeto9fB7ghkB36H4MtUoaUYFjjornWYYeLCMHzaWEDPk2kIWgZOq0mKBNRxclRSieKcFeLonlMYDTKg==}
|
||||
|
||||
@@ -4254,6 +4266,10 @@ snapshots:
|
||||
|
||||
'@fontsource-variable/inter@5.3.0': {}
|
||||
|
||||
'@fontsource-variable/nunito@5.3.0': {}
|
||||
|
||||
'@fontsource-variable/roboto-slab@5.3.0': {}
|
||||
|
||||
'@fontsource/dm-serif-display@5.3.0': {}
|
||||
|
||||
'@humanfs/core@0.19.2':
|
||||
|
||||
+77
-14
@@ -1,4 +1,6 @@
|
||||
import { useSyncExternalStore } from "react"
|
||||
import { WallpaperImage } from "@/components/wallpaper"
|
||||
import type { ClockFont, ClockStyle } from "@/lib/clock"
|
||||
import { cn } from "@/vendor/collabry/lib/cn"
|
||||
|
||||
const subscribe = (tick: () => void) => {
|
||||
@@ -8,7 +10,29 @@ const subscribe = (tick: () => void) => {
|
||||
// changes once a minute, so the clock re-renders once a minute
|
||||
const currentMinute = () => Math.floor(Date.now() / 60_000)
|
||||
|
||||
export function Clock() {
|
||||
const FONTS: Record<ClockFont, string> = {
|
||||
serif: "font-serif tracking-wide",
|
||||
sans: "font-sans font-bold tracking-tight",
|
||||
light: "font-sans font-extralight tracking-tight",
|
||||
rounded: "font-rounded font-extrabold",
|
||||
slab: "font-slab font-semibold",
|
||||
}
|
||||
|
||||
// What the wallpaper looks like through the digits, and how much white is in the glass.
|
||||
const GLASS: Record<Exclude<ClockStyle, "solid">, [string, string]> = {
|
||||
glass: ["blur-xl saturate-150 brightness-150", "bg-white/45"],
|
||||
tinted: ["blur-3xl saturate-150 brightness-150", "bg-white/20"],
|
||||
}
|
||||
|
||||
export function Clock({
|
||||
font,
|
||||
look,
|
||||
wallpaper,
|
||||
}: {
|
||||
font: ClockFont
|
||||
look: ClockStyle
|
||||
wallpaper: string | null
|
||||
}) {
|
||||
// null on the server: its clock and locale are not the visitor's
|
||||
const minute = useSyncExternalStore<number | null>(
|
||||
subscribe,
|
||||
@@ -29,14 +53,23 @@ export function Clock() {
|
||||
.trim()
|
||||
const period = parts.find((p) => p.type === "dayPeriod")?.value
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"flex flex-col items-center text-white transition-opacity duration-500 [text-shadow:0_2px_24px_rgb(0_0_0/0.45)]",
|
||||
!now && "opacity-0"
|
||||
// Each piece fades in by itself. Opacity on a common parent would cut the
|
||||
// glass off from the wallpaper it blends with.
|
||||
const fade = cn("transition-opacity duration-500", !now && "opacity-0")
|
||||
const digits = (
|
||||
<>
|
||||
{time || "0:00"}
|
||||
{period && (
|
||||
<span className="absolute top-1 left-full ml-2 text-xl tracking-normal sm:top-3 sm:ml-4 sm:text-3xl">
|
||||
{period}
|
||||
</span>
|
||||
)}
|
||||
>
|
||||
<p className="text-lg font-medium sm:text-xl">
|
||||
</>
|
||||
)
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-center text-white [text-shadow:0_2px_24px_rgb(0_0_0/0.45)]">
|
||||
<p className={cn("text-lg font-medium sm:text-xl", fade)}>
|
||||
{now
|
||||
? now.toLocaleDateString(undefined, {
|
||||
weekday: "long",
|
||||
@@ -47,13 +80,43 @@ export function Clock() {
|
||||
</p>
|
||||
<time
|
||||
dateTime={now?.toISOString()}
|
||||
className="relative mt-2 font-serif text-7xl leading-none tracking-wide sm:text-[9.5rem]"
|
||||
className={cn(
|
||||
"relative mt-2 text-7xl leading-none sm:text-[9.5rem]",
|
||||
FONTS[font]
|
||||
)}
|
||||
>
|
||||
{time || "0:00"}
|
||||
{period && (
|
||||
<span className="absolute top-1 left-full ml-2 text-xl tracking-normal sm:top-3 sm:ml-4 sm:text-3xl">
|
||||
{period}
|
||||
</span>
|
||||
{look === "solid" ? (
|
||||
<span className={cn("block", fade)}>{digits}</span>
|
||||
) : (
|
||||
<>
|
||||
{/* the real text: it sets the size and casts the shadow */}
|
||||
<span className={cn("block text-transparent", fade)}>{digits}</span>
|
||||
{/* The glass. A blurred copy of the wallpaper lies exactly on the real
|
||||
one. Multiplying it with white digits on black leaves it only inside
|
||||
the digits, and screen drops the black. The clip keeps the copy
|
||||
inside the clock, with room for AM/PM on the right. */}
|
||||
<span
|
||||
aria-hidden
|
||||
className="absolute inset-0 isolate mix-blend-screen [clip-path:inset(-0.1em_-1em_-0.1em_-0.1em)] [text-shadow:none]"
|
||||
>
|
||||
<span className={cn("fixed inset-0", fade)}>
|
||||
<WallpaperImage src={wallpaper} className={GLASS[look][0]} />
|
||||
<span className={cn("fixed inset-0", GLASS[look][1])} />
|
||||
</span>
|
||||
<span className="absolute inset-0 bg-black mix-blend-multiply shadow-[0_0_0_100vmax_#000]">
|
||||
{digits}
|
||||
</span>
|
||||
{/* light on the edges: only the shadows show, the black digits drop out */}
|
||||
<span
|
||||
className={cn(
|
||||
"absolute inset-0 text-black mix-blend-screen [text-shadow:0_-1px_0.5px_#aaa,0_1px_0.5px_#444]",
|
||||
fade
|
||||
)}
|
||||
>
|
||||
{digits}
|
||||
</span>
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
</time>
|
||||
</div>
|
||||
|
||||
@@ -1,22 +1,37 @@
|
||||
import { cn } from "@/vendor/collabry/lib/cn"
|
||||
|
||||
export const DEFAULT_WALLPAPER = "/wallpaper.jpg"
|
||||
|
||||
function showDefault(img: HTMLImageElement) {
|
||||
if (!img.src.endsWith(DEFAULT_WALLPAPER)) img.src = DEFAULT_WALLPAPER
|
||||
}
|
||||
|
||||
/** The wallpaper over the whole window. Falls back to the default photo. */
|
||||
export function WallpaperImage({
|
||||
src,
|
||||
className,
|
||||
}: {
|
||||
src?: string | null
|
||||
className?: string
|
||||
}) {
|
||||
return (
|
||||
<img
|
||||
src={src ?? DEFAULT_WALLPAPER}
|
||||
alt=""
|
||||
className={cn("fixed inset-0 size-full object-cover", className)}
|
||||
// an image that failed before hydration never fires onError
|
||||
ref={(img) => {
|
||||
if (img?.complete && img.naturalWidth === 0) showDefault(img)
|
||||
}}
|
||||
onError={(e) => showDefault(e.currentTarget)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export function Wallpaper({ src }: { src?: string | null }) {
|
||||
return (
|
||||
<div className="fixed inset-0 -z-10 bg-black" aria-hidden>
|
||||
<img
|
||||
src={src ?? DEFAULT_WALLPAPER}
|
||||
alt=""
|
||||
className="size-full object-cover"
|
||||
// an image that failed before hydration never fires onError
|
||||
ref={(img) => {
|
||||
if (img?.complete && img.naturalWidth === 0) showDefault(img)
|
||||
}}
|
||||
onError={(e) => showDefault(e.currentTarget)}
|
||||
/>
|
||||
<WallpaperImage src={src} />
|
||||
<div className="absolute inset-0 wallpaper-dither" />
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -127,6 +127,15 @@ export const settings = pgTable("settings", {
|
||||
.default("duckduckgo"),
|
||||
// null = bundled default wallpaper
|
||||
wallpaperUrl: text("wallpaper_url"),
|
||||
// the big clock, see src/lib/clock.ts
|
||||
clockFont: text("clock_font", {
|
||||
enum: ["serif", "sans", "light", "rounded", "slab"],
|
||||
})
|
||||
.notNull()
|
||||
.default("serif"),
|
||||
clockStyle: text("clock_style", { enum: ["solid", "glass", "tinted"] })
|
||||
.notNull()
|
||||
.default("solid"),
|
||||
})
|
||||
|
||||
export const wallpaper = pgTable("wallpaper", {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// How the big clock on the dashboard looks. The choices are stored per user.
|
||||
|
||||
export const CLOCK_FONTS = [
|
||||
"serif",
|
||||
"sans",
|
||||
"light",
|
||||
"rounded",
|
||||
"slab",
|
||||
] as const
|
||||
export type ClockFont = (typeof CLOCK_FONTS)[number]
|
||||
|
||||
export const CLOCK_FONT_NAMES: Record<ClockFont, string> = {
|
||||
serif: "Serif",
|
||||
sans: "Sans",
|
||||
light: "Light",
|
||||
rounded: "Rounded",
|
||||
slab: "Slab",
|
||||
}
|
||||
|
||||
export const CLOCK_STYLES = ["solid", "glass", "tinted"] as const
|
||||
export type ClockStyle = (typeof CLOCK_STYLES)[number]
|
||||
|
||||
export const CLOCK_STYLE_NAMES: Record<ClockStyle, string> = {
|
||||
solid: "Solid",
|
||||
glass: "Glass",
|
||||
tinted: "Tinted",
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import { z } from "zod"
|
||||
import { db } from "@/db"
|
||||
import { card, link, settings, wallpaper } from "@/db/schema"
|
||||
import { auth, requireUser, signUpEnabled, ssoName } from "@/lib/auth"
|
||||
import { CLOCK_FONTS, CLOCK_STYLES } from "@/lib/clock"
|
||||
import { ENGINES, parseSuggestions } from "@/lib/search"
|
||||
|
||||
const httpUrl = z.url({ protocol: /^https?$/ }).max(2000)
|
||||
@@ -74,6 +75,8 @@ export const getDashboard = createServerFn({ method: "GET" }).handler(
|
||||
title: s?.title ?? "Dahoam",
|
||||
searchEngine: s?.searchEngine ?? "duckduckgo",
|
||||
wallpaperUrl: s?.wallpaperUrl ?? null,
|
||||
clockFont: s?.clockFont ?? "serif",
|
||||
clockStyle: s?.clockStyle ?? "solid",
|
||||
searxngUrl: process.env.SEARXNG_URL || null,
|
||||
}
|
||||
}
|
||||
@@ -187,6 +190,8 @@ export const saveSettings = createServerFn({ method: "POST" })
|
||||
wallpaperUrl: z
|
||||
.union([httpUrl, z.string().regex(/^\/api\/wallpaper\?v=\d+$/)])
|
||||
.nullable(),
|
||||
clockFont: z.enum(CLOCK_FONTS),
|
||||
clockStyle: z.enum(CLOCK_STYLES),
|
||||
})
|
||||
.partial()
|
||||
.refine((patch) => Object.keys(patch).length > 0)
|
||||
|
||||
+13
-7
@@ -47,7 +47,7 @@ function Dashboard() {
|
||||
<Wallpaper src={data.wallpaperUrl} />
|
||||
|
||||
<main className="flex min-h-svh flex-col items-center px-4">
|
||||
<header className="flex h-28 w-full max-w-[1200px] items-center gap-4 px-2 sm:px-8">
|
||||
<header className="flex h-20 w-full max-w-[1200px] items-center gap-4 px-2 sm:px-8">
|
||||
<Logo className="size-6" />
|
||||
<h1 className="m-0 text-md font-semibold">{data.title}</h1>
|
||||
<span className="hidden font-mono text-sm text-white/50 sm:inline">
|
||||
@@ -69,11 +69,16 @@ function Dashboard() {
|
||||
</Button>
|
||||
</header>
|
||||
|
||||
<div className="mt-[11vh]">
|
||||
<Clock />
|
||||
</div>
|
||||
{/* Spare height: one part above the clock, three parts below the cards.
|
||||
A short window keeps only the minimum here, a tall one stays balanced. */}
|
||||
<div className="min-h-8 flex-1" />
|
||||
<Clock
|
||||
font={data.clockFont}
|
||||
look={data.clockStyle}
|
||||
wallpaper={data.wallpaperUrl}
|
||||
/>
|
||||
|
||||
<div className="mt-10 flex w-full justify-center sm:mt-14">
|
||||
<div className="mt-8 flex w-full justify-center sm:mt-10">
|
||||
<SearchBar
|
||||
links={data.cards.flatMap((c) => c.links)}
|
||||
engine={data.searchEngine}
|
||||
@@ -106,7 +111,7 @@ function Dashboard() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-[9vh] flex w-full flex-col items-center">
|
||||
<div className="mt-[7vh] flex w-full flex-col items-center">
|
||||
<CardGrid
|
||||
cards={data.cards}
|
||||
onAddCard={() => setCard("new")}
|
||||
@@ -116,7 +121,8 @@ function Dashboard() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<footer className="mt-auto flex w-full items-center justify-end gap-3 pt-10 pb-5 text-sm text-white/60 sm:px-2">
|
||||
<div className="flex-[3]" />
|
||||
<footer className="flex w-full items-center justify-end gap-3 pt-10 pb-5 text-sm text-white/60 sm:px-2">
|
||||
{!data.wallpaperUrl && (
|
||||
<span>
|
||||
Photo by{" "}
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
ArrowLeft,
|
||||
Check,
|
||||
CircleUser,
|
||||
Clock,
|
||||
Image,
|
||||
LogOut,
|
||||
Search,
|
||||
@@ -19,6 +20,13 @@ import {
|
||||
import { Logo } from "@/components/logo"
|
||||
import { DEFAULT_WALLPAPER } from "@/components/wallpaper"
|
||||
import { authClient } from "@/lib/auth-client"
|
||||
import {
|
||||
CLOCK_FONTS,
|
||||
CLOCK_FONT_NAMES,
|
||||
CLOCK_STYLES,
|
||||
CLOCK_STYLE_NAMES,
|
||||
} from "@/lib/clock"
|
||||
import type { ClockFont, ClockStyle } from "@/lib/clock"
|
||||
import { getDashboard, saveSettings } from "@/lib/dashboard.functions"
|
||||
import { ENGINES, ENGINE_NAMES } from "@/lib/search"
|
||||
import type { Engine } from "@/lib/search"
|
||||
@@ -68,6 +76,7 @@ export const Route = createFileRoute("/settings")({
|
||||
|
||||
const SECTIONS = [
|
||||
{ id: "general", label: "General", icon: SlidersHorizontal },
|
||||
{ id: "clock", label: "Clock", icon: Clock },
|
||||
{ id: "search", label: "Search", icon: Search },
|
||||
{ id: "wallpaper", label: "Wallpaper", icon: Image },
|
||||
{ id: "account", label: "Account", icon: CircleUser },
|
||||
@@ -97,6 +106,8 @@ function Settings() {
|
||||
title?: string
|
||||
searchEngine?: Engine
|
||||
wallpaperUrl?: string | null
|
||||
clockFont?: ClockFont
|
||||
clockStyle?: ClockStyle
|
||||
}) => run(() => saveSettings({ data: patch }))
|
||||
const upload = (image: File) =>
|
||||
run(async () => {
|
||||
@@ -215,6 +226,66 @@ function Settings() {
|
||||
</SettingsRow>
|
||||
</SettingsSection>
|
||||
|
||||
<SettingsSection id="clock" className={section}>
|
||||
<SettingsSectionHeader>
|
||||
<SettingsSectionTitle>Clock</SettingsSectionTitle>
|
||||
<SettingsSectionDescription>
|
||||
How the time on the dashboard looks.
|
||||
</SettingsSectionDescription>
|
||||
</SettingsSectionHeader>
|
||||
<SettingsRow>
|
||||
<SettingsRowText>
|
||||
<div id="settings-font" className="leading-tight font-bold">
|
||||
Font
|
||||
</div>
|
||||
</SettingsRowText>
|
||||
<SettingsRowControl>
|
||||
<SegmentedControl
|
||||
aria-labelledby="settings-font"
|
||||
size="md"
|
||||
value={data.clockFont}
|
||||
onValueChange={(v) => save({ clockFont: v as ClockFont })}
|
||||
>
|
||||
{CLOCK_FONTS.map((f) => (
|
||||
<SegmentedControlItem key={f} value={f}>
|
||||
{CLOCK_FONT_NAMES[f]}
|
||||
</SegmentedControlItem>
|
||||
))}
|
||||
</SegmentedControl>
|
||||
</SettingsRowControl>
|
||||
</SettingsRow>
|
||||
<SettingsRow>
|
||||
<SettingsRowText>
|
||||
<div
|
||||
id="settings-style"
|
||||
className="leading-tight font-bold"
|
||||
>
|
||||
Style
|
||||
</div>
|
||||
<SettingsRowDescription>
|
||||
Glass shows the wallpaper blurred through the digits.
|
||||
Tinted takes its color from the wallpaper.
|
||||
</SettingsRowDescription>
|
||||
</SettingsRowText>
|
||||
<SettingsRowControl>
|
||||
<SegmentedControl
|
||||
aria-labelledby="settings-style"
|
||||
size="md"
|
||||
value={data.clockStyle}
|
||||
onValueChange={(v) =>
|
||||
save({ clockStyle: v as ClockStyle })
|
||||
}
|
||||
>
|
||||
{CLOCK_STYLES.map((s) => (
|
||||
<SegmentedControlItem key={s} value={s}>
|
||||
{CLOCK_STYLE_NAMES[s]}
|
||||
</SegmentedControlItem>
|
||||
))}
|
||||
</SegmentedControl>
|
||||
</SettingsRowControl>
|
||||
</SettingsRow>
|
||||
</SettingsSection>
|
||||
|
||||
<SettingsSection id="search" className={section}>
|
||||
<SettingsSectionHeader>
|
||||
<SettingsSectionTitle>Search</SettingsSectionTitle>
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
@import "./vendor/collabry/styles/index.css";
|
||||
@import "@fontsource-variable/inter";
|
||||
@import "@fontsource/dm-serif-display";
|
||||
/* only for the clock, and only downloaded when chosen in the settings */
|
||||
@import "@fontsource-variable/nunito";
|
||||
@import "@fontsource-variable/roboto-slab";
|
||||
|
||||
@theme inline {
|
||||
--font-sans: "Inter Variable", system-ui, sans-serif;
|
||||
--font-serif: "DM Serif Display", ui-serif, Georgia, serif;
|
||||
--font-rounded: "Nunito Variable", ui-rounded, system-ui, sans-serif;
|
||||
--font-slab: "Roboto Slab Variable", ui-serif, Georgia, serif;
|
||||
}
|
||||
|
||||
/* The accent is near white here (set on ThemeProvider), so text on it is dark */
|
||||
|
||||
Reference in New Issue
Block a user