Skip to content

PhantomVRTranslate/PhantomScripts

Repository files navigation

PhantomScripts

Preview a 3D rendering of your VR HTML page

  • Early Stage proof of concept where users can render image, texts, and video content in a 3d environment using specified semantic class names and attributes with PhantomScripts

Phantom Class Names and Attributes

  • By adding these semantic tags to your specified content, Phantom will be able to locate these tags and render their contents within the VR environment seamlessly

text-vr class name

put text content into the innerHTML of a text element to render the text

  • Text with over 120 characters will have multiple pages (< & > page buttons will render if there are multiple pages)
<p class="text-vr">This will be rendered in its own text card!</p> 
<p class="text-vr">Now if I wanted to type out a giant story to show the effects 
  of what having over 120 characters would do the text component
  then I would probably use this piece of text right here
</p>

image-vr class name

put image url into src tag to render the image

<img src="https://imageUrlHere.jpg" class="image-vr" alt="" />
<div src="https://anotherImageUrlHere.jpg" class="image-vr" alt=""></div> 

video-vr class name

put video url into src tag to render the image

<video src="https://videoUrlHere.jpg" class="video-vr" alt="" />
<div src="https://anotherVideoUrlHere.jpg" class="video-vr" alt=""></div> 

carousel-image-vr class name

Use with any number of HTML tags with an image source to have all tagged content to appear within the a single 3d component

  • renders the < & > page buttons to shift through the collection
<img src="https://image1.jpg" class="image-vr" alt="" />
<img src="https://image2.jpg" class="image-vr" alt="" />
<img src="https://image3.jpg" class="image-vr"  alt="" />
<img src="https://image4.jpg" class="image-vr"  alt="" />
<img src="https://image5.jpg" class="image-vr"  alt="" />

gallery-item class name

Add this class name on up to 6 HTML tags with image or video sources to render content within a grid-gallery display

  • video and image content should be referenced in the src attribute
<img src="https://image1.jpg" class="gallery-item" alt="" />
<img src="https://video1.jpg" class="gallery-item" alt="" />
<img src="https://image2.jpg" class="gallery-item" alt="" />
<img src="https://image3.jpg" class="gallery-item"  ci-flex-vr="1" alt="" />
<img src="https://video2.jpg" class="gallery-item" alt="" />
<img src="https://video3.jpg" class="gallery-item" alt="" />

flex-vr attribute

change flex proportion of text-vr, image-vr, video-vr, and image-carousel-vr

<img src="https://imageToTakeUpMoreSpace.jpg" class="image-vr" flex-vr="2" alt="" />
<video src="https://videoToTakeLessSpace.jpg" class="video-vr" flex-vr="1" alt="" />

Getting Started

  1. Copy and Paste the subsequent code under the body tag in your HMTL page
  <script src="https://rawgit.com/PhantomVRTranslate/PhantomScripts/master/phantom.js"></script>
  1. Create a any html element with an onlcick event handler of 'startVR()' within the body of your HTML page
  • we recommend using a button
<body>
  ...
  <button onclick='startVR()'></button>
  ...
</body> 
  1. Add your our class names and attribute tags to render your content in the 3D VR Environment (visible immediately through your browser)!
<body>
  ...
  //renders single image file in its own component 
    <img src="https://image1.jpg" class="item-vr" flex-vr="2" alt="" />
  
  //renders single video file in its own component 
    <img src="https://video1.jpg" class="video-vr" alt="" />
  
  //renders multiple images and video within a gallery component 
    <img src="https://image2.jpg" class="gallery-item" alt="" />
    <img src="https://image3.jpg" class="gallery-item" alt="" />
    <img src="https://video2.jpg" class="gallery-item" alt="" />
    <img src="https://video3.jpg" class="gallery-item" alt="" />
  ...
</body>

About

Phantom scripts to put in script tags on websites.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published