Commit graph

558 commits

Author SHA1 Message Date
d2671d0fa6 fix ItemPage safeImageUrl loading bug
When you navigated directly to ItemPage, the new `safeImageUrl` function would crash during the loading state, because it was trying to safe-ify `undefined`.

Now, I've just made `safeImageUrl` more resilient to that particular kind of unexpected input, by passing through null-y values without change.
2020-10-22 20:53:21 -07:00
dd4f34ef73 mutations to mark an item as owned/wanted 2020-10-22 20:35:06 -07:00
6c97c15979 add closet_lists to dev schema too 2020-10-22 20:32:02 -07:00
0dcbe6fc2d Add users and closet_hangers to local db schema 2020-10-22 19:53:32 -07:00
acdf6209ca extract server auth into auth.js
This is just a nice cleanup, but it also supports a test mock I want to do next, to mock logins for the test db without having to round-trip to auth0.
2020-10-22 19:53:10 -07:00
5f3ac956e3 make the feedback form more visible 2020-10-22 16:01:54 -07:00
d99f5d7ac8 oops, fix missing react hook dep! 2020-10-22 15:46:22 -07:00
456a098df9 replace /api/assetProxy with a CDN proxy
When we decided to start out with /api/assetProxy, we didn't know how much the load would be in practice, so we just went ahead and tried it! Turns out, it was too high, and Vercel shut down our deployment 😅

Now, we've off-loaded this to a Fastly CDN proxy, which should run even faster and more efficiently, without adding pressure to Vercel servers and pushing our usage numbers! And I suspect we're gonna stay comfortably in Fastly's free tier :) but we'll see!

