@vocasync/astro 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/cli.js +0 -0
- package/dist/components/AudioPlayer.astro +65 -35
- package/package.json +1 -1
- package/src/components/AudioPlayer.astro +65 -35
package/README.md
CHANGED
|
@@ -11,6 +11,12 @@ Turn your Astro blog posts into narrated audio with word-level synchronization.
|
|
|
11
11
|
- 🌍 **57 Languages** - Global reach with support for 57 languages
|
|
12
12
|
- 🎨 **Fully Themeable** - CSS variables for seamless integration with any design
|
|
13
13
|
|
|
14
|
+
## Demo
|
|
15
|
+
|
|
16
|
+
🔗 **[Live Demo](https://astro-integration-demo.vocasync.io)** — See the audio player and word highlighting in action
|
|
17
|
+
|
|
18
|
+
📂 **[Demo Source Code](https://github.com/sayedhfatimi/vocasync-astro-demo)** — Example implementation for reference
|
|
19
|
+
|
|
14
20
|
## Table of Contents
|
|
15
21
|
|
|
16
22
|
- [Installation](#installation)
|
package/dist/cli.js
CHANGED
|
File without changes
|
|
@@ -110,11 +110,10 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
110
110
|
title="Play/Pause (Space)"
|
|
111
111
|
>
|
|
112
112
|
<svg class="vocasync-icon vocasync-icon--play" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
113
|
-
<path d="
|
|
113
|
+
<path d="M6 4l15 8-15 8V4z"/>
|
|
114
114
|
</svg>
|
|
115
|
-
<svg class="vocasync-icon vocasync-icon--pause" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"
|
|
116
|
-
<
|
|
117
|
-
<rect x="14" y="4" width="4" height="16"/>
|
|
115
|
+
<svg class="vocasync-icon vocasync-icon--pause vocasync-hidden" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
116
|
+
<path d="M6 4h4v16H6V4zm8 0h4v16h-4V4z"/>
|
|
118
117
|
</svg>
|
|
119
118
|
</button>
|
|
120
119
|
|
|
@@ -152,12 +151,15 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
152
151
|
data-highlighting="on"
|
|
153
152
|
title="Toggle highlighting (H)"
|
|
154
153
|
>
|
|
155
|
-
<svg class="vocasync-icon vocasync-icon--highlight-on" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
156
|
-
<path d="
|
|
154
|
+
<svg class="vocasync-icon vocasync-icon--highlight-on" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
155
|
+
<path d="M12 3v18"/>
|
|
156
|
+
<rect x="4" y="8" width="16" height="8" rx="1" fill="currentColor" opacity="0.3"/>
|
|
157
|
+
<path d="M8 12h8"/>
|
|
157
158
|
</svg>
|
|
158
|
-
<svg class="vocasync-icon vocasync-icon--highlight-off" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"
|
|
159
|
-
<path d="
|
|
160
|
-
<
|
|
159
|
+
<svg class="vocasync-icon vocasync-icon--highlight-off vocasync-hidden" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
160
|
+
<path d="M12 3v18" opacity="0.3"/>
|
|
161
|
+
<rect x="4" y="8" width="16" height="8" rx="1" opacity="0.3"/>
|
|
162
|
+
<path d="M4 4l16 16"/>
|
|
161
163
|
</svg>
|
|
162
164
|
</button>
|
|
163
165
|
|
|
@@ -190,11 +192,15 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
190
192
|
data-action="mute"
|
|
191
193
|
title="Toggle mute (M)"
|
|
192
194
|
>
|
|
193
|
-
<svg class="vocasync-icon vocasync-icon--volume-high" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
194
|
-
<
|
|
195
|
+
<svg class="vocasync-icon vocasync-icon--volume-high" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
196
|
+
<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" fill="currentColor"/>
|
|
197
|
+
<path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>
|
|
198
|
+
<path d="M19.07 4.93a10 10 0 0 1 0 14.14"/>
|
|
195
199
|
</svg>
|
|
196
|
-
<svg class="vocasync-icon vocasync-icon--volume-mute" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"
|
|
197
|
-
<
|
|
200
|
+
<svg class="vocasync-icon vocasync-icon--volume-mute vocasync-hidden" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
201
|
+
<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" fill="currentColor" opacity="0.5"/>
|
|
202
|
+
<line x1="23" y1="9" x2="17" y2="15"/>
|
|
203
|
+
<line x1="17" y1="9" x2="23" y2="15"/>
|
|
198
204
|
</svg>
|
|
199
205
|
</button>
|
|
200
206
|
<input
|
|
@@ -207,16 +213,23 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
207
213
|
data-action="volume"
|
|
208
214
|
/>
|
|
209
215
|
</div>
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
<!-- Mini player (floating) -->
|
|
220
|
+
{enableMiniPlayer && (
|
|
221
|
+
<div class="vocasync-mini-player" data-mini-player hidden>
|
|
222
|
+
<button
|
|
223
|
+
type="button"
|
|
210
224
|
class="vocasync-mini-player__play-btn"
|
|
211
225
|
aria-label="Play"
|
|
212
226
|
data-action="play-pause"
|
|
213
227
|
>
|
|
214
228
|
<svg class="vocasync-icon vocasync-icon--play" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
215
|
-
<path d="
|
|
229
|
+
<path d="M6 4l15 8-15 8V4z"/>
|
|
216
230
|
</svg>
|
|
217
|
-
<svg class="vocasync-icon vocasync-icon--pause" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"
|
|
218
|
-
<
|
|
219
|
-
<rect x="14" y="4" width="4" height="16"/>
|
|
231
|
+
<svg class="vocasync-icon vocasync-icon--pause vocasync-hidden" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
232
|
+
<path d="M6 4h4v16H6V4zm8 0h4v16h-4V4z"/>
|
|
220
233
|
</svg>
|
|
221
234
|
</button>
|
|
222
235
|
<div class="vocasync-mini-player__progress">
|
|
@@ -234,7 +247,8 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
234
247
|
</svg>
|
|
235
248
|
</button>
|
|
236
249
|
</div>
|
|
237
|
-
)}
|
|
250
|
+
)}
|
|
251
|
+
</div>
|
|
238
252
|
|
|
239
253
|
<style>
|
|
240
254
|
/* ========================================
|
|
@@ -324,6 +338,10 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
324
338
|
height: 1.25rem;
|
|
325
339
|
}
|
|
326
340
|
|
|
341
|
+
.vocasync-hidden {
|
|
342
|
+
display: none !important;
|
|
343
|
+
}
|
|
344
|
+
|
|
327
345
|
/* Progress section */
|
|
328
346
|
.vocasync-player__progress-section {
|
|
329
347
|
display: flex;
|
|
@@ -465,6 +483,10 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
465
483
|
z-index: 10;
|
|
466
484
|
}
|
|
467
485
|
|
|
486
|
+
.vocasync-player__speed-menu[hidden] {
|
|
487
|
+
display: none !important;
|
|
488
|
+
}
|
|
489
|
+
|
|
468
490
|
.vocasync-player__speed-menu button {
|
|
469
491
|
padding: 0.375rem 0.75rem;
|
|
470
492
|
font-size: 0.75rem;
|
|
@@ -681,32 +703,40 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
681
703
|
|
|
682
704
|
// Update play/pause button icon
|
|
683
705
|
function updatePlayButton(playing) {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
pauseIcon
|
|
706
|
+
// Update main player play button
|
|
707
|
+
if (playBtn) {
|
|
708
|
+
const playIcon = playBtn.querySelector('.vocasync-icon--play');
|
|
709
|
+
const pauseIcon = playBtn.querySelector('.vocasync-icon--pause');
|
|
710
|
+
if (playIcon && pauseIcon) {
|
|
711
|
+
playIcon.classList.toggle('vocasync-hidden', playing);
|
|
712
|
+
pauseIcon.classList.toggle('vocasync-hidden', !playing);
|
|
713
|
+
}
|
|
689
714
|
playBtn.setAttribute('aria-label', playing ? 'Pause' : 'Play');
|
|
690
715
|
}
|
|
691
716
|
|
|
692
717
|
// Update mini player too
|
|
693
718
|
if (miniPlayer) {
|
|
694
|
-
const
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
miniPauseIcon
|
|
719
|
+
const miniPlayBtn = miniPlayer.querySelector('[data-action="play-pause"]');
|
|
720
|
+
if (miniPlayBtn) {
|
|
721
|
+
const miniPlayIcon = miniPlayBtn.querySelector('.vocasync-icon--play');
|
|
722
|
+
const miniPauseIcon = miniPlayBtn.querySelector('.vocasync-icon--pause');
|
|
723
|
+
if (miniPlayIcon && miniPauseIcon) {
|
|
724
|
+
miniPlayIcon.classList.toggle('vocasync-hidden', playing);
|
|
725
|
+
miniPauseIcon.classList.toggle('vocasync-hidden', !playing);
|
|
726
|
+
}
|
|
699
727
|
}
|
|
700
728
|
}
|
|
701
729
|
}
|
|
702
730
|
|
|
703
731
|
// Update volume icon
|
|
704
732
|
function updateVolumeIcon(muted) {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
highIcon
|
|
709
|
-
|
|
733
|
+
if (muteBtn) {
|
|
734
|
+
const highIcon = muteBtn.querySelector('.vocasync-icon--volume-high');
|
|
735
|
+
const muteIcon = muteBtn.querySelector('.vocasync-icon--volume-mute');
|
|
736
|
+
if (highIcon && muteIcon) {
|
|
737
|
+
highIcon.classList.toggle('vocasync-hidden', muted);
|
|
738
|
+
muteIcon.classList.toggle('vocasync-hidden', !muted);
|
|
739
|
+
}
|
|
710
740
|
}
|
|
711
741
|
}
|
|
712
742
|
|
|
@@ -716,8 +746,8 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
716
746
|
const onIcon = highlightBtn.querySelector('.vocasync-icon--highlight-on');
|
|
717
747
|
const offIcon = highlightBtn.querySelector('.vocasync-icon--highlight-off');
|
|
718
748
|
if (onIcon && offIcon) {
|
|
719
|
-
onIcon.hidden
|
|
720
|
-
offIcon.hidden
|
|
749
|
+
onIcon.classList.toggle('vocasync-hidden', !highlightingEnabled);
|
|
750
|
+
offIcon.classList.toggle('vocasync-hidden', highlightingEnabled);
|
|
721
751
|
}
|
|
722
752
|
highlightBtn.setAttribute('data-highlighting', highlightingEnabled ? 'on' : 'off');
|
|
723
753
|
highlightBtn.setAttribute('aria-label', highlightingEnabled ? 'Disable word highlighting' : 'Enable word highlighting');
|
package/package.json
CHANGED
|
@@ -110,11 +110,10 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
110
110
|
title="Play/Pause (Space)"
|
|
111
111
|
>
|
|
112
112
|
<svg class="vocasync-icon vocasync-icon--play" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
113
|
-
<path d="
|
|
113
|
+
<path d="M6 4l15 8-15 8V4z"/>
|
|
114
114
|
</svg>
|
|
115
|
-
<svg class="vocasync-icon vocasync-icon--pause" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"
|
|
116
|
-
<
|
|
117
|
-
<rect x="14" y="4" width="4" height="16"/>
|
|
115
|
+
<svg class="vocasync-icon vocasync-icon--pause vocasync-hidden" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
116
|
+
<path d="M6 4h4v16H6V4zm8 0h4v16h-4V4z"/>
|
|
118
117
|
</svg>
|
|
119
118
|
</button>
|
|
120
119
|
|
|
@@ -152,12 +151,15 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
152
151
|
data-highlighting="on"
|
|
153
152
|
title="Toggle highlighting (H)"
|
|
154
153
|
>
|
|
155
|
-
<svg class="vocasync-icon vocasync-icon--highlight-on" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
156
|
-
<path d="
|
|
154
|
+
<svg class="vocasync-icon vocasync-icon--highlight-on" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
155
|
+
<path d="M12 3v18"/>
|
|
156
|
+
<rect x="4" y="8" width="16" height="8" rx="1" fill="currentColor" opacity="0.3"/>
|
|
157
|
+
<path d="M8 12h8"/>
|
|
157
158
|
</svg>
|
|
158
|
-
<svg class="vocasync-icon vocasync-icon--highlight-off" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"
|
|
159
|
-
<path d="
|
|
160
|
-
<
|
|
159
|
+
<svg class="vocasync-icon vocasync-icon--highlight-off vocasync-hidden" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
160
|
+
<path d="M12 3v18" opacity="0.3"/>
|
|
161
|
+
<rect x="4" y="8" width="16" height="8" rx="1" opacity="0.3"/>
|
|
162
|
+
<path d="M4 4l16 16"/>
|
|
161
163
|
</svg>
|
|
162
164
|
</button>
|
|
163
165
|
|
|
@@ -190,11 +192,15 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
190
192
|
data-action="mute"
|
|
191
193
|
title="Toggle mute (M)"
|
|
192
194
|
>
|
|
193
|
-
<svg class="vocasync-icon vocasync-icon--volume-high" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
194
|
-
<
|
|
195
|
+
<svg class="vocasync-icon vocasync-icon--volume-high" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
196
|
+
<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" fill="currentColor"/>
|
|
197
|
+
<path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>
|
|
198
|
+
<path d="M19.07 4.93a10 10 0 0 1 0 14.14"/>
|
|
195
199
|
</svg>
|
|
196
|
-
<svg class="vocasync-icon vocasync-icon--volume-mute" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"
|
|
197
|
-
<
|
|
200
|
+
<svg class="vocasync-icon vocasync-icon--volume-mute vocasync-hidden" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
201
|
+
<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" fill="currentColor" opacity="0.5"/>
|
|
202
|
+
<line x1="23" y1="9" x2="17" y2="15"/>
|
|
203
|
+
<line x1="17" y1="9" x2="23" y2="15"/>
|
|
198
204
|
</svg>
|
|
199
205
|
</button>
|
|
200
206
|
<input
|
|
@@ -207,16 +213,23 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
207
213
|
data-action="volume"
|
|
208
214
|
/>
|
|
209
215
|
</div>
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
<!-- Mini player (floating) -->
|
|
220
|
+
{enableMiniPlayer && (
|
|
221
|
+
<div class="vocasync-mini-player" data-mini-player hidden>
|
|
222
|
+
<button
|
|
223
|
+
type="button"
|
|
210
224
|
class="vocasync-mini-player__play-btn"
|
|
211
225
|
aria-label="Play"
|
|
212
226
|
data-action="play-pause"
|
|
213
227
|
>
|
|
214
228
|
<svg class="vocasync-icon vocasync-icon--play" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
215
|
-
<path d="
|
|
229
|
+
<path d="M6 4l15 8-15 8V4z"/>
|
|
216
230
|
</svg>
|
|
217
|
-
<svg class="vocasync-icon vocasync-icon--pause" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"
|
|
218
|
-
<
|
|
219
|
-
<rect x="14" y="4" width="4" height="16"/>
|
|
231
|
+
<svg class="vocasync-icon vocasync-icon--pause vocasync-hidden" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
232
|
+
<path d="M6 4h4v16H6V4zm8 0h4v16h-4V4z"/>
|
|
220
233
|
</svg>
|
|
221
234
|
</button>
|
|
222
235
|
<div class="vocasync-mini-player__progress">
|
|
@@ -234,7 +247,8 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
234
247
|
</svg>
|
|
235
248
|
</button>
|
|
236
249
|
</div>
|
|
237
|
-
)}
|
|
250
|
+
)}
|
|
251
|
+
</div>
|
|
238
252
|
|
|
239
253
|
<style>
|
|
240
254
|
/* ========================================
|
|
@@ -324,6 +338,10 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
324
338
|
height: 1.25rem;
|
|
325
339
|
}
|
|
326
340
|
|
|
341
|
+
.vocasync-hidden {
|
|
342
|
+
display: none !important;
|
|
343
|
+
}
|
|
344
|
+
|
|
327
345
|
/* Progress section */
|
|
328
346
|
.vocasync-player__progress-section {
|
|
329
347
|
display: flex;
|
|
@@ -465,6 +483,10 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
465
483
|
z-index: 10;
|
|
466
484
|
}
|
|
467
485
|
|
|
486
|
+
.vocasync-player__speed-menu[hidden] {
|
|
487
|
+
display: none !important;
|
|
488
|
+
}
|
|
489
|
+
|
|
468
490
|
.vocasync-player__speed-menu button {
|
|
469
491
|
padding: 0.375rem 0.75rem;
|
|
470
492
|
font-size: 0.75rem;
|
|
@@ -681,32 +703,40 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
681
703
|
|
|
682
704
|
// Update play/pause button icon
|
|
683
705
|
function updatePlayButton(playing) {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
pauseIcon
|
|
706
|
+
// Update main player play button
|
|
707
|
+
if (playBtn) {
|
|
708
|
+
const playIcon = playBtn.querySelector('.vocasync-icon--play');
|
|
709
|
+
const pauseIcon = playBtn.querySelector('.vocasync-icon--pause');
|
|
710
|
+
if (playIcon && pauseIcon) {
|
|
711
|
+
playIcon.classList.toggle('vocasync-hidden', playing);
|
|
712
|
+
pauseIcon.classList.toggle('vocasync-hidden', !playing);
|
|
713
|
+
}
|
|
689
714
|
playBtn.setAttribute('aria-label', playing ? 'Pause' : 'Play');
|
|
690
715
|
}
|
|
691
716
|
|
|
692
717
|
// Update mini player too
|
|
693
718
|
if (miniPlayer) {
|
|
694
|
-
const
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
miniPauseIcon
|
|
719
|
+
const miniPlayBtn = miniPlayer.querySelector('[data-action="play-pause"]');
|
|
720
|
+
if (miniPlayBtn) {
|
|
721
|
+
const miniPlayIcon = miniPlayBtn.querySelector('.vocasync-icon--play');
|
|
722
|
+
const miniPauseIcon = miniPlayBtn.querySelector('.vocasync-icon--pause');
|
|
723
|
+
if (miniPlayIcon && miniPauseIcon) {
|
|
724
|
+
miniPlayIcon.classList.toggle('vocasync-hidden', playing);
|
|
725
|
+
miniPauseIcon.classList.toggle('vocasync-hidden', !playing);
|
|
726
|
+
}
|
|
699
727
|
}
|
|
700
728
|
}
|
|
701
729
|
}
|
|
702
730
|
|
|
703
731
|
// Update volume icon
|
|
704
732
|
function updateVolumeIcon(muted) {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
highIcon
|
|
709
|
-
|
|
733
|
+
if (muteBtn) {
|
|
734
|
+
const highIcon = muteBtn.querySelector('.vocasync-icon--volume-high');
|
|
735
|
+
const muteIcon = muteBtn.querySelector('.vocasync-icon--volume-mute');
|
|
736
|
+
if (highIcon && muteIcon) {
|
|
737
|
+
highIcon.classList.toggle('vocasync-hidden', muted);
|
|
738
|
+
muteIcon.classList.toggle('vocasync-hidden', !muted);
|
|
739
|
+
}
|
|
710
740
|
}
|
|
711
741
|
}
|
|
712
742
|
|
|
@@ -716,8 +746,8 @@ const audioDataJson = audioEntry ? JSON.stringify({
|
|
|
716
746
|
const onIcon = highlightBtn.querySelector('.vocasync-icon--highlight-on');
|
|
717
747
|
const offIcon = highlightBtn.querySelector('.vocasync-icon--highlight-off');
|
|
718
748
|
if (onIcon && offIcon) {
|
|
719
|
-
onIcon.hidden
|
|
720
|
-
offIcon.hidden
|
|
749
|
+
onIcon.classList.toggle('vocasync-hidden', !highlightingEnabled);
|
|
750
|
+
offIcon.classList.toggle('vocasync-hidden', highlightingEnabled);
|
|
721
751
|
}
|
|
722
752
|
highlightBtn.setAttribute('data-highlighting', highlightingEnabled ? 'on' : 'off');
|
|
723
753
|
highlightBtn.setAttribute('aria-label', highlightingEnabled ? 'Disable word highlighting' : 'Enable word highlighting');
|