| 
226 | 226 |       vueper-slides.ex--arrows-and-bullets-1.no-shadow(:infinite="false" :slide-ratio="0.25" :bullets="false")  | 
227 | 227 |         vueper-slide(v-for="i in 2" :key="i" :style="'background-color: ' + ['#42b983', '#ff5252'][i % 2]")  | 
228 | 228 |           template(v-slot:content)  | 
229 |  | -            div You can also increase default arrows thickness, just with:  | 
230 |  | -            strong.code .vueperslides__arrow svg {stroke-width: 2;}  | 
 | 229 | +            .vueperslide__content-wrapper  | 
 | 230 | +              div You can also increase default arrows thickness, just with:  | 
 | 231 | +              strong.code .vueperslides__arrow svg {stroke-width: 2;}  | 
231 | 232 |       p.mt-4 If you still want your own arrows icons, you can use the slots #[span.code v-slot:arrow-left] and #[span.code v-slot:arrow-right] as follows.  | 
232 | 233 |     li  | 
233 | 234 |       strong Bullets  | 
 | 
243 | 244 |       v-icon(color="white" x-large) undo  | 
244 | 245 |     template(v-slot:arrow-right)  | 
245 | 246 |       v-icon(color="white" x-large) redo  | 
246 |  | -    vueper-slide(v-for="(slide, i) in slides1" :key="slide.id" :title="slide.title" :content="slide.content" :style="'background-color: ' + colors[(i + 1) % 4]")  | 
 | 247 | +    vueper-slide(  | 
 | 248 | +      v-for="(slide, i) in slides1"  | 
 | 249 | +      :key="slide.id"  | 
 | 250 | +      :title="slide.title"  | 
 | 251 | +      :content="slide.content"  | 
 | 252 | +      :style="'background-color: ' + colors[(i + 1) % 4]")  | 
247 | 253 |   ssh-pre(language="html-vue" label="HTML Vue Template").  | 
248 | 254 |     <vueper-slides :infinite="false" bullets-outside>  | 
249 | 255 |       <template v-slot:arrow-left>  | 
 | 
380 | 386 |       :key="i"  | 
381 | 387 |       :style="'background-color: ' + ['#ff5252', '#42b983'][i % 2]")  | 
382 | 388 |       template(v-slot:content)  | 
383 |  | -        .subtitle-1  | 
384 |  | -          v-icon.mr-2(color="white") check  | 
385 |  | -          | Complex content {{ i.toString() }} with Vue.js  | 
386 |  | -          | {{ 1 === 1 ? 'interpreted' : 'non-interpreted' }} compilable content like  | 
387 |  | -          | components & #[span(v-pre) {{ mustaches }}].  | 
 | 389 | +        .vueperslide__content-wrapper  | 
 | 390 | +          .subtitle-1  | 
 | 391 | +            v-icon.mr-2(color="white") check  | 
 | 392 | +            | Complex content {{ i.toString() }} with Vue.js  | 
 | 393 | +            | {{ 1 === 1 ? 'interpreted' : 'non-interpreted' }} compilable content like  | 
 | 394 | +            | components & #[span(v-pre) {{ mustaches }}].  | 
388 | 395 |   ssh-pre(language="html-vue" label="HTML Vue Template").  | 
389 | 396 |     <vueper-slides>  | 
390 | 397 |       <vueper-slide  | 
 | 
437 | 444 |     slide-content-outside-class="text-center py-4")  | 
438 | 445 |     vueper-slide(v-for="(slide, i) in slides4" :key="i" :style="'background-color: ' + ['#42b983', '#ff5252'][i % 2]")  | 
439 | 446 |       template(v-slot:content)  | 
440 |  | -        v-layout(align-center justify-center)  | 
441 |  | -          v-icon.pr-3(color="white" size="5em") access_time  | 
442 |  | -          .text-left  | 
443 |  | -            .headline {{ slide.title }}  | 
444 |  | -            div {{ slide.content }}  | 
 | 447 | +        .vueperslide__content-wrapper  | 
 | 448 | +          v-layout(align-center justify-center)  | 
 | 449 | +            v-icon.pr-3(color="white" size="5em") access_time  | 
 | 450 | +            .text-left  | 
 | 451 | +              .headline {{ slide.title }}  | 
 | 452 | +              div {{ slide.content }}  | 
