mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 01:21:20 -08:00
remove outline util
This commit is contained in:
1 parent
d05ec2095d
commit
f95384b41a
3 files changed
+4
-21
No files matched your search
@@ -10,7 +10,8 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
text-shadow: 0.5px 0.5px 0.5px rgba(0, 0, 0, 0.5);
|
text-shadow: rgb(0 0 0) 1px 0px 1px, rgb(0 0 0) 0px 1px 1px, rgb(0 0 0) -1px 0px 1px, rgb(0 0 0) 0px -1px 1px,
|
||||||
|
rgb(0 0 0) 1px 1px 1px, rgb(0 0 0) -1px -1px 1px, rgb(0 0 0) 1px -1px 1px, rgb(0 0 0) -1px 1px 1px;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { setStyle, setStyles, srtToVtt, vttToBlob, getExt, assToVtt, escape, errorHandle, outline } from './utils';
|
import { setStyle, setStyles, srtToVtt, vttToBlob, getExt, assToVtt, escape, errorHandle } from './utils';
|
||||||
import Component from './utils/component';
|
import Component from './utils/component';
|
||||||
import validator from 'option-validator';
|
import validator from 'option-validator';
|
||||||
import scheme from './scheme';
|
import scheme from './scheme';
|
||||||
@@ -80,10 +80,7 @@ export default class Subtitle extends Component {
|
|||||||
proxy(this.textTrack, 'cuechange', this.update.bind(this));
|
proxy(this.textTrack, 'cuechange', this.update.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.style({
|
this.style(subtitleOption.style);
|
||||||
'text-shadow': outline(),
|
|
||||||
...subtitleOption.style,
|
|
||||||
});
|
|
||||||
|
|
||||||
errorHandle(window.fetch, 'fetch not support');
|
errorHandle(window.fetch, 'fetch not support');
|
||||||
return fetch(subtitleOption.url)
|
return fetch(subtitleOption.url)
|
||||||
|
|||||||
@@ -80,18 +80,3 @@ export function assToVtt(ass) {
|
|||||||
.filter((line) => line.trim())
|
.filter((line) => line.trim())
|
||||||
.join('\n\n')}`;
|
.join('\n\n')}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function outline(outlineColor = '#000', outlineSize = 1, blurSize = 1) {
|
|
||||||
return [
|
|
||||||
[outlineSize, 0],
|
|
||||||
[0, outlineSize],
|
|
||||||
[-outlineSize, 0],
|
|
||||||
[0, -outlineSize],
|
|
||||||
[outlineSize, outlineSize],
|
|
||||||
[-outlineSize, -outlineSize],
|
|
||||||
[outlineSize, -outlineSize],
|
|
||||||
[-outlineSize, outlineSize],
|
|
||||||
]
|
|
||||||
.map((item) => `${outlineColor} ${item[0]}px ${item[1]}px ${blurSize}px`)
|
|
||||||
.join(',');
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user