(Though, as always, if Neopets can finally upgrade their own stuff to HTTPS, we'll get to tear down this whole proxy altogether!)
2020-10-19 13:24:13 -07:00
59ae70d417 add cpn links to asset proxy, for old impress 2020-10-12 21:13:35 -07:00
9a36a6ec69 don't advance movies by a frame when resizing 2020-10-10 04:51:53 -07:00
7102772f63 fix positioning of movie layers on large screens
Oops, movie canvases were drawing larger than the images, if there was more than 600px of space available! fixed!
2020-10-10 04:32:53 -07:00
394e8178c4 add more urls to asset proxy, for classic dti hack 2020-10-10 04:08:04 -07:00
afe9fcf392 fade in for movie layers, too
gosh I hope I didn't break everything 😅
2020-10-10 03:46:23 -07:00
82f849f047 fix fade-in for static image layers
I guess something got more picky about the loading sequencing: the fade in animation was happening faster than the cached image could load. Now, we explicitly wait for the image to load (even though we know it's probably cached) before fading it in.
2020-10-10 03:37:43 -07:00
5f612f544c tweak homepage copy to make feedback more obvious
I noticed that, if you're _reading_ the beta callout it's obviously a feedback link, but it's easy to glaze over "Tell us what you think". Here, I've added the word "feedback" to make it stand out on scanning the page, while adding "Got ideas?" to keep it feeling colloquial.
2020-10-10 03:13:12 -07:00
68607e3756 fix infinite spinner on err loading HTML5 layers
Oops, our movie layer promises don't have a .cancel() method, so calling it crashed our error handler. Now, when there's an error loading a layer and there are HTML5 layers visible, we'll correctly show the "Could not load preview. Try again?" message.
2020-10-10 02:42:27 -07:00
f6268810be make invisible DTI title text not clickable 2020-10-10 02:34:02 -07:00
1eca5d1e27 add WIP callout to item page 2020-10-10 02:17:21 -07:00
e7359ab51b add WIP callout to user items page 2020-10-10 02:07:49 -07:00
a8cdd51bb5 rename "old DTI" to "classic DTI" on item page 2020-10-10 01:29:13 -07:00
fb632f82d6 minor fixes to feedback form React code
oops, forgot some hook deps!
2020-10-10 01:25:10 -07:00
ad43f58a07 fix Download button to use better caching
So I broke the Download button when we switched to impress-2020.openneo.net, and I forgot to update the Amazon S3 config.

But in addition to that, I'm making some code changes here, to make downloads faster: we now use exactly the same URL and crossOrigin configuration between the <img> tag on the page, and the image that the Download button requests, which ensures that it can use the cached copy instead of loading new stuff. (There were two main cases: 1. it always loaded the PNGs instead of the SVG, which doesn't matter for quality if we're rendering a 600x600 bitmap anyway, but is good caching, and 2. send `crossOrigin` on the <img> tag, which isn't necessary there, but is necessary for Download, and having them match means we can use the cached copy.)
2020-10-10 01:21:47 -07:00
3aad65ccb5 send feedback straight to my gmail, more reliable?
Going through matchu@openneo.net was hitting a spam filter on that email host's redirect… Gmail seems to be more okay with it, so I'm sending straight there, and crossing my fingers 🤞
2020-10-09 09:20:09 -07:00
d602287190 feedback form now sends actual emails! 2020-10-09 08:55:03 -07:00
87d6cbf72a Feedback form sends req to stubbed API endpoint
Okay, now the UI can handle the loading/success/error status! Next we need to actually send :3
2020-10-09 08:18:18 -07:00
b713aeea96 bundle feedback xwee, make it transparent
Oops, I shipped with the images.neopets.com TODO undone! Also, the white background was intersecting with the close X for the feedback form.

In this change, we move the xwee image into our bundle instead of depending on images.neopets.com, and we edit it to have a transparent background, which looks nicer for dark mode. (And we do a srcset!)
2020-10-09 08:01:46 -07:00
423ab5c98d oops, un-break the homepage! 2020-10-08 04:20:23 -07:00
1875931a48 simplify canvas code, just use separate elements
Previously I tried to be clever and pre-optimize by putting all the layers onto one canvas… I think this probably helped by batching their paints, but it made fades less smooth by not taking advantage of native CSS transitions, and it made us dip into JS way more often than necessary.

Here, I take the simpler approach: just layers of <img> and <canvas> tags, with each animated layer on its own canvas, and letting the browser handle transitions and compositing, and separate `setInterval` timers to manage their framerates.

I have a suspicion that batching the paints could help performance more, but honestly, maybe that batching is already happening somehow, because things look pretty great on my big-screen stress test now; and so if it _is_ relevant, I want to wait and see after testing on low-power devices.
2020-10-08 04:13:47 -07:00
3e147ec5b4 oops, don't auto-focus feedback button on load 2020-10-07 10:17:52 -07:00
cd42988a90 add beta blurb & WIP feedback form to homepage 2020-10-07 09:48:55 -07:00
3dc9a1d0ef add a subhead to the homepage
Not 100% sure on the copy, but I like that it's a bit clearer about the value prop. I tried to work in customization for SEO, but it feels too clunky in a sentence, might need to put it elsewhere in the copy!
2020-10-07 07:52:34 -07:00
2578e1a431 disable new modeling code, until some future day
Yeah, mm, turns out I don't think it's actually viable to model from Impress 2020, because we can't reasonably set up the SWFs and PNGs in the ways we need, especially for compatibility with Classic DTI.

We can turn this on again later, once Classic DTI is gone, and all assets are converted to HTML5 -- or if we build some kind of bridge to Classic's asset code, or we write new PNG conversion code.
2020-10-07 07:49:27 -07:00
c0ce71c206 don't show preview in the item info drawer 2020-10-07 07:05:37 -07:00
42c59328a9 only make a 60fps call if we're actually animating 2020-10-06 08:55:21 -07:00
5b2e370295 oops, fix a missing await in modeling
This caused swf asset syncs to be unreliable!
2020-10-06 07:35:00 -07:00
900d102594 Merge branch 'modeling' into main 2020-10-06 07:06:30 -07:00
99e6480486 add logging to modeling
my hope is that, if we fuck things up, this will make it clear 😅
2020-10-06 07:06:19 -07:00
bb812a2b81 oops, fix bug modeling pet with no items 2020-10-06 06:38:21 -07:00
6ec6bbec57 first-time modeling UX improvements
These changes are most relevant for playing around in the dev server, modeing against an empty database. But they'll also help in real-world modeling scenarios! e.g. modeling a new species/color combo is now a bit nicer, we don't show a blank entry in the color picker
2020-10-06 06:37:51 -07:00
df2d814c13 enable running against a local dev database
had to add some missing tables, but it seems to work! (some known errors though, from assumptions we make e.g. blue acaras existing)
2020-10-06 06:18:19 -07:00
da72837d9e modeling saves item-to-asset relationships
this is the last one to get parity with current modeling, I think?? I'm gonna add one more feature though: removing no-longer-used assets from the item
2020-10-06 05:49:37 -07:00
fefb798e87 extract Pet GQL to Pet.js from Outfit.js 2020-10-06 05:04:44 -07:00
740d8415db extract modeling logic into modeling.js 2020-10-06 05:02:21 -07:00
68b5486bb7 update labeled field for pet appearances
Oops, when building the Support tool to label pet appearances, I didn't realize that there's also a boolean `labeled` field that needs to be true for labeled appearances. Without it, the old app shows the appearance as "Unlabeled".

I also ran this query to fix the rows we'd incorrectly written:
```
mysql> UPDATE pet_states SET labeled = 1 WHERE mood_id IS NOT NULL;
Query OK, 158 rows affected (0.14 sec)
Rows matched: 19640  Changed: 158  Warnings: 0
```
2020-10-03 04:05:25 -07:00
0f5c437ffd split up modeling code into smaller functions
This is mostly because I want to chain the rels after both items and assets save, and I want to be able to specify that stuff a bit more precisely, rather than the like, layers-of-awaits we were building up.
2020-09-27 03:57:14 -07:00
a8c351b102 oops, fix a bug with Pet name GQL 2020-09-27 03:21:07 -07:00
914a06f8c7 add test for UC modeling
This got fixed in the refactor last commit, where we added the petAppearance field!
2020-09-27 03:19:10 -07:00
e57af14625 refactor Outfit.js to split Pet to a separate type
yeah, I had unified Pet into Outfit, but now I think that was overly clever… 😅

Here, I define a new Pet type, and it has some of the fields of Outfit and the deprecated fields still.

I did this because I want petAppearance to work, for UC testing!
2020-09-27 03:18:46 -07:00
f543868924 fix bug that broke fades on cache-grouped layers 2020-09-25 07:53:04 -07:00
32c4e540a3 group and cache adjacent static outfit layers
perf win owo!
2020-09-25 07:35:49 -07:00