Add new styles for home and landing pages
- Created home.css with comprehensive styles for the home page layout, including typography, buttons, and responsive design adjustments. - Created landing.css to style the landing page, focusing on typography, layout, and responsive behavior for various screen sizes.
This commit is contained in:
@@ -55,12 +55,14 @@ export class HabitService {
|
||||
}
|
||||
create(input: ReturnType<typeof habitInput.parse>) {
|
||||
const id = crypto.randomUUID();
|
||||
const config: HabitConfig = input.method === 'tasks'
|
||||
? { ...input, archived: false, tasks: input.tasks.map(t => ({ ...t, id: crypto.randomUUID() })) }
|
||||
: { ...input, archived: false };
|
||||
const { color, ...requirements } = input;
|
||||
const config: HabitConfig = requirements.method === 'tasks'
|
||||
? { ...requirements, archived: false, tasks: requirements.tasks.map(t => ({ ...t, id: crypto.randomUUID() })) }
|
||||
: { ...requirements, archived: false };
|
||||
this.db.transaction(() => {
|
||||
this.db.insert(habits).values({ id, userId: this.user.id, createdDate: this.today, createdAt: this.now }).run();
|
||||
this.db.insert(habitRevisions).values({ habitId: id, effectiveDate: this.today, config, createdAt: this.now }).run();
|
||||
if (color) this.saveSettings(id, calendarSettingsSchema.parse({ mainColor: color }));
|
||||
this.materialize(this.owned(id));
|
||||
});
|
||||
return this.current(id);
|
||||
@@ -80,7 +82,13 @@ export class HabitService {
|
||||
const config: HabitConfig = parsed.data.method === 'tasks'
|
||||
? { ...parsed.data, tasks: old.method === 'tasks' ? old.tasks : [], archived: (patch.archived ?? old.archived) as boolean }
|
||||
: { ...parsed.data, archived: (patch.archived ?? old.archived) as boolean };
|
||||
return this.revise(id, config);
|
||||
return this.db.transaction(() => {
|
||||
const updated = this.revise(id, config);
|
||||
if (patch.color !== undefined) {
|
||||
this.saveSettings(id, calendarSettingsSchema.parse({ ...this.settings(id), mainColor: patch.color }));
|
||||
}
|
||||
return updated;
|
||||
});
|
||||
}
|
||||
revise(id: string, config: HabitConfig) {
|
||||
this.invalidate(id);
|
||||
|
||||
Reference in New Issue
Block a user