diff --git a/website/o3dv/css/core.css b/website/o3dv/css/core.css index 57ff0e3..274393b 100644 --- a/website/o3dv/css/core.css +++ b/website/o3dv/css/core.css @@ -1,3 +1,8 @@ +:root +{ + --ov_only_on_model_display: inherit; +} + @font-face { font-family: Quicksand; @@ -28,6 +33,11 @@ img display: block; } +.only_on_model +{ + display: var(--ov_only_on_model_display); +} + @media (hover) { diff --git a/website/o3dv/js/utils.js b/website/o3dv/js/utils.js index 14cdf06..7a3596d 100644 --- a/website/o3dv/js/utils.js +++ b/website/o3dv/js/utils.js @@ -18,29 +18,17 @@ OV.GetMaterialName = function (originalName) OV.IsHoverEnabled = function () { - if (window.matchMedia ('(hover : hover)').matches) { - return true; - } else { - return false; - } + return window.matchMedia ('(hover: hover)').matches; }; OV.IsSmallWidth = function () { - if (window.matchMedia ('(max-width : 700px)').matches) { - return true; - } else { - return false; - } + return window.matchMedia ('(max-width: 700px)').matches; }; OV.IsSmallHeight = function () { - if (window.matchMedia ('(max-height : 700px)').matches) { - return true; - } else { - return false; - } + return window.matchMedia ('(max-height: 700px)').matches; }; OV.InstallTooltip = function (item, text) diff --git a/website/o3dv/js/website.js b/website/o3dv/js/website.js index 1f3dc40..9c4d7cf 100644 --- a/website/o3dv/js/website.js +++ b/website/o3dv/js/website.js @@ -84,18 +84,33 @@ OV.Website = class this.viewer.Resize (contentWidth, contentHeight); } + HasLoadedModel () + { + return this.model !== null; + } + SetUIState (uiState) { + function ShowOnlyOnModelElements (show) + { + let root = document.querySelector (':root'); + root.style.setProperty ('--ov_only_on_model_display', show ? 'inherit' : 'none'); + } + if (uiState === OV.WebsiteUIState.Intro) { this.parameters.introDiv.show (); this.parameters.mainDiv.hide (); + ShowOnlyOnModelElements (false); } else if (uiState === OV.WebsiteUIState.Model) { this.parameters.introDiv.hide (); this.parameters.mainDiv.show (); + ShowOnlyOnModelElements (true); } else if (uiState === OV.WebsiteUIState.Loading) { this.parameters.introDiv.hide (); this.parameters.mainDiv.hide (); + ShowOnlyOnModelElements (false); } + this.Resize (); }