style(app): mobile-native layout with safe areas and grouped list

This commit is contained in:
devcodetools committed 2026-09-13 17:11:30 +02:00
1 parent 4ae6ff61b4
commit 98e5343bc3
6 files changed
+18 -8

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@
name="description" name="description"
content="Application web SPA PWA installable et utilisable hors connexion." content="Application web SPA PWA installable et utilisable hors connexion."
/> />
<meta name="theme-color" content="#0f172a" /> <meta name="theme-color" content="#f8fafc" />
<meta name="color-scheme" content="dark light" /> <meta name="color-scheme" content="dark light" />
<meta name="robots" content="index, follow" /> <meta name="robots" content="index, follow" />
<title>new</title> <title>new</title>
+2 -2
View File
@@ -37,8 +37,8 @@ function App() {
} }
return ( return (
<main className="mx-auto w-full max-w-2xl flex flex-col min-h-dvh pb-28"> <main className="mx-auto flex w-full max-w-2xl min-h-dvh flex-col pb-[calc(env(safe-area-inset-bottom)+7rem)]">
<header className="sticky top-0 z-10 bg-white/95 backdrop-blur border-b border-gray-200 px-4 py-3"> <header className="sticky top-0 z-10 border-b border-gray-200 bg-white/95 px-4 pb-3 pt-[calc(env(safe-area-inset-top)+0.75rem)] backdrop-blur">
{creating || selectedNote ? ( {creating || selectedNote ? (
<div className="flex items-center gap-1"> <div className="flex items-center gap-1">
<button <button
+1 -1
View File
@@ -6,7 +6,7 @@ function FloatingButton({ onClick, label = 'Créer une note' }: FloatingButtonPr
type="button" type="button"
onClick={onClick} onClick={onClick}
aria-label={label} aria-label={label}
className="fixed bottom-6 right-6 z-20 flex h-14 w-14 items-center justify-center rounded-full bg-blue-700 text-3xl text-white shadow-lg transition-transform hover:bg-blue-800 active:scale-95 focus:outline-none focus:ring-2 focus:ring-blue-800 focus:ring-offset-2" className="fixed bottom-[calc(env(safe-area-inset-bottom)+1.5rem)] right-6 z-20 flex h-14 w-14 items-center justify-center rounded-full bg-blue-700 text-3xl text-white shadow-lg transition-transform hover:bg-blue-800 active:scale-95 focus:outline-none focus:ring-2 focus:ring-blue-800 focus:ring-offset-2"
> >
+ +
</button> </button>
+2 -2
View File
@@ -17,7 +17,7 @@ function NoteForm({
}: NoteFormProps) { }: NoteFormProps) {
return ( return (
<form <form
className="flex flex-col gap-4 rounded-xl border border-gray-200 bg-white p-4 shadow-sm" className="flex flex-col gap-4 rounded-2xl border border-gray-200 bg-white p-4 shadow-sm"
onSubmit={(event) => { onSubmit={(event) => {
event.preventDefault() event.preventDefault()
onSubmit() onSubmit()
@@ -114,7 +114,7 @@ function NoteEditor(props: NoteEditorProps) {
const { note } = props const { note } = props
return ( return (
<article className="flex flex-col gap-5 rounded-xl border border-gray-200 bg-white p-4 shadow-sm"> <article className="flex flex-col gap-5 rounded-2xl border border-gray-200 bg-white p-4 shadow-sm">
<div className="flex items-start justify-between gap-4"> <div className="flex items-start justify-between gap-4">
<h2 className="text-xl font-semibold leading-snug">{note.title || 'Sans titre'}</h2> <h2 className="text-xl font-semibold leading-snug">{note.title || 'Sans titre'}</h2>
<button <button
+2 -2
View File
@@ -12,14 +12,14 @@ function NoteList({ notes, onSelect }: NoteListProps) {
} }
return ( return (
<ul className="flex flex-col divide-y divide-gray-100"> <ul className="flex flex-col divide-y divide-gray-100 overflow-hidden rounded-2xl bg-white shadow-sm">
{notes.map((note) => ( {notes.map((note) => (
<li key={note.id}> <li key={note.id}>
<button <button
type="button" type="button"
onClick={() => onSelect(note.id)} onClick={() => onSelect(note.id)}
aria-label={note.title ? `Ouvrir la note ${note.title}` : 'Ouvrir la note Sans titre'} aria-label={note.title ? `Ouvrir la note ${note.title}` : 'Ouvrir la note Sans titre'}
className="flex w-full items-center justify-between gap-3 px-2 py-4 text-left text-base hover:bg-gray-50 active:bg-gray-100" className="flex w-full min-h-14 items-center justify-between gap-3 px-4 py-5 text-left text-base active:bg-gray-50"
> >
<span className={note.title ? 'text-gray-800' : 'italic text-gray-400'}> <span className={note.title ? 'text-gray-800' : 'italic text-gray-400'}>
{note.title || 'Sans titre'} {note.title || 'Sans titre'}
+10
View File
@@ -1,6 +1,16 @@
@import 'tailwindcss'; @import 'tailwindcss';
@layer base { @layer base {
html {
-webkit-tap-highlight-color: transparent;
overscroll-behavior-y: none;
}
body {
min-height: 100dvh;
background-color: var(--color-neutral-500);
}
button { button {
touch-action: manipulation; touch-action: manipulation;
cursor: pointer; cursor: pointer;