+html.tsx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import { ScrollViewStyleReset } from 'expo-router/html';
  2. import type {PropsWithChildren} from 'react';
  3. // This file is web-only and used to configure the root HTML for every
  4. // web page during static rendering.
  5. // The contents of this function only run in Node.js environments and
  6. // do not have access to the DOM or browser APIs.
  7. export default function Root({ children }: PropsWithChildren) {
  8. return (
  9. <html lang="en">
  10. <head>
  11. <meta charSet="utf-8" />
  12. <meta httpEquiv="X-UA-Compatible" content="IE=edge" />
  13. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
  14. {/*
  15. Disable body scrolling on web. This makes ScrollView components work closer to how they do on native.
  16. However, body scrolling is often nice to have for mobile web. If you want to enable it, remove this line.
  17. */}
  18. <ScrollViewStyleReset />
  19. {/* Add any additional <head> elements that you want globally available on web... */}
  20. </head>
  21. <body>
  22. <style
  23. dangerouslySetInnerHTML={{
  24. __html:`
  25. html,
  26. body {
  27. min-height: 100%;
  28. margin: 0;
  29. }
  30. * {
  31. scrollbar-width: none;
  32. -ms-overflow-style: none;
  33. }
  34. ::-webkit-scrollbar {
  35. display: none;
  36. width: 0;
  37. height: 0;
  38. }
  39. @media (min-width: 448px) {
  40. body {
  41. background:
  42. radial-gradient(circle at top, rgba(96, 165, 250, 0.18), transparent 32%),
  43. linear-gradient(180deg, #172554 0%, #0f172a 55%, #020617 100%);
  44. }
  45. #root {
  46. max-width: 448px;
  47. margin: 0 auto;
  48. background: #ffffff;
  49. min-height: 100vh;
  50. overflow: hidden;
  51. border-radius: 24px;
  52. border: 1px solid rgba(255, 255, 255, 0.08);
  53. box-shadow:
  54. 0 36px 90px rgba(2, 6, 23, 0.46),
  55. 0 18px 34px rgba(15, 23, 42, 0.28),
  56. inset 0 1px 0 rgba(255, 255, 255, 0.9),
  57. inset 0 -1px 0 rgba(15, 23, 42, 0.06);
  58. }
  59. }`
  60. }}
  61. />
  62. <div id="root">
  63. {children}
  64. </div>
  65. </body>
  66. </html>
  67. );
  68. }