mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-05-19 16:31:52 +02:00
feat(shortcode): support bilibili
This commit is contained in:
parent
c6c2689195
commit
66c8634a09
4 changed files with 45 additions and 0 deletions
|
@ -14,6 +14,25 @@ body.zen-mode-enable {
|
|||
}
|
||||
}
|
||||
|
||||
.bilibili {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.bilibili::after {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-bottom: calc(100% / (16 / 9));
|
||||
}
|
||||
.bilibili > iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
|
||||
/*! tailwindcss v3.4.4 | MIT License | https://tailwindcss.com */
|
||||
|
||||
/*
|
||||
|
|
18
assets/css/components/bilibili.css
Normal file
18
assets/css/components/bilibili.css
Normal file
|
@ -0,0 +1,18 @@
|
|||
.bilibili {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.bilibili::after {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-bottom: calc(100% / (16 / 9));
|
||||
}
|
||||
|
||||
.bilibili > iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border: 0;
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
/*! Blowfish | MIT License | https://github.com/nunocoracao/blowfish */
|
||||
|
||||
@import 'components/zen-mode.css';
|
||||
@import 'components/bilibili.css';
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
|
|
7
layouts/shortcodes/bilibili.html
Normal file
7
layouts/shortcodes/bilibili.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<div class="bilibili">
|
||||
{{- if .IsNamedParams -}}
|
||||
<iframe src="//player.bilibili.com/player.html?bvid={{ .Get `id` }}&page={{ .Get `p` | default 1 }}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
|
||||
{{- else -}}
|
||||
<iframe src="//player.bilibili.com/player.html?bvid={{ .Get 0 }}&page={{ .Get 1 | default 1 }}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
|
||||
{{- end -}}
|
||||
</div>
|
Loading…
Add table
Reference in a new issue