Skip to content

Commit f558bf6

Browse files
feat: added VueMastery modal to introduction
1 parent c281bb8 commit f558bf6

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

src/.vuepress/components/common/vuemastery-video-modal.vue

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<template>
22
<div class="overlay" v-show="isOpen">
33
<div ref="modal" class="modal" :class="{ open: isOpen }">
4-
<div class="video-space" style="padding: 56.25% 0 0 0; position: relative;">
4+
<div
5+
class="video-space"
6+
style="padding: 56.25% 0 0 0; position: relative;"
7+
>
58
<iframe
69
src="https://player.vimeo.com/video/455611549?dnt=1"
710
style="height: 100%; left: 0; position: absolute; top: 0; width: 100%; margin: 0"
811
frameborder="0"
912
webkitallowfullscreen
1013
mozallowfullscreen
1114
allowfullscreen
15+
allow="autoplay"
1216
ref="videoIframe"
1317
></iframe>
1418
</div>
@@ -20,14 +24,15 @@
2024
target="_blank"
2125
rel="sponsored noopener"
2226
title="Vue.js Courses on Vue Mastery"
23-
>Vue Mastery</a>.
24-
Watch Vue Mastery’s free
27+
>Vue Mastery</a
28+
>. Watch Vue Mastery’s free
2529
<a
2630
href="https://www.vuemastery.com/courses/intro-to-vue-3/intro-to-vue3"
2731
target="_blank"
2832
rel="sponsored noopener"
2933
title="Vue.js Courses on Vue Mastery"
30-
>Intro to Vue course</a>.
34+
>Intro to Vue course</a
35+
>.
3136
</p>
3237
</div>
3338
</div>
@@ -47,7 +52,7 @@ export default {
4752
}),
4853
4954
methods: {
50-
initVideoModal () {
55+
initVideoModal() {
5156
const modalButton = document.querySelector(this.triggerSelector)
5257
const player = new Vimeo.Player(this.$refs.videoIframe)
5358
@@ -59,7 +64,11 @@ export default {
5964
})
6065
6166
document.body.addEventListener('click', event => {
62-
if (this.isOpen && event.target !== modalButton && !this.$refs.modal.contains(event.target)) {
67+
if (
68+
this.isOpen &&
69+
event.target !== modalButton &&
70+
!this.$refs.modal.contains(event.target)
71+
) {
6372
this.isOpen = false
6473
document.body.classList.remove('stop-scroll')
6574
player.pause()
@@ -68,7 +77,7 @@ export default {
6877
}
6978
},
7079
71-
mounted () {
80+
mounted() {
7281
if (typeof window !== 'undefined') {
7382
this.initVideoModal()
7483
}
@@ -77,7 +86,7 @@ export default {
7786
</script>
7887

7988
<style lang="scss">
80-
@import "@theme/styles/_settings.scss";
89+
@import '@theme/styles/_settings.scss';
8190
8291
.modal {
8392
box-sizing: border-box;

src/guide/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Already know Vue 2 and just want to learn about what's new in Vue 3? Check out t
88

99
Vue (pronounced /vjuː/, like **view**) is a **progressive framework** for building user interfaces. Unlike other monolithic frameworks, Vue is designed from the ground up to be incrementally adoptable. The core library is focused on the view layer only, and is easy to pick up and integrate with other libraries or existing projects. On the other hand, Vue is also perfectly capable of powering sophisticated Single-Page Applications when used in combination with [modern tooling](../guide/single-file-component.html) and [supporting libraries](https://github.com/vuejs/awesome-vue#components--libraries).
1010

11-
If you’d like to learn more about Vue before diving in, we <a id="modal-player" href="#">created a video</a> walking through the core principles and a sample project.
11+
If you’d like to learn more about Vue before diving in, we <a id="modal-player" class="vuemastery-trigger" href="#">created a video</a> walking through the core principles and a sample project.
1212

13-
If you are an experienced frontend developer and want to know how Vue compares to other libraries/frameworks, check out the [Comparison with Other Frameworks](TODO:comparison.html).
13+
<common-vuemastery-video-modal/>
1414

1515
## Getting Started
1616

0 commit comments

Comments
 (0)