aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authoraidahosa1 <aisosa_idahosa@brown.edu>2024-03-19 16:21:34 -0400
committeraidahosa1 <aisosa_idahosa@brown.edu>2024-04-04 04:24:18 -0400
commitd3383640a8007a15e0deb47715e203508c4fd64a (patch)
tree2844d81ab44934e35d8051d28484054f2120cb3d /src/client/documents/Documents.ts
parentc0f942d81070d3b77029abc98c50ab3fd5ac2dbe (diff)
working on implementing card logic
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index d12c61fd7..c453fd793 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -1219,14 +1219,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);
@@ -1244,6 +1237,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 });
}
@@ -1887,6 +1884,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);
@@ -1897,7 +1895,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;
});
});