2.10.5 • Published 8 months ago

@epigraph/ar v2.10.5

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

epigraph-ar

Epigraph's custom web component for AR based on Google's <model-viewer>

Examples

<epigraph-ar sku="some-valid-sku" ua-code="some-valid-ua-code" ar-modes="scene-viewer quick-look"></epigraph-ar>
<epigraph-ar viewer-visible sku="some-valid-sku" ua-code="some-valid-ua-code" button-mode="none"></epigraph-ar>
<epigraph-ar viewer-visible sku="some-valid-sku" ua-code="some-valid-ua-code" button-mode="none" material-variant-selector-visible></epigraph-ar>
<!-- NOTE: only supported on Android Devices compatible with WebXR -->
<epigraph-ar viewer-visible sku="some-valid-sku" ua-code="some-valid-ua-code" ar-modes="webxr scene-viewer quick-look" material-variant-selector-visible></epigraph-ar>
<epigraph-ar viewer-visible sku="some-valid-sku" ua-code="some-valid-ua-code" button-mode="none" product-tour-visible></epigraph-ar>
<epigraph-ar viewer-visible sku="some-valid-sku" ua-code="some-valid-ua-code" product-tour-visible></epigraph-ar>
<epigraph-ar>
<element slot="slot-name"></element>
<epigraph-ar>
epigraph-ar::part(part-name) {
some-rule: some-value;
}
epigraph-ar {
--some-css-property: some-new-value;
}
const epigraphAR = document.querySelector('epigraph-ar');

epigraphAR.addEventListener('event-name', () => {
doSomething();
})

Properties

PropertyAttributeModifiersTypeDefaultDescription
arButtonModeAttributebutton-modestring"mobile desktop"sets ar button modes for the ar-button, maps to the enumerationempty string - NONEmobile - MOBILEdesktop - DESKTOPmobile desktop - BOTH
arModesar-modesstring"scene-viewer quick-look"sets ar modes for the ar experiencewebxr/scene-viewer - androidquick-look - iOS
autoStartauto-startbooleanfalseused to load the 3D viewer automatically on desktop
cameraOrbitcamera-orbitstring"55deg 69deg auto"sets the viewer camera orbit values
canActivateARreadonlybooleanpublic method to get ar-capability status
interactionPromptThresholdinteraction-prompt-thresholdnumber3000modifies amount of idling time before interaction prompt appears
materialVariantSelectorVisiblematerial-variant-selector-visiblebooleanfalsesets visibility of material variant selector
namestring"EPIGRAPH-AR"name to be used for the internal logging service
posterBackgroundposterstring""sets the source url for the poster background
posterForegroundposter-foregroundstring""sets the source url for the icon to display on top of the poster
productTourVisibleproduct-tour-visiblebooleanfalsesets visibility of product tour
shadowIntensityshadow-intensitynumber1modifies the shadow intensity of the model
skuskustring""to be used with epigraph product skus
themethemestring"default"used to indicate UI/UX themes
uaCodeua-codestring""to be used with client ua-code
verboseLoggingverbose-loggingbooleanfalseused to log debugging information
viewerVisibleviewer-visiblebooleanfalsesets visibility of the 3D viewerTODO: set a method call to toggle this property based on response from mediator

Methods

MethodTypeDescription
dismissPoster(): voidpublic method to dismiss viewer poster
showPoster(): voidpublic method to show viewer poster

Events

EventTypeDescription
epigraph-ar-capability-determinedCustomEvent<{ canActivateAr: boolean; }>custom event to indicate whether the device is AR capable
epigraph-invalid-productcustom event to indicate product associated with the sku is invalid
epigraph-valid-productcustom event to indicate product associated with the sku is valid

Slots

NameDescription
ar-buttonreplaces the ar-button but maintains the onclick function
posterreplaces the viewer poster- <qr-modal>:
progress-barreplaces the progress indicator
qr-modal-closereplaces the qr-modal close button
qr-modal-donereplaces the qr-modal done button
qr-modal-instructionreplaces the qr-modal instruction
qr-modal-requirementreplaces the qr-modal requirement
qr-modal-titlereplaces the qr-modal title

CSS Shadow Parts

PartDescription
default-ar-buttonpoints to the default ar button
default-poster-backgroundpoints to the default poster background- <qr-modal>:
default-poster-foregroundpoints to the default poster icon
hotspot-buttonpoints to the hotspot buttons
hotspot-button-annotationpoints to the hotspot button annotation
hotspot-button-inner-circlepoints to the inner circle of the hotspot button
material-variant-selectorpoints to the <material-variant-selector> element
material-variant-selector-buttonpoints to the selector buttons themselves- <product-tour>:
material-variant-selector-containerpoints to the container housing the selectors
model-viewerpoints to the <model-viewer> element
poster-foregroundpoints to the poster icon
product-tourpoints to the <product-tour> element
product-tour-carousel-imagepoints to the images inside the image carousel
product-tour-close-containerpoints to the close button container in the product tour
product-tour-close-defaultpoints to the default close button in the product tour
product-tour-containerpoints to the main container of the product tour
product-tour-feature-descriptionpoints to the feature description in the product tour
product-tour-feature-text-containerpoints to the feature text container in the product tour
product-tour-feature-titlepoints to the feature title in the product tour
product-tour-image-carouselpoints to the image carousel in the product tour
product-tour-image-carousel-containerpoints to the image carousel container in the product tour
product-tour-image-carousel-dotpoints to the image carousel controls in the product tour
product-tour-image-carousel-dots-containerpoints to the image carousel controls container in the product tour
product-tour-image-title-containerpoints to the image title container in the product tour
qr-modalpoints to the <qr-modal> element
qr-modal-backgroundpoints to the modal background
qr-modal-close-defaultpoints to the default close button in the qr-modal
qr-modal-containerpoints to the main modal
qr-modal-done-defaultpoints to the default done button in the qr-modal- <material-variant-selector>:
qr-modal-instruction-defaultpoints to the default instruction in the qr-modal
qr-modal-qr-containerpoints to the qr container within the qr-modal
qr-modal-qr-imagepoints to the qr image in the modal
qr-modal-requirement-defaultpoints to the default requirement in the qr-modal
qr-modal-title-defaultpoints to the default title in the qr-modal

