Skip to content

Pickup Video from original repo #558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions themes/vue/layout/icons/github-dark.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<svg aria-labelledby="simpleicons-github-dark-icon" lang role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-github-icon" lang="en">GitHub Dark icon</title><path fill="#7F8C8D" d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>
2 changes: 1 addition & 1 deletion themes/vue/layout/icons/github.ejs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<svg aria-labelledby="simpleicons-github-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-github-icon">GitHub icon</title><path fill="#FFFFFF" d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>
<svg aria-labelledby="simpleicons-github-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-github-icon" lang="en">GitHub icon</title><path fill="#FFFFFF" d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>
2 changes: 1 addition & 1 deletion themes/vue/layout/icons/medium.ejs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<svg aria-labelledby="simpleicons-medium-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-medium-icon">Medium icon</title><path fill="#FFFFFF" d="M2.846 6.36c.03-.295-.083-.586-.303-.784l-2.24-2.7v-.403H7.26l5.378 11.795 4.728-11.795H24v.403l-1.917 1.837c-.165.126-.247.333-.213.538v13.5c-.034.204.048.41.213.537l1.87 1.837v.403h-9.41v-.403l1.937-1.882c.19-.19.19-.246.19-.538V7.794l-5.39 13.688h-.727L4.278 7.794v9.174c-.052.386.076.774.347 1.053l2.52 3.06v.402H0v-.403l2.52-3.06c.27-.278.39-.67.326-1.052V6.36z"/></svg>
<svg aria-labelledby="simpleicons-medium-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-medium-icon" lang="en">Medium icon</title><path fill="#FFFFFF" d="M2.846 6.36c.03-.295-.083-.586-.303-.784l-2.24-2.7v-.403H7.26l5.378 11.795 4.728-11.795H24v.403l-1.917 1.837c-.165.126-.247.333-.213.538v13.5c-.034.204.048.41.213.537l1.87 1.837v.403h-9.41v-.403l1.937-1.882c.19-.19.19-.246.19-.538V7.794l-5.39 13.688h-.727L4.278 7.794v9.174c-.052.386.076.774.347 1.053l2.52 3.06v.402H0v-.403l2.52-3.06c.27-.278.39-.67.326-1.052V6.36z"/></svg>
1 change: 1 addition & 0 deletions themes/vue/layout/icons/play.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<svg aria-labelledby="simpleicons-play-icon" role="img" viewBox="0 0 100 125" fill="#FFFFFF"><title id="simpleicons-play-icon" lang="en">Play icon</title><path d="M50,3.8C24.5,3.8,3.8,24.5,3.8,50S24.5,96.2,50,96.2S96.2,75.5,96.2,50S75.5,3.8,50,3.8z M71.2,53.3l-30.8,18 c-0.6,0.4-1.3,0.5-1.9,0.5c-0.6,0-1.3-0.1-1.9-0.5c-1.2-0.6-1.9-1.9-1.9-3.3V32c0-1.4,0.8-2.7,1.9-3.3c1.2-0.6,2.7-0.6,3.8,0 l30.8,18c1.2,0.6,1.9,1.9,1.9,3.3S72.3,52.7,71.2,53.3z"/></svg>
2 changes: 1 addition & 1 deletion themes/vue/layout/icons/twitter.ejs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<svg aria-labelledby="simpleicons-twitter-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-twitter-icon">Twitter icon</title><path fill="#FFFFFF" d="M23.954 4.569c-.885.389-1.83.654-2.825.775 1.014-.611 1.794-1.574 2.163-2.723-.951.555-2.005.959-3.127 1.184-.896-.959-2.173-1.559-3.591-1.559-2.717 0-4.92 2.203-4.92 4.917 0 .39.045.765.127 1.124C7.691 8.094 4.066 6.13 1.64 3.161c-.427.722-.666 1.561-.666 2.475 0 1.71.87 3.213 2.188 4.096-.807-.026-1.566-.248-2.228-.616v.061c0 2.385 1.693 4.374 3.946 4.827-.413.111-.849.171-1.296.171-.314 0-.615-.03-.916-.086.631 1.953 2.445 3.377 4.604 3.417-1.68 1.319-3.809 2.105-6.102 2.105-.39 0-.779-.023-1.17-.067 2.189 1.394 4.768 2.209 7.557 2.209 9.054 0 13.999-7.496 13.999-13.986 0-.209 0-.42-.015-.63.961-.689 1.8-1.56 2.46-2.548l-.047-.02z"/></svg>
<svg aria-labelledby="simpleicons-twitter-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-twitter-icon" lang="en">Twitter icon</title><path fill="#FFFFFF" d="M23.954 4.569c-.885.389-1.83.654-2.825.775 1.014-.611 1.794-1.574 2.163-2.723-.951.555-2.005.959-3.127 1.184-.896-.959-2.173-1.559-3.591-1.559-2.717 0-4.92 2.203-4.92 4.917 0 .39.045.765.127 1.124C7.691 8.094 4.066 6.13 1.64 3.161c-.427.722-.666 1.561-.666 2.475 0 1.71.87 3.213 2.188 4.096-.807-.026-1.566-.248-2.228-.616v.061c0 2.385 1.693 4.374 3.946 4.827-.413.111-.849.171-1.296.171-.314 0-.615-.03-.916-.086.631 1.953 2.445 3.377 4.604 3.417-1.68 1.319-3.809 2.105-6.102 2.105-.39 0-.779-.023-1.17-.067 2.189 1.394 4.768 2.209 7.557 2.209 9.054 0 13.999-7.496 13.999-13.986 0-.209 0-.42-.015-.63.961-.689 1.8-1.56 2.46-2.548l-.047-.02z"/></svg>
13 changes: 11 additions & 2 deletions themes/vue/layout/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@
The Progressive<br>JavaScript Framework
</h1>
<p>
<a class="button" href="<%- url_for("/v2/guide/") %>">はじめる</a>
<a class="button white" href="https://github.com/vuejs/vue" target="_blank">GITHUB</a>
<a id="modal-player" class="button has-icon" href="javascript:;">
<%- partial('icons/play') %>
なぜ VUE.JS ?</a>
<a class="button white" href="<%- url_for("/v2/guide/") %>">はじめる</a>
<a class="button gray has-icon" href="https://github.com/vuejs/vue" target="_blank">
<%- partial('icons/github-dark') %>
GITHUB</a>
</p>
</div>
</div>
Expand Down Expand Up @@ -78,6 +83,10 @@
Copyright &copy; 2014-<%- new Date().getFullYear() %> Evan You</p>
</div>

