Skip to the content

Fuda Cards札

Collectible card frames for images and live 3D: a true thickness, an edge, foil, stacks, wear and a binder, as two web components.

Fuda is the Japanese word 札 for a card or a tag. About the name

Contents

Reference · Collections and piles: pure helpers

movePagefunction

The first card of the page that is delta pages away, wrapping round at either end.

Import it

import { movePage } from "@johnmorrisdotca/fuda-cards/collection";

Definition

function movePage(index: number, length: number, pageSize: number, delta: number): number

Parameters

NameTypeDescription
indexnumber

The index of any card on the page now.

lengthnumber

How many cards the collection holds.

pageSizenumber

How many cards a page holds.

deltanumber

How many pages to move: 1 forward, -1 back.

Returns

number

The index of the first card of that page; 0 for an empty collection.

Examples

import { movePage } from "@johnmorrisdotca/fuda-cards/collection";

console.log(movePage(6, 7, 3, 1), movePage(0, 7, 3, -1)); // 0 6
0 6

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/fuda-cards 0.11.0.