Looking pretty fucking dope

This commit is contained in:
Ben Arc 2021-04-14 18:11:33 +01:00
parent 6dceb61ba8
commit dea442cbcc
2 changed files with 38 additions and 11 deletions

View file

@ -2,8 +2,9 @@
<iframe <iframe
width="100%" width="100%"
height="100%" height="100%"
src="https://www.w3schools.com" id="iframe_main"
title="W3Schools Free Online Web Tutorials" src="/"
class="fixed-bottom-left"
> >
</iframe> </iframe>
<video <video
@ -13,6 +14,12 @@
class="fixed-bottom-right" class="fixed-bottom-right"
></video> ></video>
<img src="" style="width: 100%" id="animations" class="fixed-bottom-left" /> <img src="" style="width: 100%" id="animations" class="fixed-bottom-left" />
<q-btn
color="primary"
@click="reconnect"
label="Reconnect"
class="fixed-bottom-left"
/>
</q-page> </q-page>
{% endblock %} {% block scripts %} {% endblock %} {% block scripts %}
<script src="{{ url_for('static', filename='vendor/vue-qrcode@1.0.2/vue-qrcode.min.js') }}"></script> <script src="{{ url_for('static', filename='vendor/vue-qrcode@1.0.2/vue-qrcode.min.js') }}"></script>
@ -85,7 +92,7 @@
this.connection.addEventListener('message', function (event) { this.connection.addEventListener('message', function (event) {
res = event.data.split('-') res = event.data.split('-')
console.log(res[1])
if (res[0] != this.oldRes) { if (res[0] != this.oldRes) {
this.oldRes = res[0] this.oldRes = res[0]
if (res[1] == 'animation1') { if (res[1] == 'animation1') {
@ -113,11 +120,14 @@
}, 5000) }, 5000)
} }
if (res[1] == 'true') { if (res[1] == 'true') {
document.getElementById('videoElement').style.width = '10%' document.getElementById('videoElement').style.width = '20%'
} }
if (res[1] == 'false') { if (res[1] == 'false') {
document.getElementById('videoElement').style.width = '100%' document.getElementById('videoElement').style.width = '100%'
} }
if (res[1].substring(0, 3) == 'htt') {
document.getElementById('iframe_main').src = res[1]
}
} }
}) })

View file

@ -23,12 +23,11 @@
<div class="col"> <div class="col">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<q-toggle <q-btn
v-model="fullscreen_cam" class="q-mt-sm q-ml-sm"
color="primary"
@click="fullscreenToggle" @click="fullscreenToggle"
size="xl" label="Webcam size"
icon="face"
label="Fullscreen"
/> />
</div> </div>
<div class="col"> <div class="col">
@ -41,7 +40,13 @@
label="iframe url" label="iframe url"
> >
<template v-slot:after> <template v-slot:after>
<q-btn round dense flat @click="" icon="send" /> <q-btn
round
dense
flat
@click="iframeChange(iframe)"
icon="send"
/>
</template> </template>
</q-input> </q-input>
</div> </div>
@ -49,6 +54,7 @@
<div class="row q-pa-sm"> <div class="row q-pa-sm">
<div class="col"> <div class="col">
<q-btn <q-btn
style="width: 95%"
color="primary" color="primary"
@click="animationBTN('animation1')" @click="animationBTN('animation1')"
label="Confetti" label="Confetti"
@ -56,6 +62,7 @@
</div> </div>
<div class="col"> <div class="col">
<q-btn <q-btn
style="width: 95%"
color="primary" color="primary"
@click="animationBTN('animation2')" @click="animationBTN('animation2')"
label="Smiley" label="Smiley"
@ -63,6 +70,7 @@
</div> </div>
<div class="col"> <div class="col">
<q-btn <q-btn
style="width: 95%"
color="primary" color="primary"
@click="animationBTN('animation3')" @click="animationBTN('animation3')"
label="Rocket" label="Rocket"
@ -109,8 +117,17 @@
} }
}, },
methods: { methods: {
iframeChange: function (url) {
this.connection.send(String(url))
},
fullscreenToggle: function () { fullscreenToggle: function () {
this.connection.send(String(fullscreen_cam)) console.log(this.fullscreen_cam)
this.connection.send(String(this.fullscreen_cam))
if (this.fullscreen_cam) {
this.fullscreen_cam = false
} else {
this.fullscreen_cam = true
}
}, },
openCompose: function () { openCompose: function () {
let params = `scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=900,height=500,left=200,top=200` let params = `scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=900,height=500,left=200,top=200`