refactor: extract various constants
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
export const DB_NAME = 'papercrate_desk';
|
||||
export const DB_VERSION = 1;
|
||||
export const LAYOUT_STORE = 'layouts';
|
||||
|
||||
export const CLICK_ACTIONS = {
|
||||
selectSingle: 'selectSingle',
|
||||
openDetail: 'openDetail',
|
||||
addCard: 'addCard',
|
||||
addStack: 'addStack',
|
||||
none: 'none',
|
||||
} as const;
|
||||
|
||||
export const DRAG_ACTIONS = {
|
||||
dragSelectSingle: 'dragSelectSingle',
|
||||
dragSelection: 'dragSelection',
|
||||
dragSelectStack: 'dragSelectStack',
|
||||
none: 'none',
|
||||
} as const;
|
||||
|
||||
export const STACK_HIT_EPSILON = 4;
|
||||
export const POINTER_DRAG_THRESHOLD_SQUARED = 16;
|
||||
export const LONG_PRESS_DURATION_MS = 450;
|
||||
|
||||
export const DRAG_HYSTERESIS_PX = 4;
|
||||
export const DRAG_HYSTERESIS_SQUARED = DRAG_HYSTERESIS_PX * DRAG_HYSTERESIS_PX;
|
||||
export const EDGE_COLLISION_THRESHOLD = 0.5;
|
||||
|
||||
export const TAG_REMOVE_DISTANCE = 160;
|
||||
|
||||
export const DEBUG_DRAG = false;
|
||||
export const DEBUG_FOCUS = false;
|
||||
|
||||
export const DESK_CANVAS_PADDING = 24;
|
||||
export const DESK_ROTATION_RANGE = 7;
|
||||
export const DESK_DEFAULT_CANVAS_WIDTH = 1024;
|
||||
export const DESK_DEFAULT_CANVAS_HEIGHT = 680;
|
||||
export const DESK_CARD_MIN = 240;
|
||||
export const DESK_CARD_MAX = 340;
|
||||
export const CARD_PAGE_WEIGHT_GRAMS = 5;
|
||||
export const CARD_BASE_WEIGHT_GRAMS = 30;
|
||||
export const DEFAULT_Z_START = 10;
|
||||
export const MIN_TIMESTEP = 1 / 120;
|
||||
export const MAX_TIMESTEP = 1 / 20;
|
||||
export const MAX_DYNAMIC_ROTATION = 7;
|
||||
export const MAX_ANGULAR_VELOCITY = 210;
|
||||
export const ANGULAR_DAMPING = 10;
|
||||
export const TORQUE_TO_ACCELERATION = 0.007;
|
||||
export const SETTLE_ANGULAR_VELOCITY = 0.45;
|
||||
Reference in New Issue
Block a user