Skip to main content

Iframe Modal Integration

This guide will walk you through how to create a pop-over modal iFrame integration with Beauty By Holition's Neo Beauty Studio. The iFrame will allow you to display Beauty By Holition's virtual try-on technology on your website, making it easier for your customers to see how products will look on them before they buy.

The example provided in this guide dynamically creates and destroys the iFrame, preventing the page from loading slowly or using CPU resources when the iFrame is not in use. However, there are alternative ways to implement the integration based on your needs and technical capabilities.

info

We recommend setting the iFrame to at least 600px in height and 400px wide. You can see a live demo of the integration in action by visiting the following link: https://sandbox.holitionbeauty.com/neo.html

important

Without camera access, the virtual makeup experience cannot operate. It's essential to integrate the iframe with the following parameter: allow="camera". If you are integrating the Neo Beauty Studio within another iframe, both the Neo Beauty Studio and the parent iframe should include the allow="camera" parameter.

Steps to Create the Demo

To create the Neo Beauty Studio iFrame integration example, the following steps were taken. These steps will help you understand the process that was followed to create the demo and guide you in creating your own integration.

  1. Created HTML file with necessary elements such as logo, text, button, and modal.
  2. Added CSS to style the elements and create a responsive design.
  3. Write JavaScript to handle the creation and destruction of the iFrame in the modal.
  4. Obtained the necessary deployment URL, CMS client ID, and product filter string from our team.
  5. Integrated these values into the JavaScript code to dynamically create the iFrame URL.

Now, let's dive into the details of each step.

Here's an example of the HTML code required to create the iFrame:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Neo Beauty Studio iFrame Modal Integration Example</title>
</head>
<body>
<!-- BBH Logo and title -->
<img src="./img/new_logo.png" alt="BBH Logo" />
<div class="text-container">
<h1>Neo Beauty Studio iFrame Modal Integration Example</h1>

<!-- Introduction -->
<p>
This example demonstrates how to create a modal iFrame that integrates
with Beauty By Holition's Neo Beauty Studio. <br /><br />
For full documentation, please visit
<a href="https://vto.holitionbeauty.com/branch/V2/develop/vto-docs/docs/intro"
>docs</a
>. <br /><br />Visit our
<a href="https://holitionbeauty.com/">website</a> for more information.
</p>

<!-- Button to open modal -->
<button id="myBtn">Open iFrame Modal</button>
</div>

<!-- Modal window for iFrame -->
<div id="myModal" class="modal">
<div class="modal-wrap">
<span class="close-text">CLOSE</span>
<span class="close-button">&times;</span>
<iframe id="bbh-iframe" frameborder="0" allow="camera"></iframe>
</div>
</div>
</body>
</html>

Please note that you will need to replace the following parameters in the iframe.src URL with your specific values provided by us:

  • <DEPLOYMENT-URL>: Replace with the URL provided by us for your brand's Neo Beauty Studio deployment.
  • <CMS-CLIENT-ID>: Replace with the CMS client ID provided by us for your brand's account.
  • <PRODUCT-FILTER-STRING>: Replace with the product filter string that matches the products you want to display in the iFrame. This will be provided by us for your specific use case.