diff options
| author | aidahosa1 <aisosa_idahosa@brown.edu> | 2024-06-04 12:48:41 -0400 |
|---|---|---|
| committer | aidahosa1 <aisosa_idahosa@brown.edu> | 2024-06-04 12:48:41 -0400 |
| commit | 6bfa2fd696a306a984b29c6ea11fa66e93e0474c (patch) | |
| tree | 924bbcdad4bbef3e13ea211d267bd6d8ea74964f /src/client/views | |
| parent | a7f5bd1c2438f95252f5515d7226b491dfb5183b (diff) | |
changes
Diffstat (limited to 'src/client/views')
| -rw-r--r-- | src/client/views/MainView.tsx | 1 | ||||
| -rw-r--r-- | src/client/views/collections/CollectionCardDeckView.tsx | 21 | ||||
| -rw-r--r-- | src/client/views/pdf/GPTPopup/GPTPopup.tsx | 21 |
3 files changed, 22 insertions, 21 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index 31d88fb87..f61c784df 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -548,6 +548,7 @@ export class MainView extends ObservableReactComponent<{}> { fa.faRobot, fa.faSatellite, fa.faStar, + fa.faCloud ] ); } diff --git a/src/client/views/collections/CollectionCardDeckView.tsx b/src/client/views/collections/CollectionCardDeckView.tsx index de46180e6..0ca3c5a44 100644 --- a/src/client/views/collections/CollectionCardDeckView.tsx +++ b/src/client/views/collections/CollectionCardDeckView.tsx @@ -170,6 +170,8 @@ export class CollectionCardView extends CollectionSubView() { * @returns */ rotate = (amCards: number, index: number) => { + if (amCards ==1) return 0 + const possRotate = -30 + index * (30 / ((amCards - (amCards % 2)) / 2)); const stepMag = Math.abs(-30 + (amCards / 2 - 1) * (30 / ((amCards - (amCards % 2)) / 2))); @@ -242,16 +244,20 @@ export class CollectionCardView extends CollectionSubView() { return [DateCast(docA.author_date)?.date ?? Date.now(), DateCast(docB.author_date)?.date ?? Date.now()]; case cardSortings.Color: - return [DashColor(StrCast(docA.backgroundColor)).hsv().toString(), // If docA.type is undefined, use an empty string - DashColor(StrCast(docB.backgroundColor)).hsv().toString()]; // If docB.type is undefined, use an empty string + return [ClientUtils.hexToHsv(StrCast(docA.backgroundColor)) ?? 9999, // If docA.type is undefined, use an empty string + ClientUtils.hexToHsv(StrCast(docB.backgroundColor))] ?? 9999; // If docB.type is undefined, use an empty string case cardSortings.Custom: - return [CollectionCardView.getButtonGroup(this.cardSort_customField, docA)??0, - CollectionCardView.getButtonGroup(this.cardSort_customField, docB)??0]; + return [CollectionCardView.getButtonGroup(this.cardSort_customField, docA)??9999, + CollectionCardView.getButtonGroup(this.cardSort_customField, docB)??9999]; default: return [StrCast(docA.type), // If docA.type is undefined, use an empty string StrCast(docB.type)]; // If docB.type is undefined, use an empty string } // prettier-ignore })(); + console.log(ClientUtils.hexToHsv(StrCast(docA.backgroundColor)) ?? 9999 + "docA col") + console.log(ClientUtils.hexToHsv(StrCast(docB.backgroundColor)) ?? 9999 + "docB col") + + const out = typeA < typeB ? -1 : typeA > typeB ? 1 : 0; return isDesc ? -out : out; // Reverse the sort order if descending is true }); @@ -323,7 +329,7 @@ export class CollectionCardView extends CollectionSubView() { * @returns */ calculateTranslateY = (isHovered: boolean, isSelected: boolean, realIndex: number, amCards: number, calcRowIndex: number) => { - if (isSelected) return 50 * this.fitContentScale; + if (isSelected || amCards == 1) return 50 * this.fitContentScale; const trans = isHovered ? this.translateHover(realIndex) : 0; return trans + this.translateY(amCards, calcRowIndex, realIndex); }; @@ -472,7 +478,7 @@ export class CollectionCardView extends CollectionSubView() { SnappingManager.SetIsResizing(undefined); this._forceChildXf = !this._forceChildXf; }), - 700 + 900 ); }} style={{ @@ -490,6 +496,9 @@ export class CollectionCardView extends CollectionSubView() { ); }); }; + + + render() { return ( <div diff --git a/src/client/views/pdf/GPTPopup/GPTPopup.tsx b/src/client/views/pdf/GPTPopup/GPTPopup.tsx index cb5aad32d..c0f17ba4e 100644 --- a/src/client/views/pdf/GPTPopup/GPTPopup.tsx +++ b/src/client/views/pdf/GPTPopup/GPTPopup.tsx @@ -317,21 +317,13 @@ export class GPTPopup extends ObservableReactComponent<GPTPopupProps> { sortBox = () => ( <> <div> - {this.heading('SORTING')} - {this.loading ? ( - <div className="content-wrapper"> - <div className="loading-spinner"> - <ReactLoading type="spin" color={StrCast(Doc.UserDoc().userVariantColor)} height={30} width={30} /> - <span>Loading...</span> - </div> - </div> - ) : ( + {this.heading('SORTING')} <> - {!this.cardsDoneLoading ? ( + {!this.cardsDoneLoading || this.loading ? ( <div className="content-wrapper"> <div className="loading-spinner"> <ReactLoading type="spin" color={StrCast(Doc.UserDoc().userVariantColor)} height={30} width={30} /> - <span>Reading Cards...</span> + {this.loading ? <span>Loading...</span> : <span>Reading Cards...</span>} </div> </div> ) : ( @@ -344,10 +336,10 @@ export class GPTPopup extends ObservableReactComponent<GPTPopupProps> { color={StrCast(Doc.UserDoc().userVariantColor)} type={Type.TERT} style={{ - width: '90%', // Almost as wide as the container + width: '90%', textAlign: 'center', - color: '#ffffff', // White text - fontSize: '16px', // Adjust font size as needed + color: '#ffffff', + fontSize: '16px', }} /> </div> @@ -363,7 +355,6 @@ export class GPTPopup extends ObservableReactComponent<GPTPopupProps> { </div> )} </> - )} </div> </> ); |
