@farberg/reveal-template 1.1.25 → 1.1.27
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 +1 -1
- package/init-reveal.js +3 -1
- package/package.json +1 -1
- package/plugins/reveal-plugin-quick-nav.js +14 -1
package/README.md
CHANGED
package/init-reveal.js
CHANGED
|
@@ -153,7 +153,9 @@ const defaultRevealOptions = {
|
|
|
153
153
|
lineColor: '#5c6971',
|
|
154
154
|
primaryBorderColor: '#5c6971',
|
|
155
155
|
secondaryColor: '#5c6971',
|
|
156
|
-
secondaryTextColor: '#000'
|
|
156
|
+
secondaryTextColor: '#000',
|
|
157
|
+
tertiaryColor: '#e8e8e8',
|
|
158
|
+
loopTextColor: '#4a4a4a'
|
|
157
159
|
},
|
|
158
160
|
sequence: {
|
|
159
161
|
mirrorActors: false,
|
package/package.json
CHANGED
|
@@ -143,6 +143,14 @@ function injectStyles() {
|
|
|
143
143
|
background: #e2001a;
|
|
144
144
|
color: #fff;
|
|
145
145
|
}
|
|
146
|
+
#quick-nav-overlay .quick-nav-item.current-slide {
|
|
147
|
+
border-left: 3px solid #e2001a;
|
|
148
|
+
padding-left: 3px;
|
|
149
|
+
font-weight: bold;
|
|
150
|
+
}
|
|
151
|
+
#quick-nav-overlay .quick-nav-item.active.current-slide {
|
|
152
|
+
border-left-color: #fff;
|
|
153
|
+
}
|
|
146
154
|
#quick-nav-overlay .quick-nav-h1 {
|
|
147
155
|
font-weight: bold;
|
|
148
156
|
font-size: 13px;
|
|
@@ -191,6 +199,7 @@ function buildOverlay(deck) {
|
|
|
191
199
|
let allItems = []
|
|
192
200
|
let filtered = []
|
|
193
201
|
let activeIndex = -1
|
|
202
|
+
let currentIndices = { h: 0, v: 0 }
|
|
194
203
|
|
|
195
204
|
function render() {
|
|
196
205
|
list.innerHTML = ''
|
|
@@ -204,6 +213,7 @@ function buildOverlay(deck) {
|
|
|
204
213
|
const a = document.createElement('a')
|
|
205
214
|
a.className = `quick-nav-item quick-nav-${item.level}`
|
|
206
215
|
if (idx === activeIndex) a.classList.add('active')
|
|
216
|
+
if (item.h === currentIndices.h && item.v === currentIndices.v) a.classList.add('current-slide')
|
|
207
217
|
a.textContent = item.text
|
|
208
218
|
a.href = '#'
|
|
209
219
|
a.addEventListener('click', e => {
|
|
@@ -236,8 +246,11 @@ function buildOverlay(deck) {
|
|
|
236
246
|
allItems = collectHeadings(deck)
|
|
237
247
|
filtered = allItems
|
|
238
248
|
input.value = ''
|
|
239
|
-
|
|
249
|
+
currentIndices = deck.getIndices()
|
|
250
|
+
const currentIdx = filtered.findIndex(i => i.h === currentIndices.h && i.v === currentIndices.v)
|
|
251
|
+
activeIndex = currentIdx >= 0 ? currentIdx : (filtered.length > 0 ? 0 : -1)
|
|
240
252
|
render()
|
|
253
|
+
scrollActiveIntoView()
|
|
241
254
|
overlay.classList.add('visible')
|
|
242
255
|
setTimeout(() => input.focus(), 30)
|
|
243
256
|
}
|