2021-11-12 12:13:44 +01:00
|
|
|
<script lang="ts">
|
|
|
|
function copyLink() {
|
2021-12-06 16:12:37 +01:00
|
|
|
const input: HTMLInputElement = document.getElementById("input-share-link") as HTMLInputElement;
|
2021-11-16 15:03:54 +01:00
|
|
|
input.focus();
|
|
|
|
input.select();
|
2021-12-06 16:12:37 +01:00
|
|
|
document.execCommand("copy");
|
2021-11-12 12:13:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
async function shareLink() {
|
2021-12-06 16:12:37 +01:00
|
|
|
const shareData = { url: location.toString() };
|
2021-11-12 12:13:44 +01:00
|
|
|
|
|
|
|
try {
|
|
|
|
await navigator.share(shareData);
|
|
|
|
} catch (err) {
|
2021-12-06 16:12:37 +01:00
|
|
|
console.error("Error: " + err);
|
2021-11-12 12:13:44 +01:00
|
|
|
copyLink();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="guest-main">
|
|
|
|
<section class="container-overflow">
|
|
|
|
<section class="share-url not-mobile">
|
|
|
|
<h3>Share the link of the room !</h3>
|
2021-12-06 16:12:37 +01:00
|
|
|
<input type="text" readonly id="input-share-link" value={location.toString()} />
|
2021-11-12 12:13:44 +01:00
|
|
|
<button type="button" class="nes-btn is-primary" on:click={copyLink}>Copy</button>
|
|
|
|
</section>
|
|
|
|
<section class="is-mobile">
|
|
|
|
<h3>Share the link of the room !</h3>
|
2021-12-06 16:12:37 +01:00
|
|
|
<input type="hidden" readonly id="input-share-link" value={location.toString()} />
|
2021-11-12 12:13:44 +01:00
|
|
|
<button type="button" class="nes-btn is-primary" on:click={shareLink}>Share</button>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
div.guest-main {
|
2021-12-06 16:12:37 +01:00
|
|
|
height: calc(100% - 56px);
|
2021-11-12 12:13:44 +01:00
|
|
|
|
2021-12-06 16:12:37 +01:00
|
|
|
text-align: center;
|
2021-11-12 12:13:44 +01:00
|
|
|
|
2021-12-06 16:12:37 +01:00
|
|
|
section {
|
|
|
|
margin-bottom: 50px;
|
|
|
|
}
|
2021-11-12 12:13:44 +01:00
|
|
|
|
2021-12-06 16:12:37 +01:00
|
|
|
section.container-overflow {
|
|
|
|
height: 100%;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
overflow: auto;
|
|
|
|
}
|
2021-11-12 12:13:44 +01:00
|
|
|
|
2021-12-06 16:12:37 +01:00
|
|
|
section.is-mobile {
|
|
|
|
display: none;
|
|
|
|
}
|
2021-11-12 12:13:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@media only screen and (max-width: 900px), only screen and (max-height: 600px) {
|
2021-12-06 16:12:37 +01:00
|
|
|
div.guest-main {
|
|
|
|
section.share-url.not-mobile {
|
|
|
|
display: none;
|
|
|
|
}
|
2021-11-12 12:13:44 +01:00
|
|
|
|
2021-12-06 16:12:37 +01:00
|
|
|
section.is-mobile {
|
|
|
|
display: block;
|
|
|
|
text-align: center;
|
|
|
|
margin-bottom: 20px;
|
|
|
|
}
|
2021-11-12 12:13:44 +01:00
|
|
|
|
2021-12-06 16:12:37 +01:00
|
|
|
section.container-overflow {
|
|
|
|
height: calc(100% - 120px);
|
|
|
|
}
|
2021-11-12 12:13:44 +01:00
|
|
|
}
|
|
|
|
}
|
2021-12-06 16:12:37 +01:00
|
|
|
</style>
|