Skip to content

Commit

Permalink
add center text positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
54ac committed Feb 13, 2024
1 parent c425a05 commit 44233c1
Show file tree
Hide file tree
Showing 8 changed files with 159 additions and 148 deletions.
284 changes: 142 additions & 142 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"private": true,
"devDependencies": {
"@parcel/config-webextension": "^2.8.3",
"@types/chrome": "^0.0.258",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"@types/chrome": "^0.0.260",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"cpy-cli": "^5.0.0",
"eslint": "^8.41.0",
"eslint-config-prettier": "^9.0.0",
Expand Down
5 changes: 4 additions & 1 deletion src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"message": "Advanced"
},
"headerInfo": {
"message": "You can also access this menu by using the \"advanced\" button in YouTube's subtitle options menu in the player, unless it is overriden by other addons. Hover over option labels to learn more. Preview below is approximate."
"message": "You can also access this menu by clicking the \"advanced\" button in YouTube's subtitle options menu in the player, unless it is overriden by other addons. Hover over option labels to learn more. The preview below is an approximation."
},
"previewText": {
"message": "The subtitles will look more or less like this."
Expand Down Expand Up @@ -98,6 +98,9 @@
"effectTextPositionTop": {
"message": "Top"
},
"effectTextPositionCenter": {
"message": "Center"
},
"effectTextPositionBottom": {
"message": "Bottom"
},
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/pl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
"effectTextPositionTop": {
"message": "Góra"
},
"effectTextPositionCenter": {
"message": "Środek"
},
"effectTextPositionBottom": {
"message": "Dół"
},
Expand Down
4 changes: 4 additions & 0 deletions src/components/calculateStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ const calculateStyles = async () => {
captionWindowStyles.push(
`top: 2% !important; bottom: unset !important; height: min-content !important;`
);
else if (options.effectTextPosition === "center")
captionWindowStyles.push(
`top: 50% !important; bottom: unset !important; height: min-content !important;`
);
else if (options.effectTextPosition === "bottom")
captionWindowStyles.push(
`bottom: 2% !important; top: unset !important; height: min-content !important;`
Expand Down
2 changes: 1 addition & 1 deletion src/manifest-chrome.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Better YouTube Subtitles",
"version": "1.1.6",
"version": "1.1.7",
"description": "__MSG_extText__",
"manifest_version": 3,
"default_locale": "en",
Expand Down
2 changes: 1 addition & 1 deletion src/manifest-firefox.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Better YouTube Subtitles",
"version": "1.1.6",
"version": "1.1.7",
"description": "__MSG_extText__",
"manifest_version": 2,
"default_locale": "en",
Expand Down
1 change: 1 addition & 0 deletions src/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ <h3>Better YouTube Subtitles <span id="version" /></h3>
<select class="option" id="effectTextPosition">
<option id="effectTextPositionDefault" value="default" />
<option id="effectTextPositionTop" value="top" />
<option id="effectTextPositionCenter" value="center" />
<option id="effectTextPositionBottom" value="bottom" />
</select>
</td>
Expand Down

0 comments on commit 44233c1

Please sign in to comment.