import{M as l,s as e}from"./chunks/screen.9127d83c.js";import{r as c,o as r,c as F,a as s,b as D,u as a,d as i,e as y,f as n}from"./app.1b5fc780.js";var d="/assets/screen.273a9703.mp4";const C=n(`

Guide

Installation

npm install vue-three-d-mockup

Usage

`,4),h=n(`

Simple example

screen.png is a static asset in the public folder.

<template>
  <Mockup screen="screen.png" />
</template>

<script setup>
import Mockup from 'vue-three-d-mockup';
</script>

Using assets as the screen

<template>
  <Mockup :screen="screenImage" />
</template>

<script setup>
import Mockup from 'vue-three-d-mockup';
import screenImage from './assets/screen.png';
</script>
<template>
  <Mockup :screen="require('./assets/screen.png')" />
</template>

<script setup>
import Mockup from 'vue-three-d-mockup';
</script>

Multiple phones

`,9),u=n(`
<template>
  <Mockup 
    :screen="[screenImage, screenImage]"
    :position="[
      {
        x: -50
      },
      {
        x: 50
      },
    ]"
    :rotation="[{}, {
      y: -0.3,
      z: -0.06,
    }]" 
  />
</template>

<script setup>
import Mockup from 'vue-three-d-mockup';
import screenImage from './assets/screen.png';
</script>

Video

`,2),A=["src"],g=n(`
<template>
  <Mockup 
    v-if="vidReady"
    :screen="videoElement"
  />

  <video
    :src="screenVideo"
    ref="videoElement"
    @canplay="vidReady = true"
    muted
    autoplay
    loop
    style="
      position: fixed;
      top: 0;
      left: 0;
      visibility: hidden;
    "
  ></video>
</template>

<script setup>
import { ref } from 'vue';
import Mockup from 'vue-three-d-mockup';
import screenVideo from './assets/screen.mp4';

const videoElement = ref(null);
const vidReady = ref(false);
</script>

Avaliable props

PropTypeRequiredDefaultDescription
screenString | Element | ArraytruenonePath to an image that will be displayed on the phones screen or the <video> element displayed on the phones screen. When using the latter there are caveats. Can also be an array of any of the options above.
lightClrStringfalse"white"Color of the light as a CSS-style string.
phoneClrStringfalse"white"Color of the phone as a CSS-style string.
positionObject | Arrayfalse{ x: 0, y: 0, z: 0 }The position of the phone. Can also be an array if multiple screens specified.
rotationObject | Arrayfalse{ x: -0.2, y: 0.3, z: 0.06 }The orientation of the phone described in rotation values arround the 3 axes. Can also be an array if multiple screens specified.

Caveats

`,5),x=JSON.parse('{"title":"Guide","description":"","frontmatter":{},"headers":[{"level":2,"title":"Installation","slug":"installation"},{"level":2,"title":"Usage","slug":"usage"},{"level":3,"title":"Simple example","slug":"simple-example"},{"level":3,"title":"Using assets as the screen","slug":"using-assets-as-the-screen"},{"level":3,"title":"Multiple phones","slug":"multiple-phones"},{"level":3,"title":"Video","slug":"video"},{"level":2,"title":"Avaliable props","slug":"avaliable-props"},{"level":2,"title":"Caveats","slug":"caveats"}],"relativePath":"guide.md"}'),v={name:"guide.md"},q=Object.assign(v,{setup(m){const p=c(null),o=c(!1);return(f,t)=>(r(),F("div",null,[C,s("p",null,[D(l,{style:{width:"100%",height:"400px"},screen:a(e)},null,8,["screen"])]),h,s("p",null,[D(l,{style:{width:"100%",height:"400px"},screen:[a(e),a(e)],position:[{x:-50},{x:50}],rotation:[{},{y:-.3,z:-.06}]},null,8,["screen","rotation"])]),u,s("p",null,[o.value?(r(),i(l,{key:0,style:{width:"100%",height:"400px"},screen:p.value},null,8,["screen"])):y("",!0)]),s("div",null,[s("video",{src:a(d),ref_key:"videoElement",ref:p,onCanplay:t[0]||(t[0]=_=>o.value=!0),muted:"",autoplay:"",loop:"",style:{position:"fixed",top:"0",left:"0",visibility:"hidden"}},null,40,A)]),g]))}});export{x as __pageData,q as default};