Shereen Lee commited on
Commit
e7a29bb
·
1 Parent(s): 35799ba

feat(polaroid): springier browse slide (overshoot+settle) and subtle translucent swaying browse arrows to invite the flick

Browse files
Files changed (1) hide show
  1. index.html +19 -10
index.html CHANGED
@@ -153,18 +153,27 @@
153
  @keyframes sozai-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
154
  @keyframes sozai-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-5px); opacity: 1; } }
155
  /* polaroid slide-in when browsing photos (item: moving/reveal effect) */
 
156
  @keyframes sozai-slide-in-right {
157
- 0% { transform: translateX(46%) rotate(5deg); opacity: 0; }
158
- 60% { transform: translateX(-3%) rotate(-1.5deg); opacity: 1; }
159
- 100% { transform: translateX(0) rotate(0deg); opacity: 1; }
 
160
  }
161
  @keyframes sozai-slide-in-left {
162
- 0% { transform: translateX(-46%) rotate(-5deg); opacity: 0; }
163
- 60% { transform: translateX(3%) rotate(1.5deg); opacity: 1; }
164
- 100% { transform: translateX(0) rotate(0deg); opacity: 1; }
 
165
  }
166
- .sozai-slide-right { animation: sozai-slide-in-right 0.42s cubic-bezier(0.22, 1, 0.36, 1); }
167
- .sozai-slide-left { animation: sozai-slide-in-left 0.42s cubic-bezier(0.22, 1, 0.36, 1); }
 
 
 
 
 
 
168
  /* (reduced motion is handled globally by the html.a11y-reduce-motion rule above) */
169
 
170
  /* polaroid teardown when the user removes it (presses ×) - it crumples,
@@ -2372,13 +2381,13 @@
2372
  <input ref={addPhotoRef} type="file" accept={ACCEPT_ATTR} multiple className="hidden" onChange={onAddPhotos} />
2373
  {stackPhotos.length >= 1 && (
2374
  <div className="flex items-start gap-3">
2375
- <button type="button" onClick={() => changePhoto(-1)} aria-label="Previous photo" className="flex size-9 items-center justify-center rounded-full border-2 border-primary text-primary transition-colors hover:bg-accent"><ChevronLeft className="size-4" /></button>
2376
  <div className="flex flex-col items-center gap-1">
2377
  <button type="button" onClick={() => addPhotoRef.current && addPhotoRef.current.click()} aria-label="Add photos" title="Add photos" className="flex size-9 items-center justify-center rounded-full border-2 border-primary bg-primary text-primary-foreground transition-colors hover:opacity-90"><Plus className="size-4" /></button>
2378
  <span className="font-mono text-[9px] uppercase tracking-wide text-primary">upload</span>
2379
  </div>
2380
  <button type="button" onClick={onRemovePhoto} aria-label="Remove this photo" title="Remove this photo" className="flex size-9 items-center justify-center rounded-full border-2 border-[#800020] bg-[#800020] text-white transition-colors hover:opacity-90"><Trash2 className="size-4" /></button>
2381
- <button type="button" onClick={() => changePhoto(1)} aria-label="Next photo" className="flex size-9 items-center justify-center rounded-full border-2 border-primary text-primary transition-colors hover:bg-accent"><ChevronRight className="size-4" /></button>
2382
  </div>
2383
  )}
2384
  {/* How this works - fills the left-column negative space */}
 
153
  @keyframes sozai-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
154
  @keyframes sozai-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-5px); opacity: 1; } }
155
  /* polaroid slide-in when browsing photos (item: moving/reveal effect) */
156
+ /* springy: overshoot, counter-settle, then rest — gives the browse weight */
157
  @keyframes sozai-slide-in-right {
158
+ 0% { transform: translateX(54%) rotate(6deg) scale(0.95); opacity: 0; }
159
+ 55% { transform: translateX(-5%) rotate(-2.2deg) scale(1.025); opacity: 1; }
160
+ 78% { transform: translateX(2%) rotate(1deg) scale(0.995); }
161
+ 100% { transform: translateX(0) rotate(0deg) scale(1); opacity: 1; }
162
  }
163
  @keyframes sozai-slide-in-left {
164
+ 0% { transform: translateX(-54%) rotate(-6deg) scale(0.95); opacity: 0; }
165
+ 55% { transform: translateX(5%) rotate(2.2deg) scale(1.025); opacity: 1; }
166
+ 78% { transform: translateX(-2%) rotate(-1deg) scale(0.995); }
167
+ 100% { transform: translateX(0) rotate(0deg) scale(1); opacity: 1; }
168
  }
169
+ .sozai-slide-right { animation: sozai-slide-in-right 0.55s cubic-bezier(0.34, 1.42, 0.5, 1); }
170
+ .sozai-slide-left { animation: sozai-slide-in-left 0.55s cubic-bezier(0.34, 1.42, 0.5, 1); }
171
+ /* gentle sway on the browse arrows, nudging toward the flick direction */
172
+ @keyframes sozai-sway-l { 0%,100%{transform:translateX(0)} 50%{transform:translateX(-3px)} }
173
+ @keyframes sozai-sway-r { 0%,100%{transform:translateX(0)} 50%{transform:translateX(3px)} }
174
+ .sozai-sway-l { animation: sozai-sway-l 1.9s ease-in-out infinite; }
175
+ .sozai-sway-r { animation: sozai-sway-r 1.9s ease-in-out infinite; }
176
+ @media (prefers-reduced-motion: reduce) { .sozai-sway-l, .sozai-sway-r { animation: none; } }
177
  /* (reduced motion is handled globally by the html.a11y-reduce-motion rule above) */
178
 
179
  /* polaroid teardown when the user removes it (presses ×) - it crumples,
 
2381
  <input ref={addPhotoRef} type="file" accept={ACCEPT_ATTR} multiple className="hidden" onChange={onAddPhotos} />
2382
  {stackPhotos.length >= 1 && (
2383
  <div className="flex items-start gap-3">
2384
+ <button type="button" onClick={() => changePhoto(-1)} aria-label="Previous photo" className="sozai-sway-l flex size-9 items-center justify-center rounded-full border-2 border-primary/25 text-primary/55 transition-all hover:border-primary hover:bg-accent hover:text-primary"><ChevronLeft className="size-4" /></button>
2385
  <div className="flex flex-col items-center gap-1">
2386
  <button type="button" onClick={() => addPhotoRef.current && addPhotoRef.current.click()} aria-label="Add photos" title="Add photos" className="flex size-9 items-center justify-center rounded-full border-2 border-primary bg-primary text-primary-foreground transition-colors hover:opacity-90"><Plus className="size-4" /></button>
2387
  <span className="font-mono text-[9px] uppercase tracking-wide text-primary">upload</span>
2388
  </div>
2389
  <button type="button" onClick={onRemovePhoto} aria-label="Remove this photo" title="Remove this photo" className="flex size-9 items-center justify-center rounded-full border-2 border-[#800020] bg-[#800020] text-white transition-colors hover:opacity-90"><Trash2 className="size-4" /></button>
2390
+ <button type="button" onClick={() => changePhoto(1)} aria-label="Next photo" className="sozai-sway-r flex size-9 items-center justify-center rounded-full border-2 border-primary/25 text-primary/55 transition-all hover:border-primary hover:bg-accent hover:text-primary"><ChevronRight className="size-4" /></button>
2391
  </div>
2392
  )}
2393
  {/* How this works - fills the left-column negative space */}