about summary refs log tree commit diff
path: root/bskylink/src/html/linkWarningLayout.ts
blob: 2d5361019305e2735c03744c83fb1dc0699f13bc (plain) (blame)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import escapeHTML from 'escape-html'

export function linkWarningLayout(
  title: string,
  containerContents: string,
): string {
  return `
    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="UTF-8" />
        <meta
          http-equiv="Cache-Control"
          content="no-store, no-cache, must-revalidate, max-age=0" />
        <meta http-equiv="Pragma" content="no-cache" />
        <meta http-equiv="Expires" content="0" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>${escapeHTML(title)}</title>
        <style>
          * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
          }
          body {
            font-family:
              -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial,
              sans-serif;
            background-color: #ffffff;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
          }
          .container {
            width: 100%;
            max-width: 400px;
            text-align: center;
          }
          .warning-icon {
            font-size: 48px;
            margin-bottom: 16px;
          }
          h1 {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 12px;
            color: #000000;
          }
          .warning-text {
            font-size: 15px;
            color: #536471;
            line-height: 1.4;
            margin-bottom: 24px;
            padding: 0 20px;
          }
          .blocked-site {
            background-color: #f7f9fa;
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 24px;
            text-align: left;
            word-break: break-all;
          }
          .site-name {
            font-size: 16px;
            font-weight: 500;
            color: #000000;
            margin-bottom: 4px;
            word-break: break-word;
            display: block;
            text-align: center;
          }
          .site-url {
            font-size: 14px;
            color: #536471;
            word-break: break-all;
            display: block;
            text-align: center;
          }
          .button {
            border: none;
            border-radius: 24px;
            padding: 12px 32px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            max-width: 280px;
            transition: background-color 0.2s;
          }
          .primary {
            background-color: #1d9bf0;
            color: white;
          }
          .secondary {
          }
          .back-button:hover {
            background-color: #1a8cd8;
          }
          .back-button:active {
            background-color: #1681c4;
          }
          @media (max-width: 480px) {
            .warning-text {
              padding: 0 10px;
            }
            .blocked-site {
              padding: 8px;
            }
          }
        </style>
      </head>
      <body>
        <div class="container">${containerContents}</div>
      </body>
    </html>
  `
}