445 | 453 | 
 
  | 
446 | 454 |   ssh-pre(language="html-vue" label="HTML Vue Template").  | 
447 | 455 |     <button @click="toggleSlidesTime">Keep updating time</button>  | 
 | 
602 | 610 |     }  | 
603 | 611 | 
 
  | 
604 | 612 |   h3  | 
605 |  | -    a(href="#ex--events") Events  | 
 | 613 | +    a(href="#ex--events") Emitted Events  | 
606 | 614 |     a(name="ex--events")  | 
607 | 615 |   p.  | 
608 | 616 |     This example demonstrates how to use the vueper slides provided events and how to style the current slide.#[br]  | 
609 | 617 |     The events box bellow will log all the events triggered while using the slideshow along with their returned params.#[br]  | 
610 |  | -    Change slide to see new events in the events box bellow.  | 
 | 618 | +    Change slide to see new events in the events box bellow.#[br]  | 
 | 619 | +    Read more about the emitted events in the #[a(href="#events") emitted events section].  | 
611 | 620 |   vueper-slides.ex--events(  | 
612 | 621 |     @ready="logEvents('ready', $event)"  | 
 | 622 | +    @previous="logEvents('previous', $event)"  | 
 | 623 | +    @next="logEvents('next', $event)"  | 
613 | 624 |     @before-slide="logEvents('before-slide', $event)"  | 
614 | 625 |     @slide="logEvents('slide', $event)"  | 
615 | 626 |     :slide-ratio="0.2"  | 
 | 
621 | 632 |       :style="'background-color: ' + ['#ff5252', '#42b983'][i % 2]")  | 
622 | 633 | 
 
  | 
623 | 634 |   pre.ssh-pre.events-box(data-label="Event box" style="min-height: 120px")  | 
624 |  | -    div.grey--text(v-if="events")  | 
625 |  | -      strong // event-name:  | 
626 |  | -      span.ml-2 params  | 
627 |  | -    div(v-html="events")  | 
 | 635 | +    v-layout.justify-space-between  | 
 | 636 | +      div.grey--text(v-if="logs")  | 
 | 637 | +        strong // event-name:  | 
 | 638 | +        span.ml-2 params  | 
 | 639 | +      v-btn(color="primary" x-small outlined @click="logs = []")  | 
 | 640 | +        v-icon.mr-1(small) close  | 
 | 641 | +        | Clear logs  | 
 | 642 | +    div(v-for="(log, i) in logs")  | 
 | 643 | +      strong.mr-2 {{ log.eventName }}:  | 
 | 644 | +      | {{ JSON.stringify(log.params) }}  | 
628 | 645 |     div.mt-2 Listening...  | 
629 | 646 |   ssh-pre(language="html-vue" label="HTML Vue Template").  | 
630 | 647 |     <vueper-slides  | 
631 | 648 |       @ready="logEvents('ready', $event)"  | 
 | 649 | +      @previous="logEvents('previous', $event)"  | 
 | 650 | +      @next="logEvents('next', $event)"  | 
632 | 651 |       @before-slide="logEvents('before-slide', $event)"  | 
633 | 652 |       @slide="logEvents('slide', $event)"  | 
634 | 653 |       :slide-ratio="0.2"  | 
 | 
