forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
87 lines (80 loc) · 1.8 KB
/
index.js
File metadata and controls
87 lines (80 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import { createOverlay } from './overlay-manager';
import { requestPreviewSecretFromApp } from '../preview-secret';
const HTML = `
<style>
body {
font-family: "Roboto", sans-serif;
background-color: #1d2022;
width: 100vw;
height: 100vh;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-smoothing: antialiased;
text-rendering: optimizeLegibility;
font-smooth: always;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
min-height: 100%;
-webkit-text-size-adjust: 100%;
line-height: 1.4;
overflow: hidden;
}
.container {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-ms-flex-direction: column;
flex-direction: column;
margin: 0 auto;
max-width: 530px;
height: 100%;
}
.title {
color: #efefef;
font-size: 3rem;
width: 100%;
font-weight: 600;
text-align: center;
margin-bottom: 1rem;
}
.description {
color: #eeeeee;
font-size: 1.5rem;
width: 100%;
font-weight: 300;
text-align: center;
margin-top: 0;
}
button {
text-decoration: none;
color: #40a9f3;
outline: none;
border: none;
background: transparent;
padding: 0;
margin: 0;
cursor: pointer;
font-size: 1em;
}
</style>
<div class="container">
<h1 class="title">404</h1>
<p class="description">
We could not find the sandbox you’re looking for, did you try
<button id="sign-in-button">signing in</button>?
</p>
</div>
`;
export async function show404(sandboxId) {
const windowRef = await createOverlay(HTML);
windowRef.contentDocument.getElementById('sign-in-button').onclick = () => {
requestPreviewSecretFromApp(sandboxId);
};
}