mirror of
https://github.com/IliesAllali/parenthese.git
synced 2026-11-11 00:02:13 +00:00
Le cadrage (centre et zoom) est stocké dans Person.avatarCrop (JSON, nullable), l'original reste sur disque et le cadrage s'applique à l'affichage (canevas et fiche). Route PUT /trees/:id/persons/:personId/avatar/crop, réservée aux administrateurs. La suppression et le nouvel envoi remettent le cadrage à zéro. Migration additive (colonne nullable, sans défaut), testée sur base vide et sur base avec données. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
58 lines
2.5 KiB
CSS
58 lines
2.5 KiB
CSS
/* ============================================================
|
|
Recadrage du portrait (fenêtre pz)
|
|
Le masque garde la forme du cadre de la personne dans l'arbre. La photo glisse dessous.
|
|
Les variables --pz-* viennent de src/styles/pz.css.
|
|
============================================================ */
|
|
|
|
.pcrop-modal { width: min(100%, 440px); }
|
|
|
|
.pcrop-body { display: grid; gap: 14px; min-width: 0; }
|
|
|
|
.pcrop-stage {
|
|
position: relative; width: min(100%, 300px); aspect-ratio: 1 / 1; margin: 0 auto;
|
|
overflow: hidden; border-radius: 18px; background: var(--pz-line-soft, #efe9e1);
|
|
touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
|
|
outline: none;
|
|
}
|
|
.pcrop-stage.is-dragging { cursor: grabbing; }
|
|
.pcrop-stage:focus-visible { box-shadow: 0 0 0 2px var(--pz-a500); }
|
|
|
|
/* La photo, placée en pourcentages du conteneur par portraitCrop.js */
|
|
.pcrop-img {
|
|
position: absolute; max-width: none; pointer-events: none;
|
|
transition: left 220ms var(--pz-ease), top 220ms var(--pz-ease), width 220ms var(--pz-ease), height 220ms var(--pz-ease);
|
|
}
|
|
.pcrop-stage.is-dragging .pcrop-img { transition: none; }
|
|
|
|
/* Masque : l'ombre étendue assombrit tout ce qui est hors du cadre */
|
|
.pcrop-window {
|
|
position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none;
|
|
box-shadow: 0 0 0 999px rgba(42, 38, 34, .55), inset 0 0 0 1px rgba(255, 255, 255, .75);
|
|
}
|
|
.pcrop-window--round { border-radius: 50%; }
|
|
.pcrop-window--square { border-radius: 4px; }
|
|
.pcrop-window--rect { border-radius: 6px; }
|
|
/* Polaroid : une bordure blanche autour de la zone photo */
|
|
.pcrop-window--polaroid { border-radius: 2px; box-shadow: 0 0 0 7px #fff, 0 0 0 999px rgba(42, 38, 34, .55); }
|
|
|
|
.pcrop-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--pz-muted); }
|
|
|
|
.pcrop-hint { margin: 0; text-align: center; color: var(--pz-muted); }
|
|
|
|
.pcrop-zoom {
|
|
display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px;
|
|
min-height: 40px; max-width: 300px; width: 100%; margin: 0 auto;
|
|
}
|
|
.pcrop-zoom input[type="range"] { width: 100%; min-height: 40px; accent-color: var(--pz-a500); cursor: pointer; }
|
|
.pcrop-zoom input[type="range"]:disabled { opacity: .5; cursor: default; }
|
|
|
|
.pcrop-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
|
|
|
|
@media (hover: hover) and (pointer: fine) {
|
|
.pcrop-modal .pz-btn--ghost:hover:not(:disabled) { background: var(--pz-line-soft); }
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.pcrop-img { transition: none; }
|
|
}
|