matt HOFFNER
commited on
Commit
β’
607207a
1
Parent(s):
33ee259
register functions and restyle
Browse files- app/page.module.css +25 -60
- pages/api/functions/embed.ts +10 -1
- pages/api/functions/index.ts +4 -3
app/page.module.css
CHANGED
@@ -3,54 +3,13 @@
|
|
3 |
.main {
|
4 |
display: flex;
|
5 |
flex-direction: column;
|
|
|
6 |
justify-content: space-between;
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
align-items: inherit;
|
13 |
-
font-size: 0.85rem;
|
14 |
-
max-width: var(--max-width);
|
15 |
-
width: 100%;
|
16 |
-
z-index: 2;
|
17 |
-
font-family: var(--font-mono);
|
18 |
-
}
|
19 |
-
|
20 |
-
.description a {
|
21 |
-
display: flex;
|
22 |
-
justify-content: center;
|
23 |
-
align-items: center;
|
24 |
-
gap: 0.5rem;
|
25 |
-
}
|
26 |
-
|
27 |
-
.description p {
|
28 |
-
position: relative;
|
29 |
-
margin: 0;
|
30 |
-
padding: 1rem;
|
31 |
-
background-color: rgba(var(--callout-rgb), 0.5);
|
32 |
-
border: 1px solid rgba(var(--callout-border-rgb), 0.3);
|
33 |
-
border-radius: var(--border-radius);
|
34 |
-
}
|
35 |
-
|
36 |
-
.code {
|
37 |
-
font-weight: 700;
|
38 |
-
font-family: var(--font-mono);
|
39 |
-
}
|
40 |
-
|
41 |
-
.grid {
|
42 |
-
display: grid;
|
43 |
-
grid-template-columns: repeat(4, minmax(25%, auto));
|
44 |
-
max-width: 100%;
|
45 |
-
width: var(--max-width);
|
46 |
-
}
|
47 |
-
|
48 |
-
.card {
|
49 |
-
padding: 1rem 1.2rem;
|
50 |
-
border-radius: var(--border-radius);
|
51 |
-
background: rgba(var(--card-rgb), 0);
|
52 |
-
border: 1px solid rgba(var(--card-border-rgb), 0);
|
53 |
-
transition: background 200ms, border 200ms;
|
54 |
}
|
55 |
|
56 |
.card span {
|
@@ -259,18 +218,26 @@
|
|
259 |
.button {
|
260 |
padding: 0.75rem 1.5rem; /* Adjust padding to increase the button's size */
|
261 |
margin-top: 1rem; /* Space above the button */
|
262 |
-
border:
|
263 |
-
border-radius:
|
264 |
font-size: 1rem; /* Font size */
|
265 |
-
font-weight: bold; /*
|
266 |
-
color:
|
267 |
-
background
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
}
|
275 |
|
276 |
.icon {
|
@@ -307,10 +274,8 @@
|
|
307 |
border: 8px solid transparent;
|
308 |
border-radius: 10px;
|
309 |
padding: 25px;
|
310 |
-
border-image: url('data:image/svg+xml;base64,CjxzdmcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB3aWR0aD0nODAnIGhlaWdodD0nMjAnIHZpZXdCb3g9JzAgMCA4MCAyMCc+CiAgPHBhdGggZD0nTSA1LDEwIGE1LDEwIDAgMSwwIDEwLDAgYTUsMTAgMCAxLDAgLTEwLDAnIGZpbGw9J3JlZCcgLz4KICA8cGF0aCBkPSdNIDI1LDEwIGE1LDEwIDAgMSwwIDEwLDAgYTUsMTAgMCAxLDAgLTEwLDAnIGZpbGw9J2dyZWVuJyAvPgogIDxwYXRoIGQ9J00gNDUsMTAgYTUsMTAgMCAxLDAgMTAsMCBhNSwxMCAwIDEsMCAtMTAsMCcgZmlsbD0nYmx1ZScgLz4KICA8cGF0aCBkPSdNIDY1LDEwIGE1LDEwIDAgMSwwIDEwLDAgYTUsMTAgMCAxLDAgLTEwLDAnIGZpbGw9J3llbGxvdycgLz4KPC9zdmc+Cg==') 5 repeat;
|
311 |
}
|
312 |
|
313 |
-
|
314 |
.message {
|
315 |
background-color: #f9f9f9;
|
316 |
border-radius: 15px;
|
|
|
3 |
.main {
|
4 |
display: flex;
|
5 |
flex-direction: column;
|
6 |
+
height: 100vh;
|
7 |
justify-content: space-between;
|
8 |
+
padding: 2rem;
|
9 |
+
background-image: url('https://512pixels.net/downloads/macos-wallpapers-thumbs/10-2--thumb.png'); /* URL of the wallpaper */
|
10 |
+
background-size: cover; /* Ensure it covers the entire area */
|
11 |
+
background-position: center; /* Center the image in the element */
|
12 |
+
background-repeat: no-repeat; /* Don't repeat the image */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
}
|
14 |
|
15 |
.card span {
|
|
|
218 |
.button {
|
219 |
padding: 0.75rem 1.5rem; /* Adjust padding to increase the button's size */
|
220 |
margin-top: 1rem; /* Space above the button */
|
221 |
+
border: 1px solid #707070; /* Darker border for depth */
|
222 |
+
border-radius: 5px; /* Rounded corners */
|
223 |
font-size: 1rem; /* Font size */
|
224 |
+
font-weight: bold; /* Bold text */
|
225 |
+
color: #000; /* Black text for contrast */
|
226 |
+
background: linear-gradient(180deg, #a8a8a8 0%, #8b8b8b 50%, #a8a8a8 100%); /* Gradient to simulate brushed metal */
|
227 |
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25); /* Shadow for a 3D effect */
|
228 |
+
text-align: center; /* Center the text */
|
229 |
+
cursor: pointer; /* Cursor change on hover */
|
230 |
+
transition: background-color 0.3s, box-shadow 0.2s; /* Smooth transitions for interactions */
|
231 |
+
}
|
232 |
+
|
233 |
+
.button:hover {
|
234 |
+
background: linear-gradient(180deg, #b0b0b0 0%, #9d9d9d 50%, #b0b0b0 100%); /* Lighter gradient on hover */
|
235 |
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); /* Less pronounced shadow on hover */
|
236 |
+
}
|
237 |
+
|
238 |
+
.button:active {
|
239 |
+
background: linear-gradient(180deg, #8b8b8b 0%, #a8a8a8 50%, #8b8b8b 100%); /* Inverted gradient for pressed effect */
|
240 |
+
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); /* Inner shadow for a pressed effect */
|
241 |
}
|
242 |
|
243 |
.icon {
|
|
|
274 |
border: 8px solid transparent;
|
275 |
border-radius: 10px;
|
276 |
padding: 25px;
|
|
|
277 |
}
|
278 |
|
|
|
279 |
.message {
|
280 |
background-color: #f9f9f9;
|
281 |
border-radius: 15px;
|
pages/api/functions/embed.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
-
import { createSearchApi } from '
|
2 |
import { createOddsApi } from '@/app/tools/odds';
|
|
|
3 |
import { handleContentText } from './utils';
|
4 |
import { similaritySearch } from './vector-store';
|
5 |
|
@@ -10,6 +11,8 @@ const [serpApi] =
|
|
10 |
apiKey: process.env.SERP_API_KEY || "",
|
11 |
});
|
12 |
|
|
|
|
|
13 |
const [oddsApi] = createOddsApi({ apiKey: process.env.ODDS_API_KEY || "" });
|
14 |
type FunctionOutput = any;
|
15 |
type FunctionInput = any;
|
@@ -40,3 +43,9 @@ export const serp: FunctionOutput = async ({ input }: FunctionInput) => {
|
|
40 |
return serpApiResults;
|
41 |
}
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { createSearchApi } from '@app/tools/search';
|
2 |
import { createOddsApi } from '@/app/tools/odds';
|
3 |
+
import { createSportsResultsApi } from '@/app/tools/scores';
|
4 |
import { handleContentText } from './utils';
|
5 |
import { similaritySearch } from './vector-store';
|
6 |
|
|
|
11 |
apiKey: process.env.SERP_API_KEY || "",
|
12 |
});
|
13 |
|
14 |
+
const [sportsScoresApi] = createSportsResultsApi({ apiKey: process.env.SERP_API_KEY || "",});
|
15 |
+
|
16 |
const [oddsApi] = createOddsApi({ apiKey: process.env.ODDS_API_KEY || "" });
|
17 |
type FunctionOutput = any;
|
18 |
type FunctionInput = any;
|
|
|
43 |
return serpApiResults;
|
44 |
}
|
45 |
|
46 |
+
|
47 |
+
export const serp: FunctionOutput = async ({ input }: FunctionInput) => {
|
48 |
+
const content: string = await serpApi({input})
|
49 |
+
const serpApiResults = await similaritySearch(input, content);
|
50 |
+
return serpApiResults;
|
51 |
+
}
|
pages/api/functions/index.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import { NextApiRequest, NextApiResponse } from 'next';
|
2 |
-
import { odds, serp, surfer } from './embed';
|
3 |
|
4 |
export const config = {
|
5 |
api: {
|
@@ -12,9 +12,10 @@ export const config = {
|
|
12 |
type FunctionHandler = any;
|
13 |
|
14 |
const handlers: FunctionHandler = {
|
15 |
-
'
|
16 |
'surfer': surfer,
|
17 |
-
'
|
|
|
18 |
};
|
19 |
|
20 |
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
|
|
1 |
import { NextApiRequest, NextApiResponse } from 'next';
|
2 |
+
import { odds, serp, surfer, sports } from './embed';
|
3 |
|
4 |
export const config = {
|
5 |
api: {
|
|
|
12 |
type FunctionHandler = any;
|
13 |
|
14 |
const handlers: FunctionHandler = {
|
15 |
+
'search': serp,
|
16 |
'surfer': surfer,
|
17 |
+
'sports_odds': odds,
|
18 |
+
'sports_results': sports
|
19 |
};
|
20 |
|
21 |
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|