Add preview mode
This commit is contained in:
parent
4b70246ce5
commit
b6665a896d
2 changed files with 12 additions and 3 deletions
|
|
@ -46,7 +46,7 @@
|
|||
"resolve-url-loader": "^3.1.1",
|
||||
"sass": "^1.27.0",
|
||||
"sass-loader": "^8.0.2",
|
||||
"sdf-2d": "^0.7.1",
|
||||
"sdf-2d": "^0.7.3",
|
||||
"source-map-loader": "^1.1.1",
|
||||
"svg-url-loader": "^6.0.0",
|
||||
"ts-config-webpack-plugin": "^2.0.0",
|
||||
|
|
|
|||
11
src/index.ts
11
src/index.ts
|
|
@ -26,10 +26,11 @@ glMatrix.setMatrixArrayType(Array);
|
|||
removeUnnecessaryOutlines();
|
||||
|
||||
const canvas = document.querySelector('canvas') as HTMLCanvasElement;
|
||||
const logo = document.querySelector('#info') as HTMLElement;
|
||||
const canvasContainer = document.querySelector('#canvas-container') as HTMLCanvasElement;
|
||||
const errorText = document.querySelector('#error-text') as HTMLParamElement;
|
||||
const errorsContainer = document.querySelector('#errors-container') as HTMLDivElement;
|
||||
const toggleButton = document.querySelector('#toggle-text');
|
||||
const toggleButton = document.querySelector('#toggle-text') as HTMLElement;
|
||||
const minimizeButton = document.querySelector('#minimize') as HTMLElement;
|
||||
const maximizeButton = document.querySelector('#maximize') as HTMLElement;
|
||||
const overlay = document.querySelector('#overlay') as HTMLDivElement;
|
||||
|
|
@ -45,7 +46,15 @@ const handleTextToggle = () => {
|
|||
toggleButton.classList.add('off');
|
||||
}
|
||||
};
|
||||
|
||||
const isInsidePortfolio =
|
||||
new URLSearchParams(location.search).get('portfolioView') !== null;
|
||||
if (isInsidePortfolio) {
|
||||
toggleButton.style.visibility = 'hidden';
|
||||
logo.style.visibility = 'hidden';
|
||||
} else {
|
||||
toggleButton.addEventListener('click', handleTextToggle);
|
||||
}
|
||||
handleTextToggle();
|
||||
|
||||
const startInsightsSession = async (): Promise<(data: any) => unknown> => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue