Compare commits
3 Commits
3d7b50a2e3
...
fe8436179f
Author | SHA1 | Date | |
---|---|---|---|
fe8436179f | |||
adedfec1d0 | |||
b974111eb4 |
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -13,6 +13,7 @@
|
|||||||
"com",
|
"com",
|
||||||
"comms",
|
"comms",
|
||||||
"csui",
|
"csui",
|
||||||
|
"cycleable",
|
||||||
"decycle",
|
"decycle",
|
||||||
"dinked",
|
"dinked",
|
||||||
"dinks",
|
"dinks",
|
||||||
@ -46,6 +47,7 @@
|
|||||||
"reddit",
|
"reddit",
|
||||||
"rescan",
|
"rescan",
|
||||||
"resizer",
|
"resizer",
|
||||||
|
"resizers",
|
||||||
"scrollbar",
|
"scrollbar",
|
||||||
"shitiness",
|
"shitiness",
|
||||||
"smallcaps",
|
"smallcaps",
|
||||||
|
@ -8,5 +8,6 @@ export enum ArVariant {
|
|||||||
export interface Ar {
|
export interface Ar {
|
||||||
type: AspectRatioType,
|
type: AspectRatioType,
|
||||||
ratio?: number,
|
ratio?: number,
|
||||||
variant?: ArVariant
|
variant?: ArVariant,
|
||||||
|
offset?: number,
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="popup-panel">
|
<div class="popup-panel" style="height: 100vh">
|
||||||
<!--
|
<!--
|
||||||
NOTE — the code that makes ultrawidify popup work in firefox regardless of whether the
|
NOTE — the code that makes ultrawidify popup work in firefox regardless of whether the
|
||||||
extension is being displayed in a normal or a small/overflow popup breaks the popup
|
extension is being displayed in a normal or a small/overflow popup breaks the popup
|
||||||
@ -10,6 +10,7 @@
|
|||||||
further than that.
|
further than that.
|
||||||
-->
|
-->
|
||||||
<div v-if="settingsInitialized"
|
<div v-if="settingsInitialized"
|
||||||
|
style="height: 100vh"
|
||||||
class="popup flex flex-col no-overflow"
|
class="popup flex flex-col no-overflow"
|
||||||
:class="{'popup-chrome': ! BrowserDetect?.firefox}"
|
:class="{'popup-chrome': ! BrowserDetect?.firefox}"
|
||||||
>
|
>
|
||||||
@ -78,7 +79,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- CONTENT -->
|
<!-- CONTENT -->
|
||||||
<div class="scrollable" style="flex: 7 7; padding: 1rem;">
|
<div class="scrollable window-content" style="flex: 7 7; padding: 1rem;">
|
||||||
<template v-if="settings && siteSettings">
|
<template v-if="settings && siteSettings">
|
||||||
<PopupVideoSettings
|
<PopupVideoSettings
|
||||||
v-if="selectedTab === 'videoSettings'"
|
v-if="selectedTab === 'videoSettings'"
|
||||||
@ -86,14 +87,6 @@
|
|||||||
:eventBus="eventBus"
|
:eventBus="eventBus"
|
||||||
:siteSettings="siteSettings"
|
:siteSettings="siteSettings"
|
||||||
></PopupVideoSettings>
|
></PopupVideoSettings>
|
||||||
<!-- <PlayerDetectionPanel
|
|
||||||
v-if="selectedTab === 'playerDetection'"
|
|
||||||
:settings="settings"
|
|
||||||
:eventBus="eventBus"
|
|
||||||
:siteSettings="siteSettings"
|
|
||||||
:site="site.host"
|
|
||||||
>
|
|
||||||
</PlayerDetectionPanel> -->
|
|
||||||
<BaseExtensionSettings
|
<BaseExtensionSettings
|
||||||
v-if="selectedTab === 'extensionSettings'"
|
v-if="selectedTab === 'extensionSettings'"
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
@ -610,4 +603,10 @@ pre {
|
|||||||
h1 {
|
h1 {
|
||||||
margin: 0; padding: 0; font-weight: 400; font-size:24px;
|
margin: 0; padding: 0; font-weight: 400; font-size:24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.window-content {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" style="position: relative">
|
<html lang="en" style="position: relative; height: 600px">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Title</title>
|
<title>Title</title>
|
||||||
@ -10,9 +10,9 @@
|
|||||||
<% } %>
|
<% } %>
|
||||||
</head>
|
</head>
|
||||||
<body
|
<body
|
||||||
style="width: 100%; height: 100%; overflow-x: hidden; min-width: 750px"
|
style="width: 100%; height: 100vh; overflow-x: hidden; min-width: 750px;"
|
||||||
>
|
>
|
||||||
<div id="app">
|
<div id="app" style="max-height: 100vh;">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script src="csui-popup.js"></script>
|
<script src="csui-popup.js"></script>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="alignment-box">
|
<div class="alignment-box" :class="{large: large}">
|
||||||
<div
|
<div
|
||||||
class="col top left"
|
class="col top left"
|
||||||
@click="align(VideoAlignment.Left, VideoAlignment.Top)"
|
@click="align(VideoAlignment.Left, VideoAlignment.Top)"
|
||||||
@ -60,10 +60,10 @@
|
|||||||
<script>
|
<script>
|
||||||
import VideoAlignmentType from '../../../common/enums/VideoAlignmentType.enum';
|
import VideoAlignmentType from '../../../common/enums/VideoAlignmentType.enum';
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: [
|
props: [
|
||||||
'eventBus'
|
'eventBus',
|
||||||
|
'large',
|
||||||
],
|
],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -89,6 +89,14 @@ export default {
|
|||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
|
|
||||||
|
&.large {
|
||||||
|
max-width: 15rem;
|
||||||
|
|
||||||
|
.col {
|
||||||
|
width: 4rem;
|
||||||
|
height: 4rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.col {
|
.col {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex flex-row w-full h-full">
|
<div class="flex flex-row w-full h-full">
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col w-full">
|
||||||
|
|
||||||
<!-- TAB ROW -->
|
<!-- TAB ROW -->
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
<li>Keyboard zoom now works</li>
|
<li>Keyboard zoom now works</li>
|
||||||
<li><code>www.youtube-nocookie.com</code> has been added to the "officially supported" list</li>
|
<li><code>www.youtube-nocookie.com</code> has been added to the "officially supported" list</li>
|
||||||
<li>Fixed the bug where UI would sometimes refuse to stay hidden</li>
|
<li>Fixed the bug where UI would sometimes refuse to stay hidden</li>
|
||||||
|
<li>New experimental zoom options</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 1rem; height: 0px;"></div>
|
<div style="width: 1rem; height: 0px;"></div>
|
||||||
|
@ -3,8 +3,12 @@
|
|||||||
|
|
||||||
<ShortcutButton
|
<ShortcutButton
|
||||||
v-for="(command, index) of settings?.active.commands.crop"
|
v-for="(command, index) of settings?.active.commands.crop"
|
||||||
class="flex b3 button"
|
class="flex button"
|
||||||
:class="{active: editMode ? index === editModeOptions?.crop?.selectedIndex : isActiveCrop(command)}"
|
:class="{
|
||||||
|
active: editMode ? index === editModeOptions?.crop?.selectedIndex : isActiveCrop(command),
|
||||||
|
'b3-compact': compact,
|
||||||
|
b3: !compact
|
||||||
|
}"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="command.label"
|
:label="command.label"
|
||||||
:shortcut="getKeyboardShortcutLabel(command)"
|
:shortcut="getKeyboardShortcutLabel(command)"
|
||||||
@ -170,7 +174,8 @@ export default {
|
|||||||
'siteSettings',
|
'siteSettings',
|
||||||
'eventBus',
|
'eventBus',
|
||||||
'isEditing',
|
'isEditing',
|
||||||
'allowSettingSiteDefault'
|
'allowSettingSiteDefault',
|
||||||
|
'compact',
|
||||||
],
|
],
|
||||||
computed: {
|
computed: {
|
||||||
siteDefaultCrop() {
|
siteDefaultCrop() {
|
||||||
|
@ -3,7 +3,10 @@
|
|||||||
<ShortcutButton
|
<ShortcutButton
|
||||||
v-for="(command, index) of settings?.active.commands.stretch"
|
v-for="(command, index) of settings?.active.commands.stretch"
|
||||||
class="b3 button"
|
class="b3 button"
|
||||||
:class="{active: editMode ? index === editModeOptions?.stretch?.selectedIndex : isActiveStretch(command)}"
|
:class="{active: editMode ? index === editModeOptions?.stretch?.selectedIndex : isActiveStretch(command),
|
||||||
|
'b3-compact': compact,
|
||||||
|
b3: !compact
|
||||||
|
}"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="command.label"
|
:label="command.label"
|
||||||
:shortcut="getKeyboardShortcutLabel(command)"
|
:shortcut="getKeyboardShortcutLabel(command)"
|
||||||
@ -184,7 +187,8 @@ export default {
|
|||||||
'siteSettings',
|
'siteSettings',
|
||||||
'eventBus',
|
'eventBus',
|
||||||
'isEditing',
|
'isEditing',
|
||||||
'allowSettingSiteDefault'
|
'allowSettingSiteDefault',
|
||||||
|
'compact',
|
||||||
],
|
],
|
||||||
components: {
|
components: {
|
||||||
ShortcutButton,
|
ShortcutButton,
|
||||||
|
@ -5,8 +5,11 @@
|
|||||||
|
|
||||||
<ShortcutButton
|
<ShortcutButton
|
||||||
v-for="(command, index) of settings?.active.commands.zoom"
|
v-for="(command, index) of settings?.active.commands.zoom"
|
||||||
class="flex b3 button"
|
class="flex button"
|
||||||
:class="{active: editMode ? index === editModeOptions?.zoom?.selectedIndex : isActiveZoom(command)}"
|
:class="{active: editMode ? index === editModeOptions?.zoom?.selectedIndex : isActiveZoom(command),
|
||||||
|
'b3-compact': compact,
|
||||||
|
b3: !compact
|
||||||
|
}"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="command.label"
|
:label="command.label"
|
||||||
:shortcut="getKeyboardShortcutLabel(command)"
|
:shortcut="getKeyboardShortcutLabel(command)"
|
||||||
@ -131,25 +134,12 @@
|
|||||||
min, max and value need to be implemented in js as this slider
|
min, max and value need to be implemented in js as this slider
|
||||||
should use logarithmic scale
|
should use logarithmic scale
|
||||||
-->
|
-->
|
||||||
<div class="flex flex-row flex-end">
|
<div class="flex flex-row w-full" style="margin-top: 0.66rem">
|
||||||
<Button
|
<div style="position:relative;" class="grow">
|
||||||
v-if="zoomAspectRatioLocked"
|
|
||||||
label="Unlock aspect ratio"
|
|
||||||
icon="lock-open"
|
|
||||||
:fixedWidth="true"
|
|
||||||
@click="toggleZoomAr()"
|
|
||||||
>
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
v-else
|
|
||||||
label="Lock aspect ratio"
|
|
||||||
icon="lock"
|
|
||||||
:fixedWidth="true"
|
|
||||||
@click="toggleZoomAr()"
|
|
||||||
>
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
<template v-if="zoomAspectRatioLocked">
|
<template v-if="zoomAspectRatioLocked">
|
||||||
|
<div class="slider-label">
|
||||||
|
Zoom: {{getZoomForDisplay('x')}}
|
||||||
|
</div>
|
||||||
<input id="_input_zoom_slider"
|
<input id="_input_zoom_slider"
|
||||||
class="input-slider"
|
class="input-slider"
|
||||||
type="range"
|
type="range"
|
||||||
@ -159,17 +149,9 @@
|
|||||||
:value="zoom.x"
|
:value="zoom.x"
|
||||||
@input="changeZoom($event.target.value)"
|
@input="changeZoom($event.target.value)"
|
||||||
/>
|
/>
|
||||||
<div style="overflow: auto" class="flex flex-row">
|
|
||||||
<div class="flex flex-grow medium-small x-pad-1em">
|
|
||||||
Zoom: {{getZoomForDisplay('x')}}
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-nogrow flex-noshrink medium-small">
|
|
||||||
<a class="_zoom_reset x-pad-1em" @click="resetZoom()">reset</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div>Horizontal zoom</div>
|
<div class="slider-label">Horizontal zoom: {{getZoomForDisplay('x')}}</div>
|
||||||
<input id="_input_zoom_slider"
|
<input id="_input_zoom_slider"
|
||||||
class="input-slider"
|
class="input-slider"
|
||||||
type="range"
|
type="range"
|
||||||
@ -180,8 +162,8 @@
|
|||||||
@input="changeZoom($event.target.value, 'x')"
|
@input="changeZoom($event.target.value, 'x')"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div>Vertical zoom</div>
|
<div class="slider-label">Vertical zoom: {{getZoomForDisplay('y')}}</div>
|
||||||
<input id="_input_zoom_slider"
|
<input id="_input_zoom_slider_2"
|
||||||
class="input-slider"
|
class="input-slider"
|
||||||
type="range"
|
type="range"
|
||||||
step="any"
|
step="any"
|
||||||
@ -190,21 +172,43 @@
|
|||||||
:value="zoom.y"
|
:value="zoom.y"
|
||||||
@input="changeZoom($event.target.value, 'y')"
|
@input="changeZoom($event.target.value, 'y')"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div style="overflow: auto" class="flex flex-row">
|
|
||||||
<div class="flex flex-grow medium-small x-pad-1em">
|
|
||||||
Zoom: {{getZoomForDisplay('x')}} x {{getZoomForDisplay('y')}}
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-nogrow flex-noshrink medium-small">
|
|
||||||
<a class="_zoom_reset x-pad-1em" @click="resetZoom()">reset</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-row items-center justify-center" style="padding-left: 1rem">
|
||||||
|
<Button
|
||||||
|
v-if="zoomAspectRatioLocked"
|
||||||
|
icon="lock"
|
||||||
|
:iconSize="16"
|
||||||
|
:fixedWidth="true"
|
||||||
|
:noPad="true"
|
||||||
|
@click="toggleZoomAr()"
|
||||||
|
>
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
v-else
|
||||||
|
icon="lock-open-variant"
|
||||||
|
:iconSize="16"
|
||||||
|
:fixedWidth="true"
|
||||||
|
:noPad="true"
|
||||||
|
@click="toggleZoomAr()"
|
||||||
|
>
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
icon="restore"
|
||||||
|
:iconSize="16"
|
||||||
|
:noPad="true"
|
||||||
|
@click="resetZoom()"
|
||||||
|
></Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Button from '@csui/src/components/Button.vue';
|
||||||
import ShortcutButton from '@csui/src/components/ShortcutButton.vue';
|
import ShortcutButton from '@csui/src/components/ShortcutButton.vue';
|
||||||
import EditShortcutButton from '@csui/src/components/EditShortcutButton';
|
import EditShortcutButton from '@csui/src/components/EditShortcutButton';
|
||||||
import EditModeMixin from '@csui/src/utils/EditModeMixin';
|
import EditModeMixin from '@csui/src/utils/EditModeMixin';
|
||||||
@ -214,6 +218,7 @@ import AspectRatioType from '@src/common/enums/AspectRatioType.enum';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
Button,
|
||||||
ShortcutButton,
|
ShortcutButton,
|
||||||
EditShortcutButton,
|
EditShortcutButton,
|
||||||
},
|
},
|
||||||
@ -246,7 +251,8 @@ export default {
|
|||||||
'settings', // required for buttons and actions, which are global
|
'settings', // required for buttons and actions, which are global
|
||||||
'siteSettings',
|
'siteSettings',
|
||||||
'eventBus',
|
'eventBus',
|
||||||
'isEditing'
|
'isEditing',
|
||||||
|
'compact',
|
||||||
],
|
],
|
||||||
created() {
|
created() {
|
||||||
if (this.isEditing) {
|
if (this.isEditing) {
|
||||||
@ -282,8 +288,7 @@ export default {
|
|||||||
// this.eventBus.send('set-zoom', {zoom: 1, axis: 'y'});
|
// this.eventBus.send('set-zoom', {zoom: 1, axis: 'y'});
|
||||||
// this.eventBus.send('set-zoom', {zoom: 1, axis: 'x'});
|
// this.eventBus.send('set-zoom', {zoom: 1, axis: 'x'});
|
||||||
|
|
||||||
this.eventBus?.sendToTunnel('set-zoom', {zoom: 1, axis: 'y'});
|
this.eventBus?.sendToTunnel('set-zoom', {zoom: 1});
|
||||||
this.eventBus?.sendToTunnel('set-zoom', {zoom: 1, axis: 'x'});
|
|
||||||
},
|
},
|
||||||
changeZoom(newZoom, axis) {
|
changeZoom(newZoom, axis) {
|
||||||
// we store zoom logarithmically on this compnent
|
// we store zoom logarithmically on this compnent
|
||||||
@ -297,10 +302,9 @@ export default {
|
|||||||
newZoom = Math.pow(2, newZoom);
|
newZoom = Math.pow(2, newZoom);
|
||||||
|
|
||||||
if (this.zoomAspectRatioLocked) {
|
if (this.zoomAspectRatioLocked) {
|
||||||
this.eventBus?.sendToTunnel('set-zoom', {zoom: newZoom, axis: 'y'});
|
this.eventBus?.sendToTunnel('set-zoom', {zoom: newZoom});
|
||||||
this.eventBus?.sendToTunnel('set-zoom', {zoom: newZoom, axis: 'x'});
|
|
||||||
} else {
|
} else {
|
||||||
this.eventBus?.sendToTunnel('set-zoom', {zoom: newZoom, axis: axis ?? 'x'});
|
this.eventBus?.sendToTunnel('set-zoom', {zoom: {[axis ?? 'x']: newZoom}});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isActiveZoom(command) {
|
isActiveZoom(command) {
|
||||||
@ -314,3 +318,17 @@ export default {
|
|||||||
<style lang="scss" src="../../../../res/css/flex.scss" scoped></style>
|
<style lang="scss" src="../../../../res/css/flex.scss" scoped></style>
|
||||||
<style lang="scss" src="@csui/src/res-common/panels.scss" scoped></style>
|
<style lang="scss" src="@csui/src/res-common/panels.scss" scoped></style>
|
||||||
<style lang="scss" src="@csui/src/res-common/common.scss" scoped></style>
|
<style lang="scss" src="@csui/src/res-common/common.scss" scoped></style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.input-slider {
|
||||||
|
width: 100%;
|
||||||
|
box-sizing:border-box;
|
||||||
|
margin-right: 1rem;
|
||||||
|
margin-left: 0rem;
|
||||||
|
}
|
||||||
|
.slider-label {
|
||||||
|
margin-bottom: -0.5rem;
|
||||||
|
color: #aaa;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="flex flex-col">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
@ -38,7 +38,7 @@
|
|||||||
<!-- CROP OPTIONS -->
|
<!-- CROP OPTIONS -->
|
||||||
<div v-if="settings" class="sub-panel">
|
<div v-if="settings" class="sub-panel">
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
<mdicon name="crop" :size="32" />
|
<mdicon name="crop" :size="16" />
|
||||||
<h1>Crop video:</h1>
|
<h1>Crop video:</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="button center-text"
|
<div class="button center-text"
|
||||||
:class="{'setting-selected': selected }"
|
:class="{
|
||||||
|
'setting-selected': selected,
|
||||||
|
'no-pad': noPad,
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
|
<mdicon v-if="icon" :name="icon" :size="iconSize ?? 24"></mdicon>
|
||||||
<div class="label">
|
<div class="label">
|
||||||
{{label}}
|
{{label}}
|
||||||
</div>
|
</div>
|
||||||
@ -15,6 +19,8 @@ export default {
|
|||||||
selected: Boolean,
|
selected: Boolean,
|
||||||
label: String,
|
label: String,
|
||||||
icon: String,
|
icon: String,
|
||||||
|
iconSize: Number,
|
||||||
|
noPad: Boolean
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -40,4 +46,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
.no-pad {
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -12,61 +12,86 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
<mdicon name="crop" :size="24" />
|
<mdicon name="crop" :size="16" />
|
||||||
<h1>Crop video:</h1>
|
<span>CROP</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
style="margin-top: -0.69rem; margin-bottom: 0.88rem;"
|
||||||
|
>
|
||||||
<CropOptionsPanel
|
<CropOptionsPanel
|
||||||
style="margin-top: -2rem"
|
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
:eventBus="eventBus"
|
:eventBus="eventBus"
|
||||||
:siteSettings="siteSettings"
|
:siteSettings="siteSettings"
|
||||||
:isEditing="false"
|
:isEditing="false"
|
||||||
|
:compact="true"
|
||||||
>
|
>
|
||||||
</CropOptionsPanel>
|
</CropOptionsPanel>
|
||||||
|
|
||||||
<div class="flex flex-row">
|
|
||||||
<mdicon name="crop" :size="24" />
|
|
||||||
<h1>Stretch video:</h1>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-row">
|
||||||
|
<mdicon name="crop" :size="16" />
|
||||||
|
<span>STRETCH</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style="margin-top: -0.69rem; margin-bottom: 0.88rem;"
|
||||||
|
>
|
||||||
<StretchOptionsPanel
|
<StretchOptionsPanel
|
||||||
style="margin-top: -2rem"
|
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
:eventBus="eventBus"
|
:eventBus="eventBus"
|
||||||
:siteSettings="siteSettings"
|
:siteSettings="siteSettings"
|
||||||
:isEditing="false"
|
:isEditing="false"
|
||||||
|
:compact="true"
|
||||||
></StretchOptionsPanel>
|
></StretchOptionsPanel>
|
||||||
|
|
||||||
<div class="flex flex-row">
|
|
||||||
<mdicon name="crop" :size="24" />
|
|
||||||
<h1>Zoom:</h1>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-row">
|
||||||
|
<mdicon name="crop" :size="16" />
|
||||||
|
<span>ZOOM</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style="margin-top: -0.69rem; margin-bottom: 0.88rem;"
|
||||||
|
>
|
||||||
<ZoomOptionsPanel
|
<ZoomOptionsPanel
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
:eventBus="eventBus"
|
:eventBus="eventBus"
|
||||||
:siteSettings="siteSettings"
|
:siteSettings="siteSettings"
|
||||||
:isEditing="false"
|
:isEditing="false"
|
||||||
|
:compact="true"
|
||||||
>
|
>
|
||||||
</ZoomOptionsPanel>
|
</ZoomOptionsPanel>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-row">
|
||||||
|
<mdicon name="crop" :size="16" />
|
||||||
|
<span>ALIGN</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style="margin-bottom: 0.88rem;"
|
||||||
|
>
|
||||||
|
<AlignmentOptionsControlComponent
|
||||||
|
:eventBus="eventBus"
|
||||||
|
:large="true"
|
||||||
|
> </AlignmentOptionsControlComponent>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CropOptionsPanel from '../../PlayerUiPanels/PanelComponents/VideoSettings/CropOptionsPanel';
|
import CropOptionsPanel from '@csui/src/PlayerUiPanels/PanelComponents/VideoSettings/CropOptionsPanel';
|
||||||
import StretchOptionsPanel from '../../PlayerUiPanels/PanelComponents/VideoSettings/StretchOptionsPanel.vue';
|
import StretchOptionsPanel from '@csui/src/PlayerUiPanels/PanelComponents/VideoSettings/StretchOptionsPanel.vue';
|
||||||
import ZoomOptionsPanel from '../../PlayerUiPanels/PanelComponents/VideoSettings/ZoomOptionsPanel.vue';
|
import ZoomOptionsPanel from '@csui/src/PlayerUiPanels/PanelComponents/VideoSettings/ZoomOptionsPanel.vue';
|
||||||
import ExtensionMode from '@src/common/enums/ExtensionMode.enum.ts';
|
import ExtensionMode from '@src/common/enums/ExtensionMode.enum.ts';
|
||||||
|
import AlignmentOptionsControlComponent from '@csui/src/PlayerUiPanels/AlignmentOptionsControlComponent.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
components: {
|
||||||
return {
|
CropOptionsPanel,
|
||||||
exec: null,
|
StretchOptionsPanel,
|
||||||
ExtensionMode: ExtensionMode,
|
ZoomOptionsPanel,
|
||||||
};
|
AlignmentOptionsControlComponent
|
||||||
},
|
},
|
||||||
mixins: [
|
mixins: [
|
||||||
|
|
||||||
@ -76,8 +101,11 @@ export default {
|
|||||||
'siteSettings',
|
'siteSettings',
|
||||||
'eventBus',
|
'eventBus',
|
||||||
],
|
],
|
||||||
components: {
|
data() {
|
||||||
CropOptionsPanel, StretchOptionsPanel, ZoomOptionsPanel
|
return {
|
||||||
|
exec: null,
|
||||||
|
ExtensionMode: ExtensionMode,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.eventBus.subscribe(
|
this.eventBus.subscribe(
|
||||||
|
@ -1,58 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<h2>What's new</h2>
|
|
||||||
<p>Full changelog for older versions <a href="https://github.com/tamius-han/ultrawidify/blob/master/CHANGELOG.md">is available here</a>.</p>
|
|
||||||
<p class="label">6.0.0</p>
|
|
||||||
<ul>
|
|
||||||
<li>Fixed laginess in Chromium-based browsers on Windows. Details in <a href="https://github.com/tamius-han/ultrawidify/issues/199#issuecomment-1221383134" target="blank">#199</a>.</li>
|
|
||||||
</ul>
|
|
||||||
<p class="label">5.1.2</p>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<b>In-player UI.</b><br/>
|
|
||||||
This one took major effort to pull off. Required some changes under the hood, required me to de-spaghettify some code. The UI will only show
|
|
||||||
if the video takes up sufficient amount of space (currently determined as 960 pixels wide).
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
By default, Ultrawidify will not kick in on "small videos". You have to be either in full screen or theater mode. Ultrawidify assumes that any
|
|
||||||
video that takes up more than 85% of the window width is being viewed in theater mode. This value may be tweaked later on. This feature can be
|
|
||||||
configured (or turned off entirely) via 'Advanced options' menu on the in-player UI.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
The in-player extension UI will do a better job differentiating between the various level of support: "official" for the sites that Tam can check
|
|
||||||
on his own, "fingers crossed" for sites that Tam can't check because my load-bearing credit card can't support the weight of a dozen subscription
|
|
||||||
services, and "community support" for sites that enjoy support through the helping hand of people willing to help.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
The in-player UI now displays a warning whenever Ultrawidify detects automatic aspect ratio detection isn't happening because the site uses DRM.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Made the UI for fixing problems with Ultrawidify not working a bit more intuitive.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Better zooming. The slider is back, baby.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New alignment options. Video can be aligned vertically as well as horizontally.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Panning option that's a bit more intuitive.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import BrowserDetect from '../../ext/conf/BrowserDetect';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
BrowserDetect: BrowserDetect
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
</style>
|
|
@ -163,6 +163,7 @@ button, .button {
|
|||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
max-width: 24rem;
|
max-width: 24rem;
|
||||||
|
min-width: 16rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-hint {
|
.has-hint {
|
||||||
@ -174,8 +175,15 @@ button, .button {
|
|||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
|
|
||||||
|
min-width: 12px;
|
||||||
|
max-width: 24rem;
|
||||||
|
|
||||||
select {
|
select {
|
||||||
background: rgba($blackBg, $hoverTransparentOpacity);
|
background: rgba($blackBg, $hoverTransparentOpacity);
|
||||||
|
|
||||||
|
min-width: 12px;
|
||||||
|
max-width: 100%;
|
||||||
|
|
||||||
color: #fff;
|
color: #fff;
|
||||||
// border: 0px solid transparent;
|
// border: 0px solid transparent;
|
||||||
border: 1px solid rgba(255, 171, 102, 0.42);
|
border: 1px solid rgba(255, 171, 102, 0.42);
|
||||||
@ -217,9 +225,15 @@ button, .button {
|
|||||||
padding-left: 0.33rem;
|
padding-left: 0.33rem;
|
||||||
padding-right: 0.33rem;
|
padding-right: 0.33rem;
|
||||||
}
|
}
|
||||||
.input-slider {
|
.b3-compact {
|
||||||
width: 480px;
|
width: 7rem;
|
||||||
|
padding-left: 0.25rem;
|
||||||
|
padding-right: 0.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// .input-slider {
|
||||||
|
// width: 480px;
|
||||||
|
// }
|
||||||
.warning-lite {
|
.warning-lite {
|
||||||
padding-right: 16px;
|
padding-right: 16px;
|
||||||
padding-bottom: 16px;
|
padding-bottom: 16px;
|
||||||
|
@ -227,6 +227,7 @@ export class Aard {
|
|||||||
private siteSettings: SiteSettings;
|
private siteSettings: SiteSettings;
|
||||||
private eventBus: EventBus;
|
private eventBus: EventBus;
|
||||||
private arid: string;
|
private arid: string;
|
||||||
|
private arVariant: ArVariant;
|
||||||
|
|
||||||
private eventBusCommands = {
|
private eventBusCommands = {
|
||||||
'uw-environment-change': {
|
'uw-environment-change': {
|
||||||
@ -415,10 +416,11 @@ export class Aard {
|
|||||||
* Checks whether autodetection can run
|
* Checks whether autodetection can run
|
||||||
*/
|
*/
|
||||||
startCheck(arVariant?: ArVariant) {
|
startCheck(arVariant?: ArVariant) {
|
||||||
console.log('aard - starting checks')
|
this.arVariant = arVariant;
|
||||||
|
|
||||||
if (!this.videoData.player) {
|
if (!this.videoData.player) {
|
||||||
console.warn('Player not detected!');
|
// console.warn('Player not detected!');
|
||||||
console.log('--- video data: ---\n', this.videoData);
|
// console.log('--- video data: ---\n', this.videoData);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.siteSettings.data.enableAard[this.videoData.player.environment] === ExtensionMode.Enabled) {
|
if (this.siteSettings.data.enableAard[this.videoData.player.environment] === ExtensionMode.Enabled) {
|
||||||
@ -707,7 +709,7 @@ export class Aard {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn('[Ultrawidify] Aspect ratio autodetection crashed for some reason.\n\nsome reason:', e);
|
console.warn('[Ultrawidify] Aspect ratio autodetection crashed for some reason.\n\nsome reason:', e);
|
||||||
this.videoData.resizer.setAr({type: AspectRatioType.AutomaticUpdate, ratio: this.defaultAr});
|
this.videoData.resizer.setAr({type: AspectRatioType.AutomaticUpdate, ratio: this.defaultAr, variant: this.arVariant});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2036,7 +2038,8 @@ export class Aard {
|
|||||||
this.videoData.resizer.updateAr({
|
this.videoData.resizer.updateAr({
|
||||||
type: AspectRatioType.AutomaticUpdate,
|
type: AspectRatioType.AutomaticUpdate,
|
||||||
ratio: this.getAr(),
|
ratio: this.getAr(),
|
||||||
offset: this.testResults.letterboxOffset
|
offset: this.testResults.letterboxOffset,
|
||||||
|
variant: this.arVariant
|
||||||
});
|
});
|
||||||
this.testResults.activeAspectRatio = ar;
|
this.testResults.activeAspectRatio = ar;
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ class Resizer {
|
|||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
'set-zoom': [{
|
'set-zoom': [{
|
||||||
function: (config: any) => this.setZoom(config.zoom, config.axis, config.noAnnounce)
|
function: (config: any) => this.setZoom(config.zoom)
|
||||||
}],
|
}],
|
||||||
'change-zoom': [{
|
'change-zoom': [{
|
||||||
function: (config: any) => this.zoomStep(config.zoom)
|
function: (config: any) => this.zoomStep(config.zoom)
|
||||||
@ -285,7 +285,7 @@ class Resizer {
|
|||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateAr(ar) {
|
updateAr(ar: Ar) {
|
||||||
if (!ar) {
|
if (!ar) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -602,9 +602,36 @@ class Resizer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setZoom(zoomLevel: number, axis?: 'x' | 'y', noAnnounce?) {
|
private _setZoomTimeout;
|
||||||
|
private _latestSetZoomArgs: any | undefined;
|
||||||
|
private _SET_ZOOM_RATE_LIMIT_MS = 50;
|
||||||
|
/**
|
||||||
|
* Sets zoom level. This function is rate limited, because slider may spam the fuck out of this function call
|
||||||
|
* @param zoomLevel
|
||||||
|
* @param axis
|
||||||
|
* @param noAnnounce
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
setZoom(zoomLevel: number | {x: number, y: number}, noAnnounce?) {
|
||||||
|
if (this._setZoomTimeout) {
|
||||||
|
this._latestSetZoomArgs = {zoomLevel, noAnnounce};
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.manualZoom = true;
|
this.manualZoom = true;
|
||||||
this.zoom.setZoom(zoomLevel, axis, noAnnounce);
|
this.zoom.setZoom(zoomLevel);
|
||||||
|
|
||||||
|
this._setZoomTimeout = setTimeout(
|
||||||
|
() => {
|
||||||
|
clearTimeout(this._setZoomTimeout);
|
||||||
|
this._setZoomTimeout = undefined;
|
||||||
|
|
||||||
|
if (this._latestSetZoomArgs) {
|
||||||
|
this.setZoom(this._latestSetZoomArgs.zoomLevel);
|
||||||
|
}
|
||||||
|
this._latestSetZoomArgs = undefined;
|
||||||
|
},
|
||||||
|
this._SET_ZOOM_RATE_LIMIT_MS
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
zoomStep(step){
|
zoomStep(step){
|
||||||
|
@ -2,9 +2,14 @@ import Debug from '../../conf/Debug';
|
|||||||
import Logger from '../Logger';
|
import Logger from '../Logger';
|
||||||
import VideoData from '../video-data/VideoData';
|
import VideoData from '../video-data/VideoData';
|
||||||
|
|
||||||
// računa približevanje ter računa/popravlja odmike videa
|
|
||||||
// calculates zooming and video offsets/panning
|
// calculates zooming and video offsets/panning
|
||||||
|
|
||||||
|
const MIN_SCALE = 0.5;
|
||||||
|
const MAX_SCALE = 8;
|
||||||
|
const LOG_MAX_SCALE = Math.log2(MAX_SCALE);
|
||||||
|
const LOG_MIN_SCALE = Math.log2(MIN_SCALE);
|
||||||
|
|
||||||
|
|
||||||
class Zoom {
|
class Zoom {
|
||||||
//#region flags
|
//#region flags
|
||||||
|
|
||||||
@ -21,8 +26,10 @@ class Zoom {
|
|||||||
logScale: number = 0;
|
logScale: number = 0;
|
||||||
logScaleY: number = 0;
|
logScaleY: number = 0;
|
||||||
scaleStep: number = 0.1;
|
scaleStep: number = 0.1;
|
||||||
minScale: number = -1; // 50% (log2(0.5) = -1)
|
logMinScale: number = -1; // 50% (log2(0.5) = -1)
|
||||||
maxScale: number = 3; // 800% (log2(8) = 3)
|
logMaxScale: number = 3; // 800% (log2(8) = 3)
|
||||||
|
minScale = 0.5;
|
||||||
|
maxScale = 8;
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
|
||||||
@ -33,7 +40,9 @@ class Zoom {
|
|||||||
|
|
||||||
reset(){
|
reset(){
|
||||||
this.scale = 1;
|
this.scale = 1;
|
||||||
|
this.scaleY = 1;
|
||||||
this.logScale = 0;
|
this.logScale = 0;
|
||||||
|
this.logScaleY = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,7 +54,7 @@ class Zoom {
|
|||||||
zoomStep(amount: number, axis?: 'x' | 'y') {
|
zoomStep(amount: number, axis?: 'x' | 'y') {
|
||||||
let newLog = axis === 'y' ? this.logScaleY : this.logScale;
|
let newLog = axis === 'y' ? this.logScaleY : this.logScale;
|
||||||
newLog += amount;
|
newLog += amount;
|
||||||
newLog = Math.min(Math.max(newLog, this.minScale), this.maxScale);
|
newLog = Math.min(Math.max(newLog, LOG_MIN_SCALE), LOG_MAX_SCALE);
|
||||||
|
|
||||||
// if axis is undefined, both of this statements should trigger)
|
// if axis is undefined, both of this statements should trigger)
|
||||||
if (axis !== 'y') {
|
if (axis !== 'y') {
|
||||||
@ -62,25 +71,23 @@ class Zoom {
|
|||||||
this.processZoom();
|
this.processZoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
setZoom(scale: number, axis?: 'x' |'y', noAnnounce?){
|
/**
|
||||||
|
* Sets zoom to specific value
|
||||||
|
* @param scale
|
||||||
|
*/
|
||||||
|
setZoom(scale: number | {x: number, y: number}){
|
||||||
// NOTE: SCALE IS NOT LOGARITHMIC
|
// NOTE: SCALE IS NOT LOGARITHMIC
|
||||||
if(scale < Math.pow(2, this.minScale)) {
|
const scaleIn = (typeof scale === 'number') ?
|
||||||
scale = this.minScale;
|
{
|
||||||
} else if (scale > Math.pow(2, this.maxScale)) {
|
x: scale,
|
||||||
scale = this.maxScale;
|
y: scale
|
||||||
}
|
} : {
|
||||||
|
x: scale.x ?? this.scale,
|
||||||
|
y: scale.y ?? this.scaleY
|
||||||
|
};
|
||||||
|
|
||||||
switch (axis) {
|
this.scale = Math.min(Math.max(scaleIn.x, MIN_SCALE), MAX_SCALE);
|
||||||
case 'x':
|
this.scaleY = Math.min(Math.max(scaleIn.y, MIN_SCALE), MAX_SCALE);
|
||||||
this.scale = scale;
|
|
||||||
break;
|
|
||||||
case 'y':
|
|
||||||
this.scaleY = scale;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
this.scale = scale;
|
|
||||||
this.scaleY = scale;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.processZoom();
|
this.processZoom();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user