<div id="video-modal" class="modal">
<div class="vimeo-space" style="padding: 56.25% 0 0 0; position: relative;"><iframe src="https://player.vimeo.com/video/247494684" style="height: 100%; left: 0; position: absolute; top: 0; width: 100%;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div><script src="https://player.vimeo.com/api/player.js"></script>
</div>

<script>
(function () {
var topScrolled = false
Expand Down
3 changes: 3 additions & 0 deletions themes/vue/layout/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
ga('create', '<%- theme.google_analytics %>', '<%- theme.root_domain %>');
ga('send', 'pageview');
</script>

<!-- vimeo analytics -->
<script type="text/javascript" defer="defer" src="https://extend.vimeocdn.com/ga/72160148.js"></script>
</head>
<body class="<%- isIndex ? '' : 'docs' -%>">
<div id="mobile-bar" <%- isIndex ? 'class="top"' : '' %>>
Expand Down
12 changes: 12 additions & 0 deletions themes/vue/source/css/_common.styl
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,21 @@ a.button
transition: all .15s ease
box-sizing: border-box
border: 1px solid lighten($green, 8%)
&.has-icon
position: relative
text-indent: 1.4em;
> svg
position: absolute
left: 0.4em
top: 0.4em
width: 2em
&.white
background-color: #fff
color: $green
&.gray
background-color: #f6f6f6
color: $light
border-color: #f6f6f6

.highlight
overflow-x: auto
Expand Down
29 changes: 29 additions & 0 deletions themes/vue/source/css/_modal.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.modal
box-sizing: border-box
display: none
position: fixed
width: 80%
height: auto
padding: .5em
background-color: #f9f9f9
box-shadow: 0 0 10px rgba(0,0,0,.2)
z-index: 11
&.open
display: block
top: 50%
left: 50%
transform: translate(-50%, -50%)
.overlay
position: fixed
top: 0
bottom: 0
left: 0
right: 0
background: rgba(0,0,0,.2)
z-index: 10
.stop-scroll
overflow: hidden
height: 100%
@media screen and (max-width: 400px)
.modal
width: 98%
7 changes: 4 additions & 3 deletions themes/vue/source/css/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@import "_header"
@import "_sidebar"
@import "_sponsor"
@import "_modal"

$width = 900px
$space = 40px
Expand Down Expand Up @@ -29,7 +30,7 @@ body
padding: $space 40px 30px
background-color: #fff
.inner
max-width: $width
max-width: $width * 1.4
margin: 0 auto
.left, .right
display: inline-block
Expand Down Expand Up @@ -60,8 +61,8 @@ body
letter-spacing: .1em
min-width: 8em
text-align: center
&:first-child
margin-right: 1em
&:not(:last-child)
margin-right: 1%
.social-buttons
list-style-type: none
padding: 0
Expand Down
32 changes: 32 additions & 0 deletions themes/vue/source/js/common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(function () {
initMobileMenu()
initVideoModal()
if (PAGE_TYPE) {
initVersionSelect()
initSubHeaders()
Expand Down Expand Up @@ -132,6 +133,37 @@
})
}

/**
* Modal Video Player
*/
function initVideoModal () {
if (typeof Vimeo === 'undefined') return

var modalButton = document.getElementById('modal-player')
var videoModal = document.getElementById('video-modal')
var iframe = document.querySelector('iframe');
var player = new Vimeo.Player(iframe);
var overlay = document.createElement('div')
overlay.className = 'overlay'


modalButton.addEventListener('click', function() {
videoModal.classList.toggle('open')
document.body.classList.toggle('stop-scroll')
document.body.appendChild(overlay)
player.play()
})

document.body.addEventListener('click', function(e) {
if (e.target !== modalButton && !videoModal.contains(e.target)) {
videoModal.classList.remove('open')
document.body.classList.remove('stop-scroll')
document.body.removeChild(overlay)
player.unload()
}
})
}

/**
* Doc version select
*/
Expand Down