A photo manager for VRChat.

fuck dates

Changed files
-59
src
Components
-59
src/Components/PhotoList.tsx
··· 27 27 28 28 enum ListPopup{ 29 29 FILTERS, 30 - DATE, 31 30 NONE 32 31 } 33 32 ··· 45 44 let photoContainerBG: HTMLCanvasElement; 46 45 47 46 let filterContainer: HTMLDivElement; 48 - let scrollDateContainer: HTMLDivElement; 49 - let dateListContainer: HTMLDivElement; 50 47 51 48 let ctx: CanvasRenderingContext2D; 52 49 let ctxBG: CanvasRenderingContext2D; ··· 63 60 let photoPath: string; 64 61 65 62 let currentPopup = ListPopup.NONE; 66 - let targetScrollPhoto: Photo | null = null; 67 63 68 64 let closeWithKey = ( e: KeyboardEvent ) => { 69 65 if(e.key === 'Escape'){ ··· 86 82 }); 87 83 88 84 break; 89 - case ListPopup.DATE: 90 - anime({ 91 - targets: scrollDateContainer, 92 - opacity: 0, 93 - easing: 'easeInOutQuad', 94 - duration: 100, 95 - complete: () => { 96 - scrollDateContainer.style.display = 'none'; 97 - currentPopup = ListPopup.NONE; 98 - } 99 - }); 100 - 101 - break; 102 85 } 103 86 } 104 87 ··· 223 206 224 207 scroll = scroll + (targetScroll - scroll) * 0.2; 225 208 226 - if(targetScrollPhoto){ 227 - // TODO: Check if previous date. 228 - targetScroll += 100; 229 - } 230 - 231 209 let lastPhoto; 232 210 for (let i = 0; i < photos.length; i++) { 233 211 let p = photos[i]; ··· 270 248 ctx.globalAlpha = 1; 271 249 ctx.fillStyle = '#fff'; 272 250 ctx.font = '30px Rubik'; 273 - 274 - if(targetScrollPhoto && p.dateString === targetScrollPhoto.dateString){ 275 - targetScrollPhoto = null; 276 - } 277 251 278 252 let dateParts = p.dateString.split('-'); 279 253 ctx.fillText(dateParts[2] + ' ' + months[parseInt(dateParts[1]) - 1] + ' ' + dateParts[0], photoContainer.width / 2, 60 + (currentRowIndex + 1.2) * 210 - scroll); ··· 471 445 datesList[date] = 1; 472 446 }); 473 447 474 - dateListContainer.innerHTML = ''; 475 - 476 - Object.keys(datesList).forEach(( date ) => { 477 - dateListContainer.appendChild(<div onClick={() => { 478 - let p = photos.find(x => x.dateString === date)!; 479 - targetScrollPhoto = p; 480 - }} class="date-list-date">{ date }</div> as HTMLElement); 481 - }) 482 - 483 448 render(); 484 449 }) 485 450 } ··· 541 506 <div class="filter-title">Filters</div> 542 507 </div> 543 508 544 - <div ref={scrollDateContainer!} class="filter-container"> 545 - <div class="date-list" ref={dateListContainer!}> 546 - <div class="filter-title">Loading Dates...</div> 547 - </div> 548 - </div> 549 - 550 509 <div class="photo-tree-loading" ref={( el ) => photoTreeLoadingContainer = el}>Scanning Photo Tree...</div> 551 510 552 511 <div class="scroll-to-top" ref={( el ) => scrollToTop = el} onClick={() => targetScroll = 0}> ··· 578 537 <img draggable="false" src="/icon/sliders-solid.svg"></img> 579 538 </div> 580 539 <div class="icon-label">Filters</div> 581 - </div> 582 - <div> 583 - <div onClick={() => { 584 - if(currentPopup != ListPopup.NONE)return closeCurrentPopup(); 585 - currentPopup = ListPopup.DATE; 586 - 587 - scrollDateContainer.style.display = 'block'; 588 - 589 - anime({ 590 - targets: scrollDateContainer, 591 - opacity: 1, 592 - easing: 'easeInOutQuad', 593 - duration: 100 594 - }); 595 - }} class="icon" style={{ width: '20px', height: '5px', padding: '20px' }}> 596 - <img draggable="false" src="/icon/clock-regular.svg"></img> 597 - </div> 598 - <div class="icon-label">Scroll to Date</div> 599 540 </div> 600 541 </div> 601 542