File tree Expand file tree Collapse file tree 3 files changed +66
-10
lines changed Expand file tree Collapse file tree 3 files changed +66
-10
lines changed Original file line number Diff line number Diff line change 57
57
< div class ="permission-denied-text-container ">
58
58
< div class ="permission-denied-text " id ="camera_denied ">
59
59
< p > Please reload and allow camera access to use this app.</ p >
60
- < button id ="camera-denied-button " class ="info-button ">
60
+ < a
61
+ class ="permission-denied-button "
62
+ href ="https://www.deepar.ai/projects "
63
+ target ="__blank "
64
+ >
61
65
Discover more
62
- </ button >
66
+ </ a >
63
67
</ div >
64
68
</ div >
65
69
</ div >
Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ canvas.deepar {
11
11
body {
12
12
margin : 0px ;
13
13
padding : 0px ;
14
+ font-family : sans-serif;
14
15
}
15
16
16
17
# loading-screen ,
17
18
# permission-denied-screen ,
18
19
# permission-denied-background {
19
20
background-color : rgb (17 24 39 / 1 );
20
- background-image : url ("/images/gradient.svg" ),
21
- url ("/images/bg-grid-dark.svg" );
21
+ background-image : url ("/images/gradient.svg" ), url ("/images/bg-grid-dark.svg" );
22
22
background-repeat : no-repeat, repeat;
23
23
display : flex;
24
24
align-items : center;
@@ -174,4 +174,47 @@ body {
174
174
background : rgb (0 98 209 / 1 );
175
175
height : 100% ;
176
176
transition : width 5s ease-out;
177
- }
177
+ }
178
+
179
+ /* Permission denied screen */
180
+
181
+ .permission-denied-text-container {
182
+ position : absolute;
183
+ left : 50% ;
184
+ top : 50% ;
185
+ transform : translateX (-50% ) translateY (-50% );
186
+ width : 100% ;
187
+ display : flex;
188
+ align-items : center;
189
+ justify-content : center;
190
+ flex-direction : column;
191
+ text-align : center;
192
+ }
193
+
194
+ .permission-denied-text {
195
+ width : 400px ;
196
+ max-width : 95% ;
197
+ font-size : 16px ;
198
+ line-height : 1.2 ;
199
+ color : # fff ;
200
+ }
201
+
202
+ .permission-denied-button {
203
+ margin-top : 20px ;
204
+ padding : 10px 20px ;
205
+ border-radius : 4px ;
206
+ background-color : # fff ;
207
+ color : # 000 ;
208
+ font-size : 16px ;
209
+ font-weight : 500 ;
210
+ cursor : pointer;
211
+ transition : background-color 0.2s ease;
212
+ border : none;
213
+ display : inline-block;
214
+ text-decoration : none;
215
+ width : fit-content;
216
+
217
+ & : hover {
218
+ background-color : # eaeaea ;
219
+ }
220
+ }
Original file line number Diff line number Diff line change @@ -37,12 +37,21 @@ console.log("Deepar version: " + deepar.version);
37
37
"effects/Fire_Effect.deepar" ,
38
38
] ;
39
39
40
+ let deepAR = null ;
41
+
40
42
// Initialize DeepAR with an effect file.
41
- const deepAR = await deepar . initialize ( {
42
- licenseKey : "your_license_key_goes_here" ,
43
- canvas,
44
- effect : effectList [ 0 ] ,
45
- } ) ;
43
+ try {
44
+ deepAR = await deepar . initialize ( {
45
+ licenseKey : "your_license_key_goes_here" ,
46
+ canvas,
47
+ effect : effectList [ 0 ] ,
48
+ } ) ;
49
+ } catch ( error ) {
50
+ console . error ( error ) ;
51
+ document . getElementById ( "loading-screen" ) . style . display = "none" ;
52
+ document . getElementById ( "permission-denied-screen" ) . style . display = "block" ;
53
+ return ;
54
+ }
46
55
47
56
var resizeCanvas = function ( ) {
48
57
const canvas = document . getElementById ( "deepar-canvas" ) ;
You can’t perform that action at this time.
0 commit comments