From ab106cd65570a8fb5c0ed41562c77ab8072bfb08 Mon Sep 17 00:00:00 2001
From: 8man <99420590+himanshu8443@users.noreply.github.com>
Date: Thu, 8 Jun 2023 09:41:33 +0530
Subject: Added Subtitle Customizations (#20)
* Added Subtitle Customisations
* New Subtitle Customizations
* Settings icons
* new icons
* New icons
* Updated icons
---
lib/Artplayer.js | 71 ++++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 61 insertions(+), 10 deletions(-)
(limited to 'lib')
diff --git a/lib/Artplayer.js b/lib/Artplayer.js
index 872ceea..705bbfe 100644
--- a/lib/Artplayer.js
+++ b/lib/Artplayer.js
@@ -66,12 +66,14 @@ export default function Player({
],
settings: [
provider === "zoro" && {
- html: "Subtitle",
+ html: 'Subtitle',
+ icon: '',
width: 300,
- tooltip: "English",
+ tooltip: "Settings",
selector: [
{
- html: "Display",
+ html: 'Display',
+ icon: '',
tooltip: "Show",
switch: true,
onSwitch: function (item) {
@@ -81,7 +83,8 @@ export default function Player({
},
},
{
- html: "Font Size",
+ html: 'Font Size',
+ icon: '',
selector: subSize,
onSelect: function (item) {
if (item.html === "Small") {
@@ -114,14 +117,62 @@ export default function Player({
}
},
},
+ {
+ html: 'Language',
+ icon:'',
+ tooltip: "English",
+ selector: [
...subtitles,
+ ],
+ onSelect: function (item) {
+ art.subtitle.switch(item.url, {
+ name: item.html,
+ });
+ return item.html;
+ },
+ },
+ {
+ html: "Font Family",
+ tooltip: localStorage.getItem("font") ? localStorage.getItem("font") : "Arial",
+ selector: [{ html: "Arial"},
+ { html: "Comic Sans MS"},
+ { html: "Verdana"},
+ { html: "Tahoma"},
+ { html: "Trebuchet MS"},
+ { html: "Times New Roman",},
+ { html: "Georgia"},
+ { html: "Impact "},
+ { html: "Andalé Mono"},
+ { html: "Palatino"},
+ { html: "Baskerville"},
+ { html: "Garamond"},
+ { html: "Courier New"},
+ { html: "Brush Script MT"}],
+ onSelect: function (item) {
+ art.subtitle.style({ fontFamily: item.html });
+ localStorage.setItem("font", item.html);
+ return item.html;
+ }
+ },
+ {
+ html: "Font Shadow",
+ tooltip: localStorage.getItem("subShadow") ? JSON.parse(localStorage.getItem("subShadow")).shadow : "Default",
+ selector: [
+ { html: 'None', value: 'none' },
+ { html: 'Uniform', value: '2px 2px 0px #000, -2px -2px 0px #000, 2px -2px 0px #000, -2px 2px 0px #000' },
+ { html: 'Raised', value: '-1px 2px 3px rgba(0, 0, 0, 1)' },
+ { html: 'Depressed', value: '-2px -3px 3px rgba(0, 0, 0, 1)' },
+ { html: 'Glow', value: '0 0 10px rgba(0, 0, 0, 0.8)' },
+ { html: 'Block', value: '-3px 3px 4px rgba(0, 0, 0, 1),2px 2px 4px rgba(0, 0, 0, 1),1px -1px 3px rgba(0, 0, 0, 1),-3px -2px 4px rgba(0, 0, 0, 1)' }
+ ],
+ onSelect: function (item) {
+ art.subtitle.style({ textShadow: item.value });
+ localStorage.setItem("subShadow", JSON.stringify({shadow:item.html, value:item.value}));
+ return item.html;
+ }
+ }
],
- onSelect: function (item) {
- art.subtitle.switch(item.url, {
- name: item.html,
- });
- return item.html;
- },
+
},
provider === "gogoanime" && {
html: "Quality",
--
cgit v1.2.3