diff options
author | aidahosa1 <aisosa_idahosa@brown.edu> | 2024-03-19 16:21:34 -0400 |
---|---|---|
committer | aidahosa1 <aisosa_idahosa@brown.edu> | 2024-03-19 16:30:18 -0400 |
commit | 66f904921ef519e1b54cb013ea7fafc640ae3dc7 (patch) | |
tree | c9204c1578870ebaac48741cce9beebf980fd427 /src/client/documents/Documents.ts | |
parent | 26cf01d862a324d90ec8c9363a9fb12c4e98d58d (diff) |
working on implementing card logic
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r-- | src/client/documents/Documents.ts | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index be382afe3..00a7ecd23 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -1218,14 +1218,7 @@ export namespace Docs { ); } - export function CardDeckDocument(documents: Array<Doc>, options: DocumentOptions, id?: string) { - return InstanceFromProto( - Prototypes.get(DocumentType.COL), - new List(documents), - { backgroundColor: 'transparent', dropAction: dropActionType.move, _forceActive: true, _freeform_noZoom: true, _freeform_noAutoPan: true, ...options, _type_collection: CollectionViewType.Card }, - id - ); - } + export function LinearDocument(documents: Array<Doc>, options: DocumentOptions, id?: string) { return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { ...options, _type_collection: CollectionViewType.Linear }, id); @@ -1243,6 +1236,10 @@ export namespace Docs { return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { ...options, _type_collection: CollectionViewType.Carousel3D }); } + export function CardDeckDocument(documents: Array<Doc>, options: DocumentOptions, id?: string) { + return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { ...options, _type_collection: CollectionViewType.Card}); + } + export function SchemaDocument(schemaHeaders: SchemaHeaderField[], documents: Array<Doc>, options: DocumentOptions) { return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { schemaHeaders: new List(schemaHeaders), ...options, _type_collection: CollectionViewType.Schema }); } @@ -1875,6 +1872,7 @@ export namespace DocUtils { } export function spreadCards(docList: Doc[], x: number = 0, y: number = 0, spreadAngle: number = 30, radius: number = 100, create: boolean = true) { + console.log('spread cards'); const totalCards = docList.length; const halfSpreadAngle = spreadAngle * 0.5; const angleStep = spreadAngle / (totalCards - 1); @@ -1885,7 +1883,7 @@ export namespace DocUtils { const angle = (-halfSpreadAngle + angleStep * i) * (Math.PI / 180); // Convert degrees to radians d.x = x + Math.cos(angle) * radius; d.y = y + Math.sin(angle) * radius; - d.rotation = angle; // Assuming 'd.rotation' sets the rotation, adjust accordingly + d.rotation = angle; d._timecodeToShow = undefined; }); }); |