Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add some default styling to DOM-Overlay
  • Loading branch information
AdaRoseCannon committed Aug 11, 2021
commit a55f530cd858a5593f892197d35dbaab3a04c810
17 changes: 0 additions & 17 deletions examples/boilerplate/webxr-ar-lighting/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,6 @@
body {
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}


#dom-overlay {
overflow: hidden;
position: absolute;
pointer-events: none;
box-sizing: border-box;
bottom: 0;
left: 0;
right: 0;
top: 0;
padding: 1em;
}

#dom-overlay>* {
pointer-events: auto;
}
</style>
</head>

Expand Down
16 changes: 16 additions & 0 deletions src/style/aframe.css
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,19 @@ a-scene audio {
background-color: #00ceff;
width: 100%;
}

.a-dom-overlay:not(.a-no-style) {
overflow: hidden;
position: absolute;
pointer-events: none;
box-sizing: border-box;
bottom: 0;
left: 0;
right: 0;
top: 0;
padding: 1em;
}

.a-dom-overlay:not(.a-no-style)>* {
pointer-events: auto;
}
2 changes: 2 additions & 0 deletions src/systems/webxr.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ module.exports.System = registerSystem('webxr', {
};
this.sessionReferenceSpaceType = data.referenceSpaceType;

data.overlayElement.classList.remove('a-dom-overlay');
if (data.overlayElement) {
this.warnIfFeatureNotRequested('dom-overlay');
this.sessionConfiguration.domOverlay = {root: data.overlayElement};
data.overlayElement.classList.add('a-dom-overlay');
}
},

Expand Down