forked from holtwick/briefing
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
253 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
<template> | ||
<div class="-scroll"> | ||
<div class="app-welcome"> | ||
<h1>Embed Briefing</h1> | ||
<iframe class="iframe" :src="url"></iframe> | ||
<div class="url"> | ||
<a :href="url" targe="_blank">{{ url }}</a> | ||
</div> | ||
<div class="options"> | ||
<sea-switch v-model="presetAudio">Audio</sea-switch> | ||
<sea-switch v-model="presetVideo">Video</sea-switch> | ||
</div> | ||
<div><br />HTML code to be used in client</div> | ||
<pre class="code">{{ code }}</pre> | ||
|
||
<div><br />Status sent from iframe</div> | ||
<pre class="code">{{ status }}</pre> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss"> | ||
.app-welcome { | ||
margin: 2rem; | ||
padding-bottom: 4rem; | ||
text-align: center; | ||
h1 { | ||
font-size: 2rem; | ||
margin-bottom: 1rem; | ||
} | ||
a { | ||
color: rgba(43, 184, 255, 1); | ||
user-select: text; | ||
} | ||
.url { | ||
margin-bottom: 1rem; | ||
} | ||
.options { | ||
display: inline-block; | ||
margin-bottom: 1rem; | ||
.form-group { | ||
margin-bottom: 0.5rem; | ||
} | ||
} | ||
.code { | ||
display: inline-block; | ||
text-align: left; | ||
user-select: text; | ||
width: 75vw; | ||
background: #ccc; | ||
color: black; | ||
padding: 1rem; | ||
border-radius: 0.25rem; | ||
} | ||
} | ||
</style> | ||
|
||
<style> | ||
.iframe { | ||
border: 1px solid #ccc; | ||
width: Min(90vh, 90vw); | ||
height: Calc(0.75 * Min(90vh, 90vw)); | ||
margin-bottom: 1rem; | ||
} | ||
</style> | ||
|
||
<script> | ||
import { DEBUG, ROOM_PATH, ROOM_URL } from "../config" | ||
import { generateName } from "../lib/names" | ||
import SeaSwitch from "../ui/sea-switch" | ||
import { onMessageFromFrame } from "../lib/iframe" | ||
export default { | ||
components: { | ||
SeaSwitch, | ||
}, | ||
data() { | ||
let defaultName = DEBUG | ||
? process.env.VUE_APP_DEBUG_DEFAULT_ROOM || "development" | ||
: generateName() | ||
return { | ||
defaultName, | ||
room: defaultName, | ||
presetAudio: false, | ||
presetVideo: false, | ||
status: {}, | ||
} | ||
}, | ||
computed: { | ||
url() { | ||
let prefix = DEBUG ? ROOM_PATH : ROOM_URL | ||
return ( | ||
prefix + | ||
this.defaultName + | ||
"?audio=" + | ||
Number(this.presetAudio) + | ||
"&video=" + | ||
Number(this.presetVideo) | ||
) | ||
}, | ||
code() { | ||
return `\ | ||
<iframe | ||
src="${this.url}" | ||
></ iframe> | ||
` | ||
}, | ||
}, | ||
mounted() { | ||
onMessageFromFrame("status", (data) => { | ||
console.log("new guest count", data) | ||
this.status = data | ||
}) | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const source = "briefing" | ||
|
||
export function postMessageToParent(name, data = {}) { | ||
let info = { | ||
source, | ||
name, | ||
data, | ||
} | ||
console.log("postMessageToParent", info) | ||
window.parent.postMessage(info) | ||
} | ||
|
||
export function onMessageFromFrame(name, fn) { | ||
window.addEventListener("message", (e) => { | ||
let info = e.data | ||
console.log("onMessageFromFrame", info) | ||
if (info.source === source && info.name === name) { | ||
fn(info.data) | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.