Browse Source

FE: AirGap: Remove internet dependency / google fonts (#3602)

* improvement/offline-fonts remove google fonts, add local fonts with font-face

* improvement/offline-fonts add font-display rule

* improvement/offline-fonts fix fonts path resolving
Nail Badiullin 2 years ago
parent
commit
0ff7e63386

+ 29 - 7
kafka-ui-react-app/index.html

@@ -3,13 +3,6 @@
   <head>
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1" />
-    <!-- Google fonts -->
-    <link rel="preconnect" href="https://fonts.googleapis.com" />
-    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
-    <link
-      href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Roboto+Mono:wght@400;500&display=swap"
-      rel="stylesheet"
-    />
 
     <!-- Favicons -->
     <link rel="icon" href="<%= PUBLIC_PATH %>/favicon/favicon.ico" sizes="any" />
@@ -25,6 +18,35 @@
         return window.basePath+ "/" + importer;
       };
     </script>
+    <style>
+      @font-face {
+        font-family: 'Inter';
+        src: url('<%= PUBLIC_PATH %>/fonts/Inter-Medium.ttf') format('truetype');
+        font-weight: 500;
+        font-display: swap;
+      }
+
+      @font-face {
+        font-family: 'Inter';
+        src: url('<%= PUBLIC_PATH %>/fonts/Inter-Regular.ttf') format('truetype');
+        font-weight: 400;
+        font-display: swap;
+      }
+
+      @font-face {
+        font-family: 'Roboto Mono';
+        src: url('<%= PUBLIC_PATH %>/fonts/RobotoMono-Medium.ttf') format('truetype');
+        font-weight: 500;
+        font-display: swap;
+      }
+
+      @font-face {
+        font-family: 'Roboto Mono';
+        src: url('<%= PUBLIC_PATH %>/fonts/RobotoMono-Regular.ttf') format('truetype');
+        font-weight: 400;
+        font-display: swap;
+      }
+    </style>
   </head>
 
   <body>

BIN
kafka-ui-react-app/public/fonts/Inter-Medium.ttf


BIN
kafka-ui-react-app/public/fonts/Inter-Regular.ttf


BIN
kafka-ui-react-app/public/fonts/RobotoMono-Medium.ttf


BIN
kafka-ui-react-app/public/fonts/RobotoMono-Regular.ttf