Skip to content

Commit 156fdca

Browse files
committed
fix: resolve library-3d.js syntax error blocking Cypress and update ci to use npm ci
1 parent 829c17d commit 156fdca

2 files changed

Lines changed: 18 additions & 16 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
sleep 5
9494
9595
- name: Install frontend dependencies
96-
run: npm install
96+
run: npm ci
9797

9898
- name: Start frontend server
9999
run: |

‎frontend/js/library-3d.js‎

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ class BookshelfRenderer3D {
428428
if (!spinnerContainer) {
429429
spinnerContainer = document.createElement('div');
430430
spinnerContainer.id = 'bookshelf-3d-loader';
431-
spinnerContainer.style.cssText = \`
431+
spinnerContainer.style.cssText = `
432432
position: absolute;
433433
top: 0; left: 0; right: 0; bottom: 0;
434434
background: rgba(18, 18, 18, 0.85);
@@ -443,26 +443,26 @@ class BookshelfRenderer3D {
443443
font-family: 'Inter', sans-serif;
444444
transition: opacity 0.5s ease;
445445
border-radius: 12px;
446-
\`;
446+
`;
447447

448448
const spinner = document.createElement('div');
449449
spinner.className = 'loader-spinner';
450-
spinner.style.cssText = \`
450+
spinner.style.cssText = `
451451
width: 60px;
452452
height: 60px;
453453
border: 4px solid rgba(212, 175, 55, 0.2);
454454
border-top: 4px solid #d4af37;
455455
border-radius: 50%;
456456
animation: spin 1s linear infinite;
457457
margin-bottom: 20px;
458-
\`;
458+
`;
459459

460460
if (!document.getElementById('loader-keyframes')) {
461461
const style = document.createElement('style');
462462
style.id = 'loader-keyframes';
463-
style.textContent = \`
463+
style.textContent = `
464464
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
465-
\`;
465+
`;
466466
document.head.appendChild(style);
467467
}
468468

@@ -476,23 +476,23 @@ class BookshelfRenderer3D {
476476
title.style.fontWeight = '500';
477477

478478
const progressContainer = document.createElement('div');
479-
progressContainer.style.cssText = \`
479+
progressContainer.style.cssText = `
480480
width: 250px;
481481
height: 6px;
482482
background: rgba(255,255,255,0.1);
483483
border-radius: 3px;
484484
overflow: hidden;
485485
margin: 0 auto;
486-
\`;
486+
`;
487487

488488
const progressBar = document.createElement('div');
489489
progressBar.id = 'bookshelf-3d-progress-bar';
490-
progressBar.style.cssText = \`
490+
progressBar.style.cssText = `
491491
height: 100%;
492492
width: 0%;
493493
background: linear-gradient(90deg, #d4af37, #f3e5ab);
494494
transition: width 0.3s ease;
495-
\`;
495+
`;
496496

497497
const progressText = document.createElement('div');
498498
progressText.id = 'bookshelf-3d-progress-text';
@@ -522,8 +522,8 @@ class BookshelfRenderer3D {
522522
updateLoadingSpinner(progress) {
523523
const progressBar = document.getElementById('bookshelf-3d-progress-bar');
524524
const progressText = document.getElementById('bookshelf-3d-progress-text');
525-
if (progressBar) progressBar.style.width = \`\${progress}%\`;
526-
if (progressText) progressText.textContent = \`Loading high-res models... \${progress}%\`;
525+
if (progressBar) progressBar.style.width = `${progress}%`;
526+
if (progressText) progressText.textContent = `Loading high-res models... ${progress}%`;
527527
}
528528

529529
hideLoadingSpinner() {
@@ -931,14 +931,14 @@ class BookshelfRenderer3D {
931931
`;
932932

933933
const rating = document.createElement('span');
934-
rating.innerHTML = \`<i class="fa-solid fa-star" style="color: #d4af37;"></i> \${book.rating ? book.rating.toFixed(1) : 'N/A'}\`;
934+
rating.innerHTML = `<i class="fa-solid fa-star" style="color: #d4af37;"></i> ${book.rating ? book.rating.toFixed(1) : 'N/A'}`;
935935
rating.style.color = '#ccc';
936936

937937
metaRow.appendChild(rating);
938938

939939
if (shelfType === 'current' && book.progress > 0) {
940940
const progress = document.createElement('span');
941-
progress.textContent = \`\${book.progress}%\`;
941+
progress.textContent = `${book.progress}%`;
942942
progress.style.color = '#4caf50';
943943
progress.style.fontWeight = 'bold';
944944
metaRow.appendChild(progress);
@@ -954,7 +954,7 @@ class BookshelfRenderer3D {
954954
card.addEventListener('click', () => this.openModal(book));
955955
card.setAttribute('tabindex', '0');
956956
card.setAttribute('role', 'button');
957-
card.setAttribute('aria-label', \`\${book.title} by \${book.author}\`);
957+
card.setAttribute('aria-label', `${book.title} by ${book.author}`);
958958

959959
card.addEventListener('keydown', (e) => {
960960
if (e.key === 'Enter' || e.key === ' ') {
@@ -2440,6 +2440,8 @@ spine.addEventListener('blur', () => this.hideTooltip());
24402440
}
24412441
}
24422442

2443+
}
2444+
24432445
closeModal() {
24442446
if (this.modal) {
24452447
this.modal.classList.remove('active');

0 commit comments

Comments
 (0)