guandan.dev

guandan.dev

https://git.tonybtw.com/guandan.dev.git git://git.tonybtw.com/guandan.dev.git
1,274 bytes raw
1
import React from 'react'
2
import ReactDOM from 'react-dom/client'
3
import App from './App'
4
5
const style = document.createElement('style')
6
style.textContent = `
7
  * {
8
    margin: 0;
9
    padding: 0;
10
    box-sizing: border-box;
11
  }
12
  html, body, #root {
13
    height: 100%;
14
    overflow: hidden;
15
  }
16
  body {
17
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
18
    background-color: #1a1a2e;
19
    -webkit-tap-highlight-color: transparent;
20
    -webkit-touch-callout: none;
21
    touch-action: manipulation;
22
  }
23
  ::-webkit-scrollbar {
24
    width: 4px;
25
    height: 4px;
26
  }
27
  ::-webkit-scrollbar-track {
28
    background: transparent;
29
  }
30
  ::-webkit-scrollbar-thumb {
31
    background: rgba(255,255,255,0.2);
32
    border-radius: 2px;
33
  }
34
  button {
35
    -webkit-tap-highlight-color: transparent;
36
  }
37
`
38
document.head.appendChild(style)
39
40
const viewport = document.querySelector('meta[name="viewport"]')
41
if (!viewport) {
42
  const meta = document.createElement('meta')
43
  meta.name = 'viewport'
44
  meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover'
45
  document.head.appendChild(meta)
46
}
47
48
ReactDOM.createRoot(document.getElementById('root')!).render(
49
  <React.StrictMode>
50
    <App />
51
  </React.StrictMode>
52
)