Menu

How I Rebuilt the Homepage of My HTML5 Games Portal (and What I Learned About Caching)
📰

How I Rebuilt the Homepage of My HTML5 Games Portal (and What I Learned About Caching)

DEV Community: javascript·Antonio·18 days ago
#d9MTz8o4
#devtojavascript#devto#dev#return#enter
Reading 0:00
15s threshold

I run a free HTML5 games portal, SPC – Super Play Combo . It's built on WordPress with the GeneratePress theme and has over 3,000 games from the GameMonetize and GamePix feeds. Over the last few weeks I rebuilt the homepage in a Poki-like style, with one horizontal row per category. It looked easy. It wasn't.

Here are the real problems I ran into and how I fixed them.

1. Category rows with no duplicates

Each category (Puzzle, Arcade, Match-3, Mahjong, Quiz, Sports, Racing…) has its own page with its own game list. The homepage shows one row per category, built by a script called motore-playcombo.js .

The feeds use English category names, while my site uses Italian ones, so I made a map:

const CATEGORIE_HOME = [ ' puzzle ' , ' sparabolle ' , ' arcade ' , ' match-3 ' , ' mahjong ' , ' trivia ' , ' gamesforgirls ' , ' sports ' , ' racing ' , ' card ' , ' adventure ' , ' platformer ' , ' 2048 ' ];

Enter fullscreen mode

Exit fullscreen mode

Golden rule: each game appears in exactly one row .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.