From 116c97df60362879569eaa644286278e70108124 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Sat, 13 Jan 2024 12:53:19 +0800 Subject: [PATCH] [feat] bilibili video #348 --- scripts/tags/lib/audio.js | 2 +- scripts/tags/lib/video.js | 10 +++++++++- source/css/_common/media.styl | 7 +------ source/css/_layout/tag-plugins/media.styl | 11 +++++++++++ 4 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 source/css/_layout/tag-plugins/media.styl diff --git a/scripts/tags/lib/audio.js b/scripts/tags/lib/audio.js index 69db86c..e9fe287 100644 --- a/scripts/tags/lib/audio.js +++ b/scripts/tags/lib/audio.js @@ -14,7 +14,7 @@ module.exports = ctx => function(args) { args.type = 'audio/mp3' } return ` -
+
diff --git a/scripts/tags/lib/video.js b/scripts/tags/lib/video.js index 046567b..48e6e19 100644 --- a/scripts/tags/lib/video.js +++ b/scripts/tags/lib/video.js @@ -9,7 +9,15 @@ 'use strict'; module.exports = ctx => function(args) { - args = ctx.args.map(args, ['type'], ['src']) + args = ctx.args.map(args, ['type', 'bilibili', 'ratio'], ['src']) + if (args.bilibili) { + return ` +
+ +
+ ` + } if (args.type == null) { args.type = 'video/mp4' } diff --git a/source/css/_common/media.styl b/source/css/_common/media.styl index 6e98899..ee366e6 100644 --- a/source/css/_common/media.styl +++ b/source/css/_common/media.styl @@ -1,9 +1,4 @@ audio,video - border-radius: $border-block max-width: 100% video - z-index: 1 - box-shadow: $boxshadow-card-float -.video - line-height: 0 - text-align: center \ No newline at end of file + z-index: 1 \ No newline at end of file diff --git a/source/css/_layout/tag-plugins/media.styl b/source/css/_layout/tag-plugins/media.styl new file mode 100644 index 0000000..d6acae8 --- /dev/null +++ b/source/css/_layout/tag-plugins/media.styl @@ -0,0 +1,11 @@ +.tag-plugin.video + line-height: 0 + text-align: center + video, iframe + border-radius: $border-card + box-shadow: $boxshadow-card-float + z-index 1 + background: var(--block) + width: 100% + height: 100% + margin: 0 \ No newline at end of file