CSS Custom Properties

PropertyDescription
--ar-button-active-background-coloredits ar-button background color when clicked
--ar-button-background-coloredits ar-button background color
--ar-button-border-coloredits ar-button border color
--ar-button-hover-background-coloredits ar-button background color when hovered
--ar-button-hover-text-coloredits ar-button text color when hovered
--ar-button-text-coloredits ar-button text color
--ar-icon-frame-coloredits ar-icon frame color
--ar-icon-hover-frame-coloredits ar-icon frame color when hovered
--ar-icon-hover-vector-1-coloredits ar-icon vector 1 color when hovered
--ar-icon-hover-vector-2-coloredits ar-icon vector 2 color when hovered
--ar-icon-hover-vector-3-coloredits ar-icon vector 3 color when hovered
--ar-icon-vector-1-coloredits ar-icon vector 1 (top face) color
--ar-icon-vector-2-coloredits ar-icon vector 2 (left face) color
--ar-icon-vector-3-coloredits ar-icon vector 3 (right face) color
--hotspot-button-background-coloredits hotspot button background color
--hotspot-button-border-coloredits hotspot button border color
--hotspot-button-focus-border-coloredits hotspot button border color when focused
--hotspot-inner-circle-border-coloredits hotspot button inner circle border color
--hotspot-inner-circle-viewed-border-coloredits hotspot button inner circle border color when viewed- <qr-modal>:
--mobile-product-tour-button-background-coloredits product-tour mobile button background color
--mobile-product-tour-button-text-coloredits product-tour mobile button text color
--product-tour-background-coloredits product-tour background color
--product-tour-close-button-fill-coloredits product-tour close button fill color
--product-tour-close-button-hover-fill-coloredits product-tour close button fill color when hovered
--product-tour-close-button-hover-stroke-coloredits product-tour close-button stroke color when hovered
--product-tour-close-button-stroke-coloredits product-tour close-button stroke color
--product-tour-current-dot-background-coloredits product-tour control dot background color when it points to a current image
--product-tour-dot-background-coloredits product-tour control dot background color
--product-tour-mobile-close-button-outline-coloredits product-tour mobile close button outline color
--product-tour-mobile-close-button-stroke-coloredits product-tour mobile close button stroke color
--progress-ring-coloredits the progress ring color
--progress-ring-radiusedits the progress ring radius
--progress-ring-thicknessedits the progress ring thickness
--qr-modal-close-button-stroke-coloredits qr-modal close button stroke color
--qr-modal-done-button-active-background-coloredits qr-modal done button background color when clicked
--qr-modal-done-button-background-coloredits qr-modal done button background color
--qr-modal-done-button-border-coloredits qr-modal done button border color- <product-tour>:
--qr-modal-done-button-hover-background-coloredits qr-modal done button background color when hovered
--qr-modal-done-button-hover-text-coloredits qr-modal done button text color when hovered
--qr-modal-done-button-text-coloredits qr-modal done button text color
--qr-modal-instruction-coloredits qr-modal instruction text color
--qr-modal-requirement-coloredits qr-modal requirement text color
--qr-modal-title-coloredits qr-modal title text color
2.10.5

10 months ago

2.10.6-beta

8 months ago

2.8.1

1 year ago

2.8.0

1 year ago

2.9.2

1 year ago

2.9.1

1 year ago

2.9.3

1 year ago

2.10.1

11 months ago

2.10.2

11 months ago

2.10.0

12 months ago

2.7.0

1 year ago

2.10.3

11 months ago

2.10.4

11 months ago

2.6.0

1 year ago

2.9.0

1 year ago

2.4.10

1 year ago

2.4.12

1 year ago

2.4.11

1 year ago

2.4.9

1 year ago

2.4.8

1 year ago

2.5.0

1 year ago

2.5.2

1 year ago

2.5.1

1 year ago

2.4.1

2 years ago

2.4.0

2 years ago

2.4.3

2 years ago

2.4.2

2 years ago

2.3.23

2 years ago

2.4.5

2 years ago

2.4.4

2 years ago

2.3.20

2 years ago

2.3.22

2 years ago

2.3.21

2 years ago

2.4.7

1 year ago

2.4.6

2 years ago

2.3.17

2 years ago

2.3.16

2 years ago

2.3.19

2 years ago

2.3.18

2 years ago

2.3.15

2 years ago

2.3.14

2 years ago

2.3.8

2 years ago

2.3.7

2 years ago

2.3.9

2 years ago

2.3.4

2 years ago

2.3.3

2 years ago

2.3.6

2 years ago

2.3.5

2 years ago

2.3.13

2 years ago

2.3.12

2 years ago

2.3.11

2 years ago

2.3.10

2 years ago

2.3.0

2 years ago

2.3.2

2 years ago

2.3.1

2 years ago

2.2.1

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.0

2 years ago

2.1.1

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

2.1.0

2 years ago

2.0.0-beta.1

2 years ago

2.0.0-alpha.7

3 years ago

2.0.0-alpha.6

3 years ago

2.0.0-alpha.3

3 years ago

2.0.0-alpha.4

3 years ago

2.0.0-alpha.5

3 years ago

2.0.0-alpha.1

3 years ago

2.0.0-alpha.2

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago