• Stars
    star
    338
  • Rank 124,931 (Top 3 %)
  • Language
    HTML
  • Created over 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

My MidJourney AI art gallery, made to show shiny UI/UX details. As seen in the tweet.

Demo

Features

  • Non-disruptive, interruptible transitions. Animations don't block your ability to interact with the UI.
  • Optionally reduced motion for accessibility.
  • Layout-aware decoupled hit areas. In the gallery's line mode, the left & right cursor hit areas vertically extend to the window's edges, so that horizontally thin images don't have smaller hit areas than others. Hit areas also don't move with their image during transition, so you don't have to snipe click images. Consequently, rapidly clicking the left or right image doesn't accidentally dismiss the gallery (caused by clicking on a gap between image, or re-clicking on the newly centering image itself while it's still moving).
  • Window resize transition. Just enough to convey what moved where.
  • Anchor during resize. No layout shift! Resize without losing what you're looking at.
  • Area-based responsive image size. Naive responsive layout uses the width of an item, but an image's visual impact is determined by its area. For the same width, square images visually appear bigger, while long images end up too thin. So we punish the formers by shrinking them, and grow the latters, to end up with more visually equal image sizes. Nice tangential article here.
  • Non-throttled cursor updates. The cursor state, when specified on the UI elements themselves (e.g. cursor: 'zoom-in'), doesn't update immediately during smooth scrolling. Hover effects also don't trigger til scrolling ends.
  • Edge rubberbanding on the first & last item.
  • Dynamic depth management. Proper z-index adjustments when images overlap. The center image in line view needs to be in front.
  • Framerate-decoupled animation. Transitions run well and on time even when framerate is uneven, or when frames are completely dropped on lower-end devices.
  • Spring physics (exaggerated in the link for effect). Subtle playful bounces.
  • Continous hover effect. The cursor attracts images magnetically, as opposed to a typical discrete, one-off upward lift transition trigger.
  • Seamless repositioning on image dismissal. In line view, navigating to a image and dismissing it transports you to the location of that image even if it's way further down the grid.
  • Pretty selections. Select-all doesn't ruin the page's look.
  • Routing.
  • Occlusion culling. Only render what's in view (sometime called virtualization). This puts a nice hard upper bound on the amount of DOM manipulations.
  • Keyboard inputs & multiple inputs coordination. Concurrent keys and cursor events are resolved without pretending they're independent events.
  • Progressive image loading. Though this could be done better.
  • Smoothness & performance. Works on 120fps displays, including ProMotion.
  • Battery-friendly. Fewer DOM nodes & no excessive tangential computations. You'll never get the Safari tab energy consumption warning.
  • Blur & brightness effects. These help focusing on the middle image in the line view.
  • SEO-friendly.
  • Cool images =)

For developers:

  • Short, dependency-free code with no hidden control flow.
  • Fun debug mode with manual frame stepping.
  • Guaranteed minimum render count. Renders are batched per frame. Also no multi-frames cascading rerenders from wrongly ordered state changes.
  • Minimal DOM nodes. A clean, wrapper-divs-free inspector experience.

Architecture

flowchart TB
  subgraph Initialization
    ISstate["State declaration"]
    IDOM["Static DOM chunks"]
    IEvents["Events Registration (all static)"]
  end
  IEvents -- triggers --> Render
  subgraph Render["Render (1 frame)"]
    direction TB
    A("DOM reads (batched)") --> State
    subgraph State["State changes"]
      direction TB
      B("Handle inputs") --> C("New layout & cursor")
      C --> D("Animation tick")
      D --> E("Occlusion & render DOM writes (batched)")
    end
    State --> F("Commit state changes")
  end
  Render -- "\nProgrammatic scroll/more animation?" --> Render

More Repositories

1

react-motion

A spring that solves your animation problems.
JavaScript
21,680
star
2

react-tween-state

React animation.
JavaScript
1,742
star
3

react-treeview

Easy, light, flexible tree view made with React.
JavaScript
1,086
star
4

react-radio-group

Better radio buttons.
JavaScript
442
star
5

node-huxley

Codeless front-end testing.
JavaScript
365
star
6

react-state-stream

React animation on steroid.
JavaScript
361
star
7

RCSS

Turn your JavaScript objects into CSS classes.
JavaScript
286
star
8

intro-to-reason-compilation

Ready up!
Shell
269
star
9

react-spinner

Zero configuration loading spinner.
JavaScript
186
star
10

tween-functions

Robert Penner's easing functions, slightly modified
JavaScript
182
star
11

data-structures

Fast, light and hassle-free JavaScript data structures, written in CoffeeScript.
JavaScript
147
star
12

pure-css-shaders-art

At the intersection of art and bad performance
HTML
121
star
13

cards

Prototyping the UI of 2030
OCaml
109
star
14

jeason

The crappy js-to-reason converter anyone can contribute to!
OCaml
106
star
15

react-chosen

React wrapper for Chosen jQuery.
HTML
96
star
16

react-dash

React documentation source for [Dash](http://kapeli.com/dash)
JavaScript
90
star
17

require-polyfill

Make `require` work in browsers, at runtime. No code bundling needed!
JavaScript
42
star
18

reason-project-ideas

40
star
19

png-diff

Small PNG diff utility, written in pure JS for Node.
JavaScript
40
star
20

react-lights-out

Simple demo of the React framework's power and flexibility.
JavaScript
27
star
21

upgrade-reason-react

OCaml
27
star
22

png-crop

Small PNG cropping utility, written in pure JS for Node.
JavaScript
23
star
23

grunt-huxley

Grunt task for node-huxley.
JavaScript
21
star
24

jon-blow-video-outlines

Outlines for Jon Blow's YouTube videos on games, programming and more.
20
star
25

multitouch-line-art

JavaScript
17
star
26

code-snippets

Code Snippets, algorithms, etc.
CoffeeScript
13
star
27

flexbox-see

Flexbox visualizer.
JavaScript
10
star
28

react-placeholder-shim

Form placeholder for input and textarea in ie8 and 9.
JavaScript
9
star
29

huxley-example

Demo from node-huxley's README
7
star
30

shaderjoy

TypeScript
6
star
31

phone-parser

Parse the phone input into an output format of your choice. Good for formatting a user input.
JavaScript
6
star
32

flappy-2048-side-by-side

An experiment in time wasting.
CSS
5
star
33

sublime-config

My configurations for Sublime Text.
JavaScript
4
star
34

the-game

yada yada
JavaScript
3
star
35

valid-css-props

Check for the validity of a CSS property name.
JavaScript
3
star
36

flip-it.safariextension

Flipboard Safari extension for adding a stuff on the web to your personal magazine.
CoffeeScript
3
star
37

l-system

Fun experiment in pattern generation, with a visualizer.
JavaScript
3
star
38

ocaml-bench

OCaml
3
star
39

bootstrap-everywhere.safariextension

Safari extension for turning websites more Californian
JavaScript
2
star
40

elastic

Something something OCaml
OCaml
2
star
41

mememe

OCaml
1
star
42

super-spy

JavaScript
1
star
43

reasonable

JavaScript
1
star
44

chalk-time

JavaScript
1
star