Skip to content

Commit

Permalink
Merge branch 'main' into nova-leaderboards
Browse files Browse the repository at this point in the history
  • Loading branch information
Kellan Wampler committed Mar 29, 2024
2 parents e095179 + f570569 commit ca67c09
Show file tree
Hide file tree
Showing 139 changed files with 6,947 additions and 657 deletions.
52 changes: 0 additions & 52 deletions api/queries/pitch_distribution.sql

This file was deleted.

2 changes: 1 addition & 1 deletion api/queries/sepolia/home_run_leaderboard.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ with dedup_events as (
DISTINCT ON(transaction_hash, log_index) *
FROM arbitrum_sepolia_labels
WHERE label='moonworm-alpha'
AND address='0x3a1Ad54d12b1f39805Ea77aFe7DeeFf2F32C97f5'
AND address='0x7Be10D395617438b78500b003d5a1D201B150D6b'
AND log_index IS NOT NULL
), AtBats as (
SELECT
Expand Down
2 changes: 1 addition & 1 deletion api/queries/sepolia/pitch_distribution.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ with dedup_events as (
DISTINCT ON(transaction_hash, log_index) *
FROM arbitrum_sepolia_labels
WHERE label='moonworm-alpha'
AND address='0x3a1Ad54d12b1f39805Ea77aFe7DeeFf2F32C97f5'
AND address='0x7Be10D395617438b78500b003d5a1D201B150D6b'
AND log_index IS NOT NULL
), SessionResolved as (
SELECT
Expand Down
2 changes: 1 addition & 1 deletion api/queries/sepolia/player_stats_atbat.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ with dedup_events as (
DISTINCT ON(transaction_hash, log_index) *
FROM arbitrum_sepolia_labels
WHERE label='moonworm-alpha'
AND address='0x3a1Ad54d12b1f39805Ea77aFe7DeeFf2F32C97f5'
AND address='0x7Be10D395617438b78500b003d5a1D201B150D6b'
AND log_index IS NOT NULL
), AtBats as (
SELECT
Expand Down
2 changes: 1 addition & 1 deletion api/queries/sepolia/strikeout_leaderboard.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ with dedup_events as (
DISTINCT ON(transaction_hash, log_index) *
FROM arbitrum_sepolia_labels
WHERE label='moonworm-alpha'
AND address='0x3a1Ad54d12b1f39805Ea77aFe7DeeFf2F32C97f5'
AND address='0x7Be10D395617438b78500b003d5a1D201B150D6b'
AND log_index IS NOT NULL
), AtBats as (
SELECT
Expand Down
2 changes: 1 addition & 1 deletion api/queries/sepolia/swing_distribution.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ with dedup_events as (
DISTINCT ON(transaction_hash, log_index) *
FROM arbitrum_sepolia_labels
WHERE label='moonworm-alpha'
AND address='0x3a1Ad54d12b1f39805Ea77aFe7DeeFf2F32C97f5'
AND address='0x7Be10D395617438b78500b003d5a1D201B150D6b'
AND log_index IS NOT NULL
), SessionResolved as (
SELECT
Expand Down
23 changes: 23 additions & 0 deletions web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@
const nextConfig = {
reactStrictMode: true,
trailingSlash: true,
images: {
unoptimized: true,
remotePatterns: [
{
protocol: "https",
hostname: "static.simiotics.com",
port: "",
pathname: "/fullcount/**",
},
{
protocol: "https",
hostname: "badges.moonstream.to",
port: "",
pathname: "/blb/**",
},
{
protocol: "https",
hostname: "badges.moonstream.to",
port: "",
pathname: "/fullcount-coaches/**",
},
],
},
};

module.exports = nextConfig;
12 changes: 12 additions & 0 deletions web/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,24 @@ import { Web3Context } from "../src/contexts";
import "../src/styles/globals.css";
import { GameContextProvider } from "../src/contexts/GameContext";
import { UserProvider } from "../src/contexts/UserContext";
import Script from "next/script";

export default function App({ Component, pageProps }: AppProps) {
const [queryClient] = useState(new QueryClient());

return (
<>
<Script
id="google-tag-manager"
strategy="afterInteractive"
dangerouslySetInnerHTML={{
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-KSQM8K8K');`,
}}
/>
<ChakraProvider theme={theme}>
<QueryClientProvider client={queryClient}>
<Web3Context>
Expand Down
20 changes: 20 additions & 0 deletions web/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Html, Head, Main, NextScript } from "next/document";
import { FULLCOUNT_ASSETS_PATH } from "../src/constants";

export default function Document() {
return (
Expand All @@ -8,6 +9,15 @@ export default function Document() {
name="robots"
content={process.env.NEXT_PUBLIC_BUILD_TARGET == "alpha" ? "noindex" : "all"}
/>
<link rel="prefetch" href={`${FULLCOUNT_ASSETS_PATH}/bi-banner.png`} as="image" />

<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin={"anonymous"} />
<link
href="https://fonts.googleapis.com/css2?family=Bangers&family=Pangolin&display=swap"
rel="stylesheet"
/>

<link href="https://fonts.googleapis.com/css?family=Space Grotesk" rel="stylesheet" />
<link
rel="stylesheet"
Expand All @@ -23,6 +33,16 @@ export default function Document() {
<link href="https://fonts.cdnfonts.com/css/cascadia-code" rel="stylesheet" />
</Head>
<body>
{/*<!-- Google Tag Manager (noscript) -->*/}
<noscript>
<iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-KSQM8K8K"
height="0"
width="0"
style={{ display: "none", visibility: "hidden" }}
></iframe>
</noscript>
{/*<!-- End Google Tag Manager (noscript) -->*/}
<Main />
<NextScript />
</body>
Expand Down
13 changes: 13 additions & 0 deletions web/pages/atbats/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Layout from "../../src/components/layout/layout";
import PracticeSelect from "../../src/components/practice/PracticeSelect";
import AtBatView from "../../src/components/atbat/AtBatView";

const Home = () => {
return (
<Layout home={true} title="Fullcount">
<AtBatView />
</Layout>
);
};

export default Home;
12 changes: 12 additions & 0 deletions web/pages/practice/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Layout from "../../src/components/layout/layout";
import PracticeSelect from "../../src/components/practice/PracticeSelect";

const Home = () => {
return (
<Layout home={true} title="Fullcount">
<PracticeSelect />
</Layout>
);
};

export default Home;
Binary file modified web/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions web/sample.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_HUMBUG_TOKEN=<HUMBUG_TOKEN>;
40 changes: 29 additions & 11 deletions web/src/components/GlobalStyles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,39 @@

.commitButton {
display: flex;
padding: 4px 20px;
padding: 9px 20px;
justify-content: center;
align-items: center;
gap: 5px;
width: 100%;
/*align-self: stretch;*/
border: 0.5px solid #f1e3bf;
background: #00a341;
color: #fff;
font-size: 14px;
gap: 10px;
align-self: stretch;
min-height: 38px;
border: 1px solid #262019;
background: #328449;
color: #FFF;
text-align: center;
font-family: Bangers, cursive;
font-size: 18px;
font-style: normal;
font-weight: 500;
line-height: normal;
height: 31px;
font-weight: 400;
line-height: 100%; /* 18px */
letter-spacing: 0.9px;
position: relative;
width: 140px;
z-index: 2;
}

.waitingMessage {
display: flex;
width: 140px;
height: 38px;
padding: 10px 20px;
justify-content: center;
align-items: center;
gap: 10px;
z-index: 5;
border: 1px solid #262019;
position: relative;
background: #4D4D4D;
}

.mobileButton {
Expand Down
65 changes: 65 additions & 0 deletions web/src/components/HomePage/AtBatItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import styles from "./AtBatsList.module.css";
import { AtBat, OwnedToken, Token } from "../../types";
import TokenToPlay from "./TokenToPlay";
import DotsCounter from "../sessions/DotsCounter";

export const outcomes = [
"In Progress",
"Strikeout",
"Walk",
"Single",
"Double",
"Triple",
"Home Run",
"In Play Out",
];

export const outcomeType = (tokens: Token[], atBat: AtBat): "positive" | "negative" | undefined => {
const { pitcher, batter } = atBat;
if (tokens.some((t) => t.address === pitcher?.address && t.id === pitcher.id)) {
return atBat.outcome === 1 || atBat.outcome === 7 ? "positive" : "negative";
}
if (tokens.some((t) => t.address === batter?.address && t.id === batter.id)) {
return atBat.outcome === 1 || atBat.outcome === 7 ? "negative" : "positive";
}
};

const AtBatItem = ({ atBat, tokens }: { atBat: AtBat; tokens: OwnedToken[] }) => {
return (
<div className={styles.atBatContainer}>
<div className={styles.cards}>
{atBat.pitcher ? (
<TokenToPlay token={atBat.pitcher} isPitcher={true} />
) : (
<div style={{ width: "100px", height: "152px", border: "1px solid #7E8E7F" }} />
)}
<div className={styles.vs}>VS</div>
{atBat.batter ? (
<TokenToPlay token={atBat.batter} isPitcher={false} />
) : (
<div style={{ width: "100px", height: "152px", border: "1px solid #7E8E7F" }} />
)}
</div>
{atBat.outcome !== 0 ? (
<div
className={
!outcomeType(tokens, atBat)
? styles.othersOutcome
: outcomeType(tokens, atBat) === "positive"
? styles.positiveOutcome
: styles.negativeOutcome
}
>
{outcomes[atBat.outcome]}!
</div>
) : (
<div className={styles.activeAtBat}>
<DotsCounter label={"BALL"} count={atBat.balls} capacity={4} />
<DotsCounter label={"STRIKE"} count={atBat.strikes} capacity={3} />
</div>
)}
</div>
);
};

export default AtBatItem;
Loading

0 comments on commit ca67c09

Please sign in to comment.