Giter Site home page Giter Site logo

elfsquad / showroom-iframe Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 27 KB

This package allows easy embedding of the Elfsquad showroom into websites ๐ŸŒ

Home Page: https://docs.elfsquad.io/docs/configurator/libraries/elfsquad-showroom-iframe-library

License: MIT License

Makefile 0.82% HTML 9.84% TypeScript 53.57% JavaScript 35.78%
elfsquad configurator cpq

showroom-iframe's Introduction

๐Ÿฐ Elfsquad showroom iframe

๐Ÿ›  Installation

npm install --save @elfsquad/showroom-iframe
<script type="importmap>
{
  "imports": {
    "@elfsquad/showroom-iframe": "https://cdn.skypack.dev/@elfsquad/[email protected]"
  }
}
</script>

๐Ÿ–ฅ๏ธ Usage

This package exposes the ElfsquadShowroom class. This class can be used for creating & communicating with the iframe.

Example:

import { ElfsquadShowroom } from "@elfsquad/showroom-iframe";
const container = document.createElement("div");
document.body.appendChild(container);

const elfsquad = new ElfsquadShowroom({
  container: container,
  url: "https://automotive.elfsquad.io/configure/Elfsquad%20carrosserie"
});

๐Ÿ“ธ Trigger a screenshot

elfsquad.screenshot();

๐Ÿ”„ Reset the camera position

elfsquad.home()

๐Ÿ”ณ Toggle the footprint visibility

elfsquad.toggleFootprint();

๐Ÿ“ฃ Handle screenshot event

import { ScreenshotCallback } from "@elfsquad/showroom-iframe";
const callback: ScreenshotCallback = ({image}) => {
    console.log('image: ', image);
}
elfsquad.onScreenshot(callback);

๐Ÿ“ Handle quotation request event

import { RequestQuoteCallback } from "@elfsquad/showroom-iframe";
const callback: RequestQuoteCallback = ({configurationId}) => {
    console.log('configurationId: ', configurationId);
}
elfsquad.onRequestQuote(callback);

๐Ÿค Contributing

We welcome contributions! Please feel free to fork the repository, make your changes, and submit a pull request.

โš–๏ธ License

Licensed under MIT. See the LICENSE file in the repository for full details.

๐ŸŽ‰ Acknowledgements

A big thank you to everyone who contributes to the ongoing development and maintenance of this package.

showroom-iframe's People

Contributors

stanvanrooy avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.