From 0a9c09d709ea0328d12b8e0a7dbb306216bbfa4b Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Mon, 30 Mar 2020 16:39:42 +0800 Subject: [PATCH] update --- _config.yml | 6 ++-- scripts/tags/video.js | 17 +++++++++++- source/css/_layout/article.styl | 3 -- source/css/_tag-plugins/video.styl | 44 ++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 source/css/_tag-plugins/video.styl diff --git a/_config.yml b/_config.yml index 3c0e23c..ca06a07 100755 --- a/_config.yml +++ b/_config.yml @@ -1,11 +1,11 @@ ############################### Basic Information ############################### info: name: Volantis - version: '2.3.1' + version: '2.3.2' docs: https://volantis.js.org/ cdn: # To use CDN, write 'use_cdn: true' in 'blog/_config.yml'. - css: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-volantis@2.3.1.2/css/style.css - js: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-volantis@2.3/js/app.js + # css: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-volantis@2.3.1.2/css/style.css + # js: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-volantis@2.3/js/app.js ############################### Style ############################### diff --git a/scripts/tags/video.js b/scripts/tags/video.js index bae4352..92f0c85 100644 --- a/scripts/tags/video.js +++ b/scripts/tags/video.js @@ -2,7 +2,22 @@ function postVideo(args) { let src = args[0].trim() - return ``; + return ``; +} + +function postVideos(args, content) { + args = args.join(' ').split(',') + var cls = args[0] + if (cls.length > 0) { + cls = ' ' + cls + } + var col = Number(args[1]) || 0; + if (col > 0) { + return `
${content}
` + } else { + return `
${content}
` + } } hexo.extend.tag.register('video', postVideo); +hexo.extend.tag.register('videos', postVideos, {ends: true}); diff --git a/source/css/_layout/article.styl b/source/css/_layout/article.styl index d6d266e..b5a68d3 100644 --- a/source/css/_layout/article.styl +++ b/source/css/_layout/article.styl @@ -33,9 +33,6 @@ display: inline margin: auto - video - border-radius: $border-codeblock - h1,h2,h3,h4,h5,h6 &:first-child margin-top: $gap-block diff --git a/source/css/_tag-plugins/video.styl b/source/css/_tag-plugins/video.styl new file mode 100644 index 0000000..17f37c9 --- /dev/null +++ b/source/css/_tag-plugins/video.styl @@ -0,0 +1,44 @@ +$sp = 4px + +video + border-radius: $border-codeblock + max-width: 100% + +div.videos + max-width: "calc(100% + 2 * %s)" % $sp + display: flex + flex-wrap: wrap + justify-content: space-start + align-items: flex-end + margin: $gap-p 0 - $sp + video,iframe + width: 100% + margin: $sp + video + trans() + &:hover + box-shadow: 0 4px 8px 0px rgba(0, 0, 0, 0.24), 0 8px 16px 0px rgba(0, 0, 0, 0.24) + iframe + border-radius: $border-codeblock + width: 100% + min-height: 300px + &.left + justify-content: flex-start + &.center + justify-content: center + &.right + justify-content: flex-end + &.stretch + align-items: stretch + &[col='1'] + video,iframe + width: 100% + &[col='2'] + video,iframe + width: "calc(50% - 2 * %s)" % $sp + &[col='3'] + video,iframe + width: "calc(33.33% - 2 * %s)" % $sp + &[col='4'] + video,iframe + width: "calc(25% - 2 * %s)" % $sp