ultrawidify/src/csui/PlayerUiComponent.vue

180 lines
3.7 KiB
Vue
Raw Normal View History

2020-12-15 00:26:19 +01:00
<template>
<div class="uw-hover uv-hover-trigger-region">
TEST CONTENT
</div>
<div class="popup-panel">
<div class="tab-row flex flex-row">
<div class="tab">
todo: icon<br/>
Video options
</div>
</div>
<div>
<!-- Panel section -->
<template v-if="settingsInitialized">
<VideoSettings
:settings="settings"
></VideoSettings>
<ResizerDebugPanel :debugData="debugData">
</ResizerDebugPanel>
</template>
</div>
2020-12-15 00:26:19 +01:00
</div>
</template>
<script>
import VideoSettings from './PlayerUiPanels/VideoSettings.vue'
2020-12-15 00:26:19 +01:00
import { mapState } from 'vuex';
import Icon from '../common/components/Icon';
import ResizerDebugPanel from './PlayerUiPanels/ResizerDebugPanelComponent';
import BrowserDetect from '../ext/conf/BrowserDetect';
import ExecAction from './ui-libs/ExecAction';
import Logger from '../ext/lib/Logger';
import Settings from '../ext/lib/Settings';
2020-12-15 00:26:19 +01:00
export default {
components: {
Icon,
ResizerDebugPanel, VideoSettings
2020-12-15 00:26:19 +01:00
},
data() {
return {
// component properties
settings: {},
settingsInitialized: false,
execAction: new ExecAction(),
logger: null,
uiVisible: true,
debugData: {
resizer: {},
player: {},
2020-12-16 01:40:09 +01:00
},
debugDataPrettified: ''
2020-12-15 00:26:19 +01:00
};
},
computed: {
...mapState([
'showUi',
'resizerDebugData',
'playerDebugData'
2020-12-15 00:26:19 +01:00
]),
2020-12-16 01:40:09 +01:00
windowWidth: () => {
return window.innerWidth;
},
windowHeight: () => {
return window.innerHeight;
},
2020-12-15 00:26:19 +01:00
},
watch: {
showUi(visible) {
if (visible !== undefined) {
this.uiVisible = visible;
}
},
resizerDebugData(newData) {
this.debugData.resizer = newData;
2020-12-16 01:40:09 +01:00
this.debugDataPrettified = JSON.stringify(this.debugData, null, 2);
},
playerDebugData(newData) {
this.debugData.player = newData;
2020-12-16 01:40:09 +01:00
this.debugDataPrettified = JSON.stringify(this.debugData, null, 2);
2020-12-15 00:26:19 +01:00
}
},
async created() {
try {
this.logger = new Logger();
await this.logger.init({
allowLogging: true,
});
this.settings = new Settings({afterSettingsSaved: this.updateConfig, logger: this.logger});
await this.settings.init();
this.settingsInitialized = true;
this.execAction.setSettings(this.settings);
console.log("created!");
console.log("store:", this.$store, this);
} catch (e) {
console.error('Failed to initiate ultrawidify player ui.', e);
}
2020-12-15 00:26:19 +01:00
},
methods: {
2020-12-22 03:14:03 +01:00
getUrl(url) {
2020-12-30 15:35:54 +01:00
return BrowserDetect.getURL(url);
},
2020-12-15 00:26:19 +01:00
}
}
</script>
2020-12-16 01:40:09 +01:00
<style lang="scss" src="../res/css/uwui-base.scss" scoped></style>
2020-12-15 00:26:19 +01:00
<style lang="scss" scoped>
@import '../res/css/uwui-base.scss';
@import '../res/css/colors.scss';
@import '../res/css/font/overpass.css';
@import '../res/css/font/overpass-mono.css';
@import '../res/css/common.scss';
.uw-ultrawidify-container-root {
// .relative-wrapper {
// position: relative;
// width: 100%;
// height: 100%;
// }
2020-12-15 00:26:19 +01:00
.uw-hover {
position: absolute;
top: 10%;
left: 10%;
2020-12-15 00:26:19 +01:00
width: 100px;
height: 100px;
color: #fff;
background-color: #000;
2020-12-16 01:40:09 +01:00
z-index: 999999999999999999;
2020-12-15 00:26:19 +01:00
}
.uw-hover:hover {
background-color: #f00;
}
2020-12-16 01:40:09 +01:00
.popup-panel {
position: absolute;
top: 10%;
left: 10%;
z-index: 999999999999999999;
width: 2500px;
height: 1200px;
max-width: 80%;
max-height: 80%;
2020-12-16 01:40:09 +01:00
pointer-events: all !important;
background-color: rgba(0,0,0,0.69);
color: #fff;
overflow-y: auto;
.tab {
display: block;
height: 42px;
font-size: 2.5rem;
background: rgb(87, 54, 26);
}
.tab:hover {
background-color: #f00;
}
2020-12-16 01:40:09 +01:00
}
pre {
white-space: pre-wrap;
}
2020-12-15 00:26:19 +01:00
}
</style>