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",
|
"resolve-url-loader": "^3.1.1",
|
||||||
"sass": "^1.27.0",
|
"sass": "^1.27.0",
|
||||||
"sass-loader": "^8.0.2",
|
"sass-loader": "^8.0.2",
|
||||||
"sdf-2d": "^0.7.1",
|
"sdf-2d": "^0.7.3",
|
||||||
"source-map-loader": "^1.1.1",
|
"source-map-loader": "^1.1.1",
|
||||||
"svg-url-loader": "^6.0.0",
|
"svg-url-loader": "^6.0.0",
|
||||||
"ts-config-webpack-plugin": "^2.0.0",
|
"ts-config-webpack-plugin": "^2.0.0",
|
||||||
|
|
|
||||||
13
src/index.ts
13
src/index.ts
|
|
@ -26,10 +26,11 @@ glMatrix.setMatrixArrayType(Array);
|
||||||
removeUnnecessaryOutlines();
|
removeUnnecessaryOutlines();
|
||||||
|
|
||||||
const canvas = document.querySelector('canvas') as HTMLCanvasElement;
|
const canvas = document.querySelector('canvas') as HTMLCanvasElement;
|
||||||
|
const logo = document.querySelector('#info') as HTMLElement;
|
||||||
const canvasContainer = document.querySelector('#canvas-container') as HTMLCanvasElement;
|
const canvasContainer = document.querySelector('#canvas-container') as HTMLCanvasElement;
|
||||||
const errorText = document.querySelector('#error-text') as HTMLParamElement;
|
const errorText = document.querySelector('#error-text') as HTMLParamElement;
|
||||||
const errorsContainer = document.querySelector('#errors-container') as HTMLDivElement;
|
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 minimizeButton = document.querySelector('#minimize') as HTMLElement;
|
||||||
const maximizeButton = document.querySelector('#maximize') as HTMLElement;
|
const maximizeButton = document.querySelector('#maximize') as HTMLElement;
|
||||||
const overlay = document.querySelector('#overlay') as HTMLDivElement;
|
const overlay = document.querySelector('#overlay') as HTMLDivElement;
|
||||||
|
|
@ -45,7 +46,15 @@ const handleTextToggle = () => {
|
||||||
toggleButton.classList.add('off');
|
toggleButton.classList.add('off');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
toggleButton.addEventListener('click', handleTextToggle);
|
|
||||||
|
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();
|
handleTextToggle();
|
||||||
|
|
||||||
const startInsightsSession = async (): Promise<(data: any) => unknown> => {
|
const startInsightsSession = async (): Promise<(data: any) => unknown> => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue