November 10
Hi everyone, hope you're well!
I haven't been very well (worse than usual, possibly related to the weather here) so I didn't get much done the last two weeks... at least, not as much as I'd like to. Still, lots of stuff to talk about, and I did make a video to show where things currently are with ArtCentral - be aware it contains NSFW art, to display the improved nsfw-art-revealing code.
Before going into the usual update stuff, an idea of what's done and what isn't.
Done
- Galleries
- Artwork displaying
- Artwork tags
- Search functionality
- Artwork uploading, resizing, deleting and editing
- Infrastructure (all the back-end AWS configurations and the like)
- Redis caching for search results and user galleries
Partially done / in progress
- Search layout (the search results need to have the artist name/icon in them, they currently do not). The search page also needs to have search for users and other menus at the top.
- Settings pages; many settings are changeable and work, but the layout needs to be improved, and some settings are not yet implemented.
- Finalising layout for TOS/rules pages, and completing their content
- Login and create account pages; they work but their layout and styling needs improving
- Dark/light themes. Mostly done, but I need to define some things as not changing colour; you can see that for example, the navbar text changing colour in dark/light mode is not useful, so I need to change some things to make that work, but it's fairly easy stuff.
Still to do (there are some other potential things, like moderator tools, but I'm mostly referring to main core functionalities here)
- Patreon webhooks (for detecting subscribe/unsubscribe events)
- Likes / follows
- Comments (if they will be available at all)
- Private messages (if indeed they will be available at launch)
- Various bits and pieces, mainly relating to front-end appearance
- Cronjobs - there aren't that many required but I do need to spend some time figuring out what's needed and so on
Update logs
Aka the usual "stuff I've been up to" section.
Redis library TTL issues
Whilst implementing the simpler Redis structure I talked about in the last post for searches, I ran into a problem I wasn't expecting: PHPRedis (a high-performance Redis library) doesn't support some of the latest Redis additions. In Redis, when you want to set the expiry time for a key, you can use EXPIRE (https://redis.io/commands/expire/), which has an optional parameter allowing you to tell it when it should or should not change a key's expiry. I wanted to use this, but the PHPRedis library doesn't support those options yet except on its development branch, so I had to use a combination of the TTL command and normal EXPIRE commands to make it work. Annoying, but it's implemented now.
I also had to redo a bit of the RedisManager class I made for keeping all Redis operations (or rather, Redis methods) in one place. Initially, I made it such that if Redis was disabled, it would return values suggesting successful operations to keep the code smooth and easy to write in database areas where Redis calls are made. For a lot of calls this works, but for calls such as HSET and HGETALL, it isn't really plausible to distinguish between Redis being offline and an actual successful call returning data, so I had to change how the database acts. Instead of doing, say:
<check if Redis value exists, and if it doesn't, find it in the database>
The code in the database had to change to be more like:
<check if Redis is online and enabled>
<if it is, check if Redis has a cached value, if it doesn't go to the database>
I didn't really want to do that if I didn't have to, as it adds some extra boilerplate code into database methods, but it's a better design overall I think and isn't that big of a deal, just a few more lines here and there per database method.
Dark/light viewing themes
I spent some time this week figuring out how to make an easily-switchable light-mode theme for the website. While it's easy enough to e.g. make a light/dark theme, I want to make sure it's easy to configure, so that supporters can easily create custom themes for their own preference without needing weird additional code to make it work.
For the most part, this is done, but there are a few hitches I need to sort out - namely, elements of pages that need to never change colour, or only change in specific circumstances. For example, usernames on banners should always be black text, or else they'll be very hard to read. It shouldn't be a big deal, I just need to decide on a system for managing it and identify which things need to change (which should be relatively few, as this only really affects text that is overlaid onto an image).
The implementation thus far is to use CSS root variables, alongside light mode variables that have similar naming and can override the root variables as needed via JavaScript. Custom themes can be done via AJAX calls from the database, then loading user colours into the necessary root CSS variables to change the website appearance upon loading.
Eldritch gallery fixes, part 2
I got some helpful feedback from an artist friend who took a look at the current gallery layout. They pointed out to me that it'd be better to have images blurred out, rather than simply a black overlay, to show NSFW images in a gallery in cases where a user needs to click to reveal them (so that they don't get surprised by the revealed content).
I'd tried blurring images before, but it comes with a problem: using filter:blur in CSS causes a border to be generated around the outside of the image. The more you blur it, the bigger the border becomes, and it interferes with the gallery layout. I had to change the artwork gallery code somewhat to get around this, but it is done now. The last thing I had to do was make the blur filter gently fade out instead of immediately disappearing, which is done now.
Doing the transitions in CSS turned out to be problematic, as for some reason transitions of equal times didn't overlap properly, so I implemented it inside some jQuery calls instead.
User profile improvements
These days people expect very easy website interfaces - while it's not exactly 'necessary', importing one's art portfolio to a new website is a big hassle, so I need to try and make that as easy as possible for people to do.
One part of that is making profile pictures and banners changeable on the profile page itself, rather than just through the website's settings area. I'm partway through this; I need to adapt the image cropping code used in the settings pages to the profile pages, by turning them into modals that overlap the page instead of being part of the main page itself. Should be relatively simple to do.
Another part of it is implementing delete and edit buttons on the artworks themselves when scrolling through one's own gallery. While this isn't essential really, it's probably worth doing (and I will need to edit the overlays a bit for search page results anyway, so I'll have to confront making fancy overlays sooner or later). It'll make it easier for people to edit or delete artworks in their portfolio rather than having to click through to the artwork first.
Logo and design progress
As you might have noticed, the site fonts have changed. The graphic designer friend I'm commissioning for a logo for the site helped me with this; there's been a few issues to work around, relating to the nitty-gritty details of how some fonts work, but they're fixed. The logo itself is not yet done; there are two main designs I really like that I need to choose between (sorry, they're staying secret :D).
The logo that you can see in the video is just a placeholder, not one of the logos being considered.