937 | 956 |       <vueper-slide v-for="i in 10" :key="i" :title="i.toString()"></vueper-slide>  | 
938 | 957 |     </vueper-slides>  | 
939 | 958 | 
 
  | 
 | 959 | +  h3  | 
 | 960 | +    a(href="#ex--synced-instances") Sync 2 instances  | 
 | 961 | +    a(name="ex--synced-instances")  | 
 | 962 | +  p.  | 
 | 963 | +    This example demonstrates how to sync 2 Vueper Slides instances.#[br]  | 
 | 964 | +    You can use any navigation controller from both sliders and keep the current slide in sync.  | 
 | 965 | +  vueper-slides.ex--synced-instances(  | 
 | 966 | +    ref="vueperslides1"  | 
 | 967 | +    @slide="$refs.vueperslides2 && $refs.vueperslides2.goToSlide($event.currentSlide.index, { emit: false })"  | 
 | 968 | +    :slide-ratio="1 / 4"  | 
 | 969 | +    :bullets="false")  | 
 | 970 | +    vueper-slide(  | 
 | 971 | +      v-for="i in 8"  | 
 | 972 | +      :key="i"  | 
 | 973 | +      :title="i.toString()"  | 
 | 974 | +      content="Navigation in sync"  | 
 | 975 | +      :style="'background-color: ' + ['#ff5252', '#42b983'][i % 2]")  | 
 | 976 | +  br  | 
 | 977 | +  vueper-slides.ex--synced-instances.no-shadow.ex--synced-instances-2(  | 
 | 978 | +    ref="vueperslides2"  | 
 | 979 | +    :dragging-distance="50"  | 
 | 980 | +    @slide="$refs.vueperslides1 && $refs.vueperslides1.goToSlide($event.currentSlide.index, { emit: false })"  | 
 | 981 | +    :visible-slides="3"  | 
 | 982 | +    fixed-height="120px")  | 
 | 983 | +    vueper-slide(  | 
 | 984 | +      v-for="i in 8"  | 
 | 985 | +      :key="i"  | 
 | 986 | +      @click.native="$refs.vueperslides2 && $refs.vueperslides2.goToSlide(i - 1)")  | 
 | 987 | +      template(v-slot:content)  | 
 | 988 | +        .vueperslide__content-wrapper(:style="'background-color: ' + ['#ff5252', '#42b983'][i % 2]")  | 
 | 989 | +          .vueperslide__title {{ i.toString() }}  | 
 | 990 | + | 
 | 991 | +  ssh-pre(language="html-vue" label="HTML Vue Template").  | 
 | 992 | +    <vueper-slides  | 
 | 993 | +      ref="vueperslides1"  | 
 | 994 | +      @slide="$refs.vueperslides2 && $refs.vueperslides2.goToSlide($event.currentSlide.index, { emit: false })"  | 
 | 995 | +      :slide-ratio="1 / 4"  | 
 | 996 | +      :bullets="false">  | 
 | 997 | +      <vueper-slide  | 
 | 998 | +        v-for="i in 8"  | 
 | 999 | +        :key="i"  | 
 | 1000 | +        :title="i.toString()"  | 
 | 1001 | +        content="Navigation in sync"  | 
 | 1002 | +        :style="'background-color: ' + ['#ff5252', '#42b983'][i % 2]"></vueper-slide>  | 
 | 1003 | +    </vueper-slides>  | 
 | 1004 | + | 
 | 1005 | +    <vueper-slides  | 
 | 1006 | +      ref="vueperslides2"  | 
 | 1007 | +      :slide-ratio="1 / 8"  | 
 | 1008 | +      :dragging-distance="50"  | 
 | 1009 | +      @slide="$refs.vueperslides1 && $refs.vueperslides1.goToSlide($event.currentSlide.index, { emit: false })"  | 
 | 1010 | +      :visible-slides="3"  | 
 | 1011 | +      fixed-height="100px">  | 
 | 1012 | +      <vueper-slide  | 
 | 1013 | +      v-for="i in 8"  | 
 | 1014 | +      :key="i"  | 
 | 1015 | +      @click.native="$refs.vueperslides2 && $refs.vueperslides2.goToSlide(i - 1)">  | 
 | 1016 | +        <template v-slot:content>  | 
 | 1017 | +          <div class="vueperslide__content-wrapper" :style="'background-color: ' + ['#ff5252', '#42b983'][i % 2]">  | 
 | 1018 | +            <div class="vueperslide__title">{{ '\{\{ i.toString() \}\}' }}</div>  | 
 | 1019 | +          </div>  | 
 | 1020 | +        </template>  | 
 | 1021 | +      </vueper-slide>  | 
 | 1022 | +    </vueper-slides>  | 
 | 1023 | + | 
