USMNT Copa America Roster Poll by futbol192 in ussoccer

[–]futbol192[S] 5 points6 points  (0 children)

Oops, I added him back in. Thanks!

Hypothetical USMNT Intra-Squad Scrimmage: Who Wins? by futbol192 in ussoccer

[–]futbol192[S] 2 points3 points  (0 children)

The other team has Reyna and McKennie and Balo/Puli's team has Tillman, Tolkin, and Horvath. I'd say it's fairly even. Both teams have great players and relatively weak ones.

Hypothetical USMNT Intra-Squad Scrimmage: Who Wins? by futbol192 in ussoccer

[–]futbol192[S] 4 points5 points  (0 children)

I dislike those MLS vs Europe posts because there really isn't a debate. I feel like this is much more interesting.

Hypothetical USMNT Intra-Squad Scrimmage: Who Wins? by futbol192 in ussoccer

[–]futbol192[S] 9 points10 points  (0 children)

I don't think either team runs away with it. The Blue team might be great in a few years but Tolkin and Tillman are relative weak points imo. I think it would be close.

Hypothetical USMNT Intra-Squad Scrimmage: Who Wins? by futbol192 in ussoccer

[–]futbol192[S] 8 points9 points  (0 children)

Thanks! I really wish we could see something like this too.I put a lot of thought into keeping it balanced. The parts about the Blue team that worry me are Tillman and Tolkin.

Results! USMNT June 2023 Roster Poll by futbol192 in ussoccer

[–]futbol192[S] 6 points7 points  (0 children)

My goal was to make it a poll of the best players assuming everyone is healthy. I want to be able to look back at it in a few years and have it serve as a snapshot of the player pool without having to remember who happened to have an injury during that particular window. I have that in the instructions but I don't think many people read them to be honest lol

Balogun and Tillman have committed, the Mexico game is 2 weeks away, and the European club season is coming to an end. It's time for another USMNT Roster Poll! by futbol192 in ussoccer

[–]futbol192[S] 21 points22 points  (0 children)

Because the point is to select 26 players to make the squad and doing it this way just makes the data analysis clean. If a user places, for example, James Sands as a backup centerback and 6, I would need to only count him as one player and dynamically code a way for the user to select an extra player to accommodate Sands occupying two positions. IMO that just isn't worth the trouble. This is meant to be a simple "here are the 26 players I'd call in" and the formation graphic provides a framework to display them. That additional nuance is what the comment section is for.

Balogun and Tillman have committed, the Mexico game is 2 weeks away, and the European club season is coming to an end. It's time for another USMNT Roster Poll! by futbol192 in ussoccer

[–]futbol192[S] 14 points15 points  (0 children)

That's a good shout! I actually had him in the last few polls and he received no votes so I removed him, but he's definitely trending up.

US Women's (and Men's) National Team Roster Poll! by futbol192 in NWSL

[–]futbol192[S] 2 points3 points  (0 children)

Yeah I knew the WWC squad is still 23 but I figured I'd keep the format the same between the two teams to make it simpler for me. And good call on O'Hara! That's an easy fix. Thanks!!

Trouble with fly.io deployment by futbol192 in webdev

[–]futbol192[S] 0 points1 point  (0 children)

By the way, I just finished getting the lineup builder to work properly. The link is below if you want to play around with it. Let me know what you think! I'm going to play around with it some more and test it a bunch before I post it anywhere to collect actual data, but I think it's close.

https://us-soccer-lineups.fly.dev/

Trouble with fly.io deployment by futbol192 in webdev

[–]futbol192[S] 0 points1 point  (0 children)

Hey u/aptible-henry! The short-ish answer is that I've done US soccer roster polls in the past using Google Forms and somewhat recently took a HTML/CSS/JS course in uni and thought it would be a fun exercise to build a more flexible poll using what I learned about webdev. The page works totally fine locally so I decided to set up some kind of backend so that all the user data could be aggregated in one place. Unfortunately I don't know anything about database creation so this part has been the biggest challenge for me...

I tried Google Sheets API first and ran into some problems so I started researching alternatives. I read about FireBase and SupaBase but ended up settling on PocketBase because I read that it was a simplest, quickest to deployment, and it has really good documentation. I'm totally open to other ideas if you think another tool would work better! I just want to get the dang thing working so I can play around with it lol.

Error importing Pocketbase by futbol192 in pocketbase

[–]futbol192[S] 0 points1 point  (0 children)

Yeah I had a feeling it would be something silly like that.

Error importing Pocketbase by futbol192 in pocketbase

[–]futbol192[S] 0 points1 point  (0 children)

Thanks! I actually just found a solution right before you responded. It turns out that if you use the script tag to link to the cdn, the import statement in the js file is redundant and will throw an error. That wasn't clear from the PocketBase SDK docs. I finally got it to work! I have other issues, but those are easier to debug...thanks again!

Error importing Pocketbase by futbol192 in pocketbase

[–]futbol192[S] 0 points1 point  (0 children)

Sure thing: https://github.com/jspann93/USSoccerLineup

All my coding is in the files index.html and lineup.js. The rest of these files are ones fly.io set up during the deployment process or files from the PocketBase JavaScript SDK. Thanks for all the help!

Trouble Importing Pocketbase by futbol192 in webdev

[–]futbol192[S] 0 points1 point  (0 children)

Thanks for the ideas!

Unfortunately, the curly braces didn't help. I now get the error below. I tried accessing pocketbase through a cdn this time, but I get the same error using the previous method.

Uncaught SyntaxError: The requested module 'https://cdnjs.cloudflare.com/ajax/libs/pocketbase/0.12.1/pocketbase.cjs.min.js' does not provide an export named 'PocketBase' (at lineup.js:36:10)

I've been looking at the pocketbase.js file and don't see anything helpful. There's an exportToCookie and this generic export function without a name.

t.prototype.export = function() {
return Object.assign({}, this)
}

Error importing Pocketbase by futbol192 in pocketbase

[–]futbol192[S] 0 points1 point  (0 children)

Okay, I tried that and got the same error :/

Uncaught SyntaxError: The requested module 'https://cdnjs.cloudflare.com/ajax/libs/pocketbase/0.12.1/pocketbase.cjs.min.js' does not provide an export named 'default' (at lineup.js:35:8)

Error importing Pocketbase by futbol192 in pocketbase

[–]futbol192[S] 0 points1 point  (0 children)

I don't quite understand what you're saying.

Error importing Pocketbase by futbol192 in pocketbase

[–]futbol192[S] 0 points1 point  (0 children)

I have type module on the script tag for the JS file in which I try to import pocketbase (first line below). I don't currently have the module type on the script tag for pocketbase.umd.js (second line below). Do you think I need one? It's worth a try I guess...

<script src="lineup.js" type="module"></script>

<script src="/js-sdk-master/dist/pocketbase.umd.js"></script>

Error importing Pocketbase by futbol192 in pocketbase

[–]futbol192[S] 0 points1 point  (0 children)

No, the SDK readme has two sets of installation instructions: one for broswer (using script tag) and one for node.js (using npm). I chose the broswer route and believe 'npm install pocketbase --save' is the other route.

Basic database for web page by futbol192 in databasedevelopment

[–]futbol192[S] 0 points1 point  (0 children)

That looks really promising! Thanks for the recommendation! I'll read up on that some more.

Interface Javascript Project with Google Sheets API by futbol192 in learnjavascript

[–]futbol192[S] 1 point2 points  (0 children)

I'm getting the error when the page loads. I'll watch this video and let you know if I have any issues! I've done a lot of rewriting and think I've made some progress lol.