Skip to content

Commit

Permalink
Refined the index page (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
predatorray authored Dec 19, 2024
1 parent 029e1ac commit 75fdcb7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Mental Texas Hold'em"
content="A mental poker implementation of Texas Hold'em"
/>
<meta name="keywords" content="poker, game, texas holdem">
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand Down
11 changes: 10 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ReactDOM from 'react-dom/client';
import './index.css';
import reportWebVitals from './reportWebVitals';
import App from "./App";
import {Metric} from "web-vitals";

const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
Expand All @@ -16,4 +17,12 @@ root.render(
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
function sendToAnalytics(metric: Metric) {
const { id, name, value } = metric;
gtag('event', name, {
event_category: 'Web Vitals',
event_label: id,
value: Math.round(name === 'CLS' ? value * 1000 : value), // values must be integers
});
}
reportWebVitals(sendToAnalytics);

0 comments on commit 75fdcb7

Please sign in to comment.