940 | 1024 |   h2  | 
941 | 1025 |     a(href="#vueper-slides--api") #[span.code <vueper-slides>] API  | 
942 | 1026 |     a(name="vueper-slides--api")  | 
 | 
1280 | 1364 |       p See this setting live in the #[a(href="#ex--3d-rotation") 3D Rotation] example.  | 
1281 | 1365 | 
 
  | 
1282 | 1366 |   h3  | 
1283 |  | -    a(href="#events") Events  | 
 | 1367 | +    a(href="#events") Emitted Events  | 
1284 | 1368 |     a(name="events")  | 
1285 | 1369 |   p.  | 
1286 | 1370 |     Here is the list of all the available events. To see them in action you can check  | 
 | 
1292 | 1376 |       p.  | 
1293 | 1377 |         Fired right after the initialization of the slideshow is complete.#[br]  | 
1294 | 1378 |         No parameter available.  | 
 | 1379 | +    li  | 
 | 1380 | +      h4  | 
 | 1381 | +        code previous  | 
 | 1382 | +      p.  | 
 | 1383 | +        Fired when going to previous slide either from user drag or from slideshow arrows or from keyboard arrows.#[br]  | 
 | 1384 | +        Happens before the `before-slide` event.#[br]  | 
 | 1385 | +        This event returns an object containing:  | 
 | 1386 | +      ul  | 
 | 1387 | +        li.  | 
 | 1388 | +          #[span.code currentSlide]: object containing the slide index, title, content, image & link of  | 
 | 1389 | +          the new current slide.  | 
 | 1390 | +    li  | 
 | 1391 | +      h4  | 
 | 1392 | +        code next  | 
 | 1393 | +      p.  | 
 | 1394 | +        Fired when going to next slide either from user drag or from slideshow arrows or from keyboard arrows.#[br]  | 
 | 1395 | +        Happens before the `before-slide` event.#[br]  | 
 | 1396 | +        This event returns an object containing:  | 
 | 1397 | +      ul  | 
 | 1398 | +        li.  | 
 | 1399 | +          #[span.code currentSlide]: object containing the slide index, title, content, image & link of  | 
 | 1400 | +          the new current slide.  | 
1295 | 1401 |     li  | 
1296 | 1402 |       h4  | 
1297 | 1403 |         code before-slide  | 
 | 
1300 | 1406 |         This event returns an object containing:  | 
1301 | 1407 |       ul  | 
1302 | 1408 |         li.  | 
1303 |  | -          a #[span.code currentSlide] object containing the slide index, title & content  | 
 | 1409 | +          #[span.code currentSlide]: object containing the slide index, title, content, image & link  | 
1304 | 1410 |           of the current slide.  | 
1305 | 1411 |         li.  | 
1306 |  | -          a #[span.code nextSlide] object containing the slide index, title & content  | 
 | 1412 | +          #[span.code nextSlide]: object containing the slide index, title, content, image & link  | 
1307 | 1413 |           of the next slide.  | 
1308 | 1414 |     li  | 
1309 | 1415 |       h4  | 
 | 
1313 | 1419 |         This event returns an object containing:  | 
1314 | 1420 |       ul  | 
1315 | 1421 |         li.  | 
1316 |  | -          a #[span.code currentSlide] object containing the slide index, title & content of  | 
 | 1422 | +          #[span.code currentSlide]: object containing the slide index, title, content, image & link of  | 
1317 | 1423 |           the new current slide.  | 
1318 | 1424 |     li  | 
1319 | 1425 |       h4  | 
 | 
1324 | 1430 |         This event returns an object containing:  | 
1325 | 1431 |       ul  | 
1326 | 1432 |         li.  | 
1327 |  | -          a #[span.code currentSlide] object containing the slide index, title & content of  | 
 | 1433 | +          #[span.code currentSlide]: object containing the slide index, title, content, image & link of  | 
1328 | 1434 |           the new current slide.  | 
1329 | 1435 |     li  | 
1330 | 1436 |       h4  | 
 | 
1335 | 1441 |         This event returns an object containing:  | 
1336 | 1442 |       ul  | 
1337 | 1443 |         li.  | 
1338 |  | -          a #[span.code currentSlide] object containing the slide index, title & content of  | 
 | 1444 | +          #[span.code currentSlide]: object containing the slide index, title, content, image & link of  | 
1339 | 1445 |           the new current slide.  | 
1340 | 1446 | 
 
  | 
1341 | 1447 |   h2  | 
 | 
1433 | 1539 |     possible breaking changes.  | 
1434 | 1540 | 
 
  | 
1435 | 1541 |   ul.max-widthed.mt-8  | 
 | 1542 | +    li  | 
 | 1543 | +      strong Version 2.2  | 
 | 1544 | +      ul.mt-0  | 
 | 1545 | +        li  | 
 | 1546 | +          | For more flexibility, the default wrapper #[span.code `.vueperslide__content-wrapper`] has been removed  | 
 | 1547 | +          | when using the slide content slot. Which means your slot content will be directly at the slide root in  | 
 | 1548 | +          | the #[span.code `.vueperslide`] tag.#[br]  | 
 | 1549 | +          | You can still wrap your slot content with the #[span.code `.vueperslide__content-wrapper`] class to  | 
 | 1550 | +          | horizontally and vertically align center:  | 
 | 1551 | +          ssh-pre(language="html-vue" label="HTML Vue Template").  | 
 | 1552 | +            <vueper-slide v-for="i in 8" :key="i">  | 
 | 1553 | +              <template v-slot:content>  | 
 | 1554 | +                <div class="vueperslide__content-wrapper">  | 
 | 1555 | +                  <div class="vueperslide__title">{{ '\{\{ i.toString() \}\}' }}</div>  | 
 | 1556 | +                </div>  | 
 | 1557 | +              </template>  | 
 | 1558 | +            </vueper-slide>  | 
 | 1559 | +        li Added previous & next emitted events  | 
 | 1560 | +        li Added current numeric index in all the emitted events  | 
 | 1561 | +        li Allow using previous() and next() functions without emitting event (useful for synced slideshows)  | 
 | 1562 | +        li Added a default margin bottom on the slideshow when using fixed height and bullets outside  | 
 | 1563 | + | 
1436 | 1564 |     li  | 
1437 | 1565 |       strong Version 2.0  | 
1438 | 1566 |       highlight(type="warning" no-icon)  | 
1439 | 1567 |         p.mb-2.subtitle-1.  | 
1440 | 1568 |           The v2 features a deep refactoring of the library, with revised logic and multiple improvements, in particular:  | 
1441 | 1569 |         ul.mt-0  | 
1442 |  | -          li New Vue.js 2.6+ slots syntax is now possible!  | 
 | 1570 | +          li Using the new Vue.js 2.6+ slots syntax is now possible!  | 
1443 | 1571 |           li Slides cloning, slides rendering, and more performant & reliable content updating.  | 
1444 | 1572 |           li Autoplay pause & resume - manual slide does not resume if paused.  | 
1445 | 1573 |           li Hide first clone during init - on infinite mode.  | 
@@ -1524,6 +1652,7 @@ export default {  | 
1524 | 1652 |     internalAutoPlaying: true,  | 
1525 | 1653 |     pauseOnHover: true,  | 
1526 | 1654 |     events: '',  | 
 | 1655 | +    logs: [],  | 
1527 | 1656 |     slideshowDisabled: false,  | 
1528 | 1657 |     parallax: 1,  | 
1529 | 1658 |     slidesTimeTimerId: null,  | 
@@ -1613,7 +1742,7 @@ export default {  | 
1613 | 1742 |       setTimeout(() => (this.highlightWhatAreClones = false), 3000)  | 
1614 | 1743 |     },  | 
1615 | 1744 |     logEvents (eventName, params) {  | 
1616 |  | -      this.events += `<strong>${eventName}</strong>: ${JSON.stringify(params)}<br>`  | 
 | 1745 | +      this.logs.push({ eventName, params })  | 
1617 | 1746 |     },  | 
1618 | 1747 |     appendSlide () {  | 
1619 | 1748 |       this.slides3.push({  | 
 | 
0 commit comments