]> git.cworth.org Git - lmno.games/log
lmno.games
3 years agoDrop the game history interface.
Carl Worth [Wed, 27 May 2020 04:20:22 +0000 (21:20 -0700)]
Drop the game history interface.

Not that it's bad to let the user go back and forth to see what
happened, but the interface here was particularly clunky, (both for
being rendered as a list of buttons and also for allowing the user to
fire off new moves wen viewing old history state).

This commit simply guts the rendering of the "moves" list. It doesn't
yet remove the jumpTo code that's now dead.

3 years agotictactoe: Implement a minimally-functional multi-player game
Carl Worth [Wed, 27 May 2020 04:13:49 +0000 (21:13 -0700)]
tictactoe: Implement a minimally-functional multi-player game

Now that there's a server implemented at lmno.games/tictactoe/LMNO/
it's a simple matter to break the call chain at handleClick() to
not do any state updates, but instead hit the /move API, then wait
for data to come back from the /events API and only when the server
returns with that, _then_ to update the state.

So, with multiple clients connected, each client will now seem the
game state updated with each move.

As far as the gameplay of Tic Tac Toe, the only major feature missing
is that players are not yet restricted to play as either X or O but
can instead send events for either player. Obviously, that won't be
hard to fix.

Then, as far as implementation, this code copies the add_message()
function from lmno.js, so we'll want to find a better way to do
that. And there may be some refactoring to be done for event handling
as well, (to reduce code duplication between game implementations).

But this code does use the fetch() API which does seem easier to use
than XMLHttpRequest so that's something we will probably want to
switch to in existing code.

3 years agoMakefile: Don't remove write permission from .js build artifacts
Carl Worth [Wed, 27 May 2020 04:05:03 +0000 (21:05 -0700)]
Makefile: Don't remove write permission from .js build artifacts

The intent behind this was to act as a clue to the developer that they
shouldn't edit the .js file, but it caused a problem that subsequent
build would fail because the output files were read-only. So we give
up on this idea.

3 years agotictactoe: Put in place the standard top-level page
Carl Worth [Tue, 26 May 2020 03:45:58 +0000 (20:45 -0700)]
tictactoe: Put in place the standard top-level page

Specifically, one which allows for hosting a new game, (using the
generic lmno_new function). Meanwhile, the game-specific page is moved
to tictactoe/game.html.

3 years agotictactoe: Integrate the standard LMNO styling
Carl Worth [Tue, 26 May 2020 03:02:12 +0000 (20:02 -0700)]
tictactoe: Integrate the standard LMNO styling

Include the LMNO CSS files and add a header. The LMNO button styling
looks better here than I expected. Just required a couple of padding
tweaks to get things looking correct.

3 years agoMakefile: Change permissions on generated .js files to be read-only
Carl Worth [Tue, 26 May 2020 00:50:54 +0000 (17:50 -0700)]
Makefile: Change permissions on generated .js files to be read-only

This is a hint to the developer that they shouldn't be eidting these
files, (but instead, should be editing the corresponding .jsx file).

3 years agoCorrect various meta viewport tags
Carl Worth [Tue, 26 May 2020 00:13:11 +0000 (17:13 -0700)]
Correct various meta viewport tags

I don't know where this cargo cult started, but the semicolon
separator was just wrong, (should be a comma), and the
maximum-scale=1.0 and user-scalable=0 were really just rude, (if a
user needs to/wants to zoom in on a page for accessibility purposes,
who are we to say they can't or shouldn't?).

3 years agoProvide any downloaded deps/*.js files to git clone during deployment
Carl Worth [Mon, 25 May 2020 23:55:52 +0000 (16:55 -0700)]
Provide any downloaded deps/*.js files to git clone during deployment

This is simply so that the deploy process doesn't need to download
anything that we might already have downloaded. We do explicitly call
"make deps" still to force verification of the checksums of the .js
files (even though we didn't just download them). This ensures that
these resource (which aren't otherwise tracked in git) haven't been
modified.

3 years agoTeach git to ignore tictactoe.js
Carl Worth [Mon, 25 May 2020 23:53:43 +0000 (16:53 -0700)]
Teach git to ignore tictactoe.js

We only want to commit source files to git, not the results of the
build.

3 years agoRework Makefile to force sha512 verification of downloaded files
Carl Worth [Mon, 25 May 2020 21:20:38 +0000 (14:20 -0700)]
Rework Makefile to force sha512 verification of downloaded files

We had sha512 checksums here, but no automation was happening for the
verification, (instead there was only a "make checksums" file that
would have to be called manually).

We rework things here so that the checksum is verified on every file
that is downloaded. The rework simplifies the recipe for
download/verification to a single recipe for all dependencies (rather
than 4 recipes with a lot of duplicated logic).

The "make checksums" target is also renamed to "make deps" since it
can be used to force the downloading of all dependencies, (and it is
given the .PHONY treatment so that it always performs checksum
verification even if there is nothing new to download).

3 years agoAdd a simple tictactoe game, implemented with React
Carl Worth [Mon, 25 May 2020 20:37:10 +0000 (13:37 -0700)]
Add a simple tictactoe game, implemented with React

This isn't a proper LMNO game, (it's not networked at all), but it's a
starting point for seeing how we might structure a React-based client
(and we can develop this into a proper LMNO game).

In fact, the source code here came directly from the React tutorial
here:

https://reactjs.org/tutorial/tutorial.html

Note that I've not pulled in the 1000+ npm modules that would have
come from using create-react-app as recommended in that tutorial. As
can be seen here, by example, none of them are needed. The only build
tool requireed is something to compile JSX and we've got that working
via the Debian-provided babel packages (as seen in the most recent
commits here).

3 years agoMake the build quieter by default
Carl Worth [Mon, 25 May 2020 20:27:28 +0000 (13:27 -0700)]
Make the build quieter by default

Just a simple change to keep the output of make very tidy.

If the user wants to see the complete command output they can use
"make V=1" for that, (and this support is documented in the default
output).

3 years agoMakefile: Add support to use babel to compile React code using JSX
Carl Worth [Mon, 25 May 2020 19:18:42 +0000 (12:18 -0700)]
Makefile: Add support to use babel to compile React code using JSX

This is in preparation for starting to use React to implement LMNO
game clients.

In this commit, the previous "make dev" target is now simply "make",
and the previous "make prod" target is now "make LMNO_BUILD=production".
This latter command is definitely annoying to remember, but should
almost never need to be executed manually; instead the developer will
likely invoke "make deploy" which knows how to do a production build.

3 years agoExtend Makefile with "deps", "dev", and "prod" targets
Carl Worth [Mon, 25 May 2020 10:46:08 +0000 (03:46 -0700)]
Extend Makefile with "deps", "dev", and "prod" targets

The "make deps" target downloads 3rd-party JavaScript resources that
are used by the site, (currently React and React-Dom). The "make dev"
installs the development versions locally while "made prod" installs
the production versions.

All three targets verify the integrity of the downloaded files via
SHA512 sums that are added in this commit.

And all three targets are documented in the README file added in this
commit.

3 years agoClose out li and ul tags
Carl Worth [Sun, 24 May 2020 17:57:11 +0000 (10:57 -0700)]
Close out li and ul tags

Apparently I never quite finished typing out this page. It's amazing
to me that broswers are as forgiving as they are when fed total
garbage.

3 years agoFix padding calculations for intermediate widths
Carl Worth [Sun, 24 May 2020 15:43:13 +0000 (08:43 -0700)]
Fix padding calculations for intermediate widths

I just noticed that at some intermediate browser widths the page
padding was entirely missing. Fortunately, "git bisect" was very
useful and pointed me to the exact problematic commit:

93245be0a5db82eadd4fb532d27fa4fbea63a2ac

In that commit we were trying to move the range of media block from
620:720 to instead be 720:820 (to account for the change in the
box-sizing parameter now including 100 units of padding).

But that commit was botched in a couple of ways, (applying from
620:820 and also miscalculating everything within that range).

This commit corrects things and is verified to act as desired when
applied to the broken commit mentioned above and when applied at the
current point in the code history.

3 years agoAdd handling for a spectators list in addition to the players list
Carl Worth [Sun, 24 May 2020 15:27:09 +0000 (08:27 -0700)]
Add handling for a spectators list in addition to the players list

The model is that when people initially join the game, (providing a
name for themselves), they are a spectator. They then move from the
spectator list to the player list when then they choose a character
name.

The server isn't very clever about this. It has distinct endpoints for
adding/removing players and adding/removing spectators. So in this
code we have to explicitly remove ourselves as a spectator when we add
ourselves as a player.

3 years agoempires: Construct reliable paths for all game API endpoints
Carl Worth [Sun, 24 May 2020 15:06:11 +0000 (08:06 -0700)]
empires: Construct reliable paths for all game API endpoints

By appending to window.location we can ensure that we're always
hitting an endpoint one level below the game ID, (and not replacing
the game ID), regardless of whether the current path ends in a
trailing slash or not.

3 years agoempires: Simply game for to require only a character name
Carl Worth [Sat, 23 May 2020 17:42:40 +0000 (10:42 -0700)]
empires: Simply game for to require only a character name

Since the palyer's own nickname is now requested earlier (when first
joining the game).

This will hopefully be less confusing for players (who were sometimes
confused about which name was which).

3 years agoMerge branch 'flempires-repo-merge'
Kevin Worth [Sat, 23 May 2020 14:10:01 +0000 (10:10 -0400)]
Merge branch 'flempires-repo-merge'

This brings in the files which were originally being tracked at
https://gitlab.com/kworth082/empires.git

3 years agoRename flutterempires to flempires
Kevin Worth [Mon, 18 May 2020 12:26:06 +0000 (08:26 -0400)]
Rename flutterempires to flempires

Because its way more nerdy to have a corny name for an app, so
flempires it is (or at least its directory).

3 years agoPrepare directories for merge into lmno.games
Kevin Worth [Mon, 18 May 2020 12:24:31 +0000 (08:24 -0400)]
Prepare directories for merge into lmno.games

In order to merge this (flutterempires) repo into the lmno.games repo,
it will be much cleaner to have all of the files in the top level
directory named flutterempires in order to avoid conflicts with
top-level files in lmno.games.

3 years agoAdd all linux files generated with flutter create .
Kevin Worth [Sat, 16 May 2020 10:20:46 +0000 (06:20 -0400)]
Add all linux files generated with flutter create .

Accordingly with this documentation:

    https://flutter.dev/desktop#add-desktop-support-to-an-existing-flutter-project

This commit adds all of the files in the `linux` directory which came
from running `flutter create .` while on the master branch of
flutter-sdk.

3 years agoMerge branch 'add-macos'
Kevin Worth [Sat, 16 May 2020 10:18:41 +0000 (06:18 -0400)]
Merge branch 'add-macos'

3 years agoMerge branch 'player-list'
Kevin Worth [Tue, 12 May 2020 11:35:21 +0000 (07:35 -0400)]
Merge branch 'player-list'

3 years agoEnable network requests in mac os app
Kevin Worth [Fri, 15 May 2020 13:03:32 +0000 (09:03 -0400)]
Enable network requests in mac os app

According to documentation here:

    https://flutter.dev/desktop#setting-up-entitlements

this change is needed so that the app can send network requests

3 years agoMerge branch 'data-models'
Kevin Worth [Fri, 8 May 2020 13:44:42 +0000 (09:44 -0400)]
Merge branch 'data-models'

3 years agoGet rid of extra FutureBuilder widgets
Kevin Worth [Tue, 12 May 2020 03:16:20 +0000 (23:16 -0400)]
Get rid of extra FutureBuilder widgets

Now that the ListView is working correctly, we can get rid of these two
FutureBuilders which were essentially intermediate steps to get to this
point.

3 years agoAdd all macos files generated with flutter create .
Kevin Worth [Fri, 15 May 2020 12:59:21 +0000 (08:59 -0400)]
Add all macos files generated with flutter create .

According to this documentation:

    https://flutter.dev/desktop#add-desktop-support-to-an-existing-flutter-project

This commit adds all of the files which came from running `flutter
create .` while on the master branch of flutter-sdk.

After this commit (and while still on the flutter-sdk master branch) the
native mac os app can be run with `flutter run -d macOS`.

3 years agoChange name of Android app to Empires
Kevin Worth [Fri, 8 May 2020 13:32:51 +0000 (09:32 -0400)]
Change name of Android app to Empires

The generated code lazily made the app name match the package
name, so now Empires is much better than flutterempires.

3 years agoClean up some leftover hello flutter code
Kevin Worth [Fri, 8 May 2020 13:07:17 +0000 (09:07 -0400)]
Clean up some leftover hello flutter code

The hello flutter code has button which increments a number on the
screen and this has just been cluttering things up. This will likely be
a good place to put the logic we'll need for submitting the user's
name and character, so we won't get rid of it completely.

3 years agoShow text if player list returns empty
Kevin Worth [Tue, 12 May 2020 03:13:11 +0000 (23:13 -0400)]
Show text if player list returns empty

Better to show "No players yet" than nothing when the server returns an
empty list.

3 years agoMerge branch 'families-to-empires'
Kevin Worth [Mon, 4 May 2020 12:02:01 +0000 (08:02 -0400)]
Merge branch 'families-to-empires'

Rename everything that was initially created with `flutter create flutterfamilies`
so that it is now called "flutterempires" instead

3 years agoMake space for showing the full list of players
Kevin Worth [Fri, 8 May 2020 12:59:50 +0000 (08:59 -0400)]
Make space for showing the full list of players

Up to now, the widgets were centered on the screen. With them now moved
up to the top, there is room to show the list of players at the bottom.

3 years agoClean up indentation
Kevin Worth [Mon, 11 May 2020 12:30:01 +0000 (08:30 -0400)]
Clean up indentation

This commit changes whitespace only, now that the FutureBuilder is
inside the Expanded widget.

3 years agoClean up by removing some tutorial text
Kevin Worth [Sat, 2 May 2020 11:23:47 +0000 (07:23 -0400)]
Clean up by removing some tutorial text

Removes comments only - no functional code changes

3 years agoRename directory flutterfamilies to flutterempires
Kevin Worth [Mon, 4 May 2020 11:53:03 +0000 (07:53 -0400)]
Rename directory flutterfamilies to flutterempires

Originally the flutter app was created in a directory called flutterfamilies
and this should take care of the final references still pointing to that old
directory now that it's renamed to flutterempires

3 years agoDisplay total number of players
Kevin Worth [Fri, 8 May 2020 12:58:03 +0000 (08:58 -0400)]
Display total number of players

Setting up a new widget to display the list of players, but for the
time being (for simplicity's sake) it's just displaying the size of the
returned list of players.

3 years agoAdd Expanded to fix the scrollable in a scrollable problem
Kevin Worth [Sun, 10 May 2020 20:34:41 +0000 (16:34 -0400)]
Add Expanded to fix the scrollable in a scrollable problem

Since the ListView can't be put into the Column widget, we
instead add an Expanded widget and put the ListView in there.

3 years agoFix indentation after adding Container
Kevin Worth [Sat, 2 May 2020 11:20:42 +0000 (07:20 -0400)]
Fix indentation after adding Container

Changes whitespace only

3 years agoRename "Families" to "Empires"
Kevin Worth [Mon, 4 May 2020 03:13:17 +0000 (23:13 -0400)]
Rename "Families" to "Empires"

Because the name is better

3 years agoAdd fetchAllPlayers method
Kevin Worth [Fri, 8 May 2020 12:53:45 +0000 (08:53 -0400)]
Add fetchAllPlayers method

This method is really the one we've needed all along and so now we
can display the list of players instead of just the first player.

3 years agoMove the FutureBuilder into the Column (does not work)
Kevin Worth [Sun, 10 May 2020 20:28:53 +0000 (16:28 -0400)]
Move the FutureBuilder into the Column (does not work)

Again, this is a commit to get us back to the broken state before more
properly fixing things.

3 years agoAdd new Container to allow for margin
Kevin Worth [Sat, 2 May 2020 11:13:08 +0000 (07:13 -0400)]
Add new Container to allow for margin

The Center widget can't have margin, apparently, so we'll put it in
a Container which can.

3 years agoRename application id to com.appsiom.empires
Kevin Worth [Mon, 4 May 2020 03:06:08 +0000 (23:06 -0400)]
Rename application id to com.appsiom.empires

Because com.example was no good and so was flutterfamilies

3 years agoStop using dart:js in player.dart
Kevin Worth [Fri, 8 May 2020 12:52:02 +0000 (08:52 -0400)]
Stop using dart:js in player.dart

This "web only" package was preventing the app from being built on
Android and iOS, so now that we have a method for parsing the player
list, we no longer need to use the (albeit simpler) JsArray type.

See: https://dart-lang.github.io/linter/lints/avoid_web_libraries_in_flutter.html

3 years agoPut back the Column in main.dart
Kevin Worth [Sun, 10 May 2020 20:27:16 +0000 (16:27 -0400)]
Put back the Column in main.dart

This is a quasi-revert of e318ede47bc5b8563db84ce2c676c6a9297c860e

...where we took a shortcut by removing a bunch of stuff just to get
things to work, now we're putting it back in the broken state and some
following commits will fix it.

3 years agoAdd README.md
Kevin Worth [Mon, 27 Apr 2020 13:29:08 +0000 (13:29 +0000)]
Add README.md

3 years agoAdd method parsePlayers to player.dart
Kevin Worth [Fri, 8 May 2020 12:48:10 +0000 (08:48 -0400)]
Add method parsePlayers to player.dart

This gives us a convenience method to parse the
json returned from the server into a List<Player> object

3 years agoAdd another screenshot to the README
Kevin Worth [Fri, 8 May 2020 15:09:34 +0000 (11:09 -0400)]
Add another screenshot to the README

The README now has two screenshots in order to
demonstrate how the list of players can be updated
(by clicking on the "plus" button).

3 years agoAdd screenshot to root for current progress
Kevin Worth [Mon, 27 Apr 2020 12:51:02 +0000 (08:51 -0400)]
Add screenshot to root for current progress

3 years agoChange fetchPlayer to fetchFirstPlayer
Kevin Worth [Mon, 4 May 2020 02:39:44 +0000 (22:39 -0400)]
Change fetchPlayer to fetchFirstPlayer

Initially I was going to fix the logic in this method to fit the name,
but instead - for the time being - I'll simply make the name more
accurately describe what the method is doing.

3 years agoUpdate screenshot for README
Kevin Worth [Fri, 8 May 2020 15:06:24 +0000 (11:06 -0400)]
Update screenshot for README

The newest screenshot is now showing the game on an Android
emulator with a list of players.

3 years agoAdd some space in between TextFields for aesthetics
Kevin Worth [Mon, 27 Apr 2020 12:47:01 +0000 (08:47 -0400)]
Add some space in between TextFields for aesthetics

3 years agoAdd initState to start the async call to fetch player
Kevin Worth [Mon, 4 May 2020 00:21:31 +0000 (20:21 -0400)]
Add initState to start the async call to fetch player

initState is a good place to do asynchronous calls that we just
need to happen one time at the beginning.

So, in initStart we fetch the player and put it in a Future, and then
when (each and every time) build gets called, it uses what has
been fetched or shows the spinner if the fetch hasn't completed
successfully yet.

3 years agoMake the plus button act like refresh
Kevin Worth [Fri, 8 May 2020 15:02:30 +0000 (11:02 -0400)]
Make the plus button act like refresh

Tapping on the plus button now calls fetch again and redisplays the
updated list of players

3 years agoAdd label and TextField for entering the player's game name
Kevin Worth [Mon, 27 Apr 2020 12:38:57 +0000 (08:38 -0400)]
Add label and TextField for entering the player's game name

3 years agoAdd a FutureBuilder widget to hold a fetched player
Kevin Worth [Sun, 3 May 2020 19:31:41 +0000 (15:31 -0400)]
Add a FutureBuilder widget to hold a fetched player

Rather than doing a fetch within this build method (which gets called repeatedly),
we use a FutureBuilder to show a spinner until the player has finished being
fetched asynchronously.

3 years agoRip out column and just show player list view
Kevin Worth [Fri, 8 May 2020 15:01:21 +0000 (11:01 -0400)]
Rip out column and just show player list view

This was the easiest thing to do quickly, because a list view does not
play nicely inside of a column widget (can't put a scrollable inside of
a scrollable, sort of thing...)

Eventually, we need to combine the views or make separate screens for
each one.

3 years agoAdd TextField for entering (real) name
Kevin Worth [Mon, 27 Apr 2020 12:37:36 +0000 (08:37 -0400)]
Add TextField for entering (real) name

3 years agoAdd class RegisteredUser with name and character attributes
Kevin Worth [Sun, 3 May 2020 02:40:48 +0000 (22:40 -0400)]
Add class RegisteredUser with name and character attributes

This data model will be used when POSTing to /register

See:
    git://git.cworth.org/git/empires-api/api.text
    at commit 0411bdc

3 years agoAdd 'Empires' to homepage title
Kevin Worth [Mon, 27 Apr 2020 03:10:21 +0000 (23:10 -0400)]
Add 'Empires' to homepage title

3 years agoAdd class Player with id and name attributes
Kevin Worth [Sun, 3 May 2020 02:36:42 +0000 (22:36 -0400)]
Add class Player with id and name attributes

This data model will be used when hitting the /players endpoint

See:
    git://git.cworth.org/git/empires-api/api.text
    at commit 0411bdc

3 years agoChange app name to 'Families Game'
Kevin Worth [Mon, 27 Apr 2020 02:06:01 +0000 (22:06 -0400)]
Change app name to 'Families Game'

3 years agoAdd http library version 0.12.1 to pubspec.yaml
Kevin Worth [Sun, 3 May 2020 02:44:46 +0000 (22:44 -0400)]
Add http library version 0.12.1 to pubspec.yaml

3 years agoAdd all from `flutter create <name>`
Kevin Worth [Mon, 27 Apr 2020 01:56:32 +0000 (21:56 -0400)]
Add all from `flutter create <name>`

3 years agolmno.js: Drop the lmno_login and lmno_login_loadend functions
Carl Worth [Sat, 23 May 2020 13:00:25 +0000 (06:00 -0700)]
lmno.js: Drop the lmno_login and lmno_login_loadend functions

These were supporting some code in a separate repository (lmno-server)
but that repository has now gotten smart enough to host its own
JavaScript code so this is currently serving no purpose here.

3 years agoUse an absolute path for the events API
Carl Worth [Thu, 21 May 2020 17:24:31 +0000 (10:24 -0700)]
Use an absolute path for the events API

Again, from a bug report where a user's browser was unable to fetch
this resource.

3 years agoUse absolute references for CSS and JS files
Carl Worth [Thu, 21 May 2020 17:14:55 +0000 (10:14 -0700)]
Use absolute references for CSS and JS files

I wouldn't expect this to have a behavioral change, but I recently got
a bug report from some users who where unable to get these resources,
(their browser was trying to fetch them from
https://lmno.games/game.css instead of
https://lmno.games/epires/game.css).

3 years agoAdd JavaScript handling for the recently-added login form
Carl Worth [Thu, 21 May 2020 17:13:54 +0000 (10:13 -0700)]
Add JavaScript handling for the recently-added login form

The HTML for this login form isn't seen here. It exists inside of
lmno-server.

3 years agoAdd an "lmno_" prefix to our loadend functions
Carl Worth [Thu, 21 May 2020 17:10:13 +0000 (10:10 -0700)]
Add an "lmno_" prefix to our loadend functions

This gives a more natural binding between, for example, lmno_join and
lmno_join_loadend.

3 years agoDrop debugging statement to console.log
Carl Worth [Wed, 20 May 2020 14:43:23 +0000 (07:43 -0700)]
Drop debugging statement to console.log

We don't really intend to clutter up the browser console like this.

3 years agoActually make the top-level "join game" button work.
Carl Worth [Tue, 19 May 2020 15:44:34 +0000 (08:44 -0700)]
Actually make the top-level "join game" button work.

Embarrassingly enough, when I first implemented the handling of this
form, I only tested that it gave a proper error message for an invalid
ID. Somehow I totally neglected to even test (let alone implement!)
the handling of a valid ID.

Fortunately, the missing implementation is _very_ easy. Just send the
browser to the URL for the game ID that was entered.

3 years agoFix a typo: "fot" instead of "for"
Carl Worth [Mon, 18 May 2020 15:58:39 +0000 (08:58 -0700)]
Fix a typo: "fot" instead of "for"

And while fixing that, cleaning up the surrounding sentence.

3 years agoAdd the standard viewport element
Carl Worth [Sun, 17 May 2020 23:56:13 +0000 (16:56 -0700)]
Add the standard viewport element

I wish this were the default. I'm always having to receive a report
that it's broken before I realize what's going on.

3 years agoAdd a link from the top-level page to the static page Empires
Carl Worth [Sun, 17 May 2020 22:43:26 +0000 (15:43 -0700)]
Add a link from the top-level page to the static page Empires

So that it's actually possible to find how to host a new game

3 years agoAdd basic them-based styling of link colors
Carl Worth [Sun, 17 May 2020 22:43:01 +0000 (15:43 -0700)]
Add basic them-based styling of link colors

Since the default lnik colors are _horrible_.

3 years agoempirs: Switch to using local server to handle all game events
Carl Worth [Sun, 17 May 2020 22:37:32 +0000 (15:37 -0700)]
empirs: Switch to using local server to handle all game events

The local server is now much more capable than the old one at
https://families.cworth.org/api (since the local one can now
handle multiple simultaneous games each with a different ID).

3 years agoempires: Fix references to "local" CSS and JS files
Carl Worth [Sun, 17 May 2020 22:13:24 +0000 (15:13 -0700)]
empires: Fix references to "local" CSS and JS files

While it's tempting to just treat these as coming from the current
directory, in practice this HTMl page will be served from a dynamic
path that includes the game ID as a path component. So we have to
look up one directory to find these resources.

3 years agoempires: Add a top-level static page for the Empires game
Carl Worth [Sun, 17 May 2020 22:10:08 +0000 (15:10 -0700)]
empires: Add a top-level static page for the Empires game

This has a basic description of the game along with a button to host a
new instance of the game.

There is a tiny bit of JavaScript added to support the new button,
(simply calling the server API to generate a new game and then
redirecting to the new game ID or else generating an error message).

3 years agostyle: Add some padding at the bottom of any form
Carl Worth [Sun, 17 May 2020 22:05:57 +0000 (15:05 -0700)]
style: Add some padding at the bottom of any form

This is some really basic style that is sorely needed by default.

It's also exactly the styling that was missing that motivated be to
put a gratuitous <br> in here earlier. So we take that out here.

3 years agostyle: Add some basic support for a bulleted list.
Carl Worth [Sun, 17 May 2020 22:02:07 +0000 (15:02 -0700)]
style: Add some basic support for a bulleted list.

It's somewhat surprising that the reset.css even removes all bullets
from list items, but there you have it.

3 years agostyle: Remove some duplicated code between h1 and h2
Carl Worth [Sun, 17 May 2020 21:59:57 +0000 (14:59 -0700)]
style: Remove some duplicated code between h1 and h2

By adding one block for both h1 _and_ h2 to hold common properties.

3 years agoempires: Fix indentation of game.html
Carl Worth [Sun, 17 May 2020 16:39:05 +0000 (09:39 -0700)]
empires: Fix indentation of game.html

There were a couple of misguided attempts to keep content closer to
the left column here, but were in fact just inconsistent
indentation. Fix things up to be consistently indented according to
the actual document structure.

3 years agoempires: Rename all files (html, js, and css) to game.*
Carl Worth [Sun, 17 May 2020 16:35:43 +0000 (09:35 -0700)]
empires: Rename all files (html, js, and css) to game.*

These are all the files for manipulating a single instance of a
game. We're moving this away from index.html so that we can have a
separate page at index.html for giving game instructions and allowing
users to host a new game.

So, along with the new name of game.html, we also rename supporting
files to game.css and game.js to be consistent.

3 years agomake deploy: Go back to deleting any pre-existing files on the server
Carl Worth [Sun, 17 May 2020 16:13:37 +0000 (09:13 -0700)]
make deploy: Go back to deleting any pre-existing files on the server

We stopped doing this back in commit
0bce98367c70c43eaa425aad101e15ed3db612a8 specifically because I was
concerned about a deployment of the top-level "lmno.games" content
obliterating lower-level content (such as that deployed by the
"empires-html" repository).

But now, I've switched to hosting the empires HTML content in this
same repository where it will be deployed together. And that's my plan
going forward, to house all static HTML content here in this
lmno.games repository. So in this commit we start passing the --delete
flag to rsync again.

The one exception is the "flempires" directory where Kevin is
currently experimenting. In the future, we'll likely incorporate that
content into this repository as well. But for now, we simply
explicitly exclude it so that deployments here won't destroy anything
he has deployed there.

0bce98367c70c43eaa425aad101e15ed3db612a8#

3 years agoAdd some comments on the CSS for styling the empires client
Carl Worth [Sun, 17 May 2020 15:58:04 +0000 (08:58 -0700)]
Add some comments on the CSS for styling the empires client

At this point, all of the generic styling, (for paragraphs, forms,
etc.), has been moved up to the top level. So the only styling left at
the level of the empires directory are things to set very
empires-specific things, (such as showing/hiding elements for
particular game states).

3 years agoUse named color to set the character of the character-reveal element
Carl Worth [Sun, 17 May 2020 15:56:54 +0000 (08:56 -0700)]
Use named color to set the character of the character-reveal element

This makes me so happy! With these named colors, a low-level style
file like this one now has no explicit color values in it, but instead
simply inherits the defined, named colors from the theme above.

3 years agoMove input sizing from empires to top-level
Carl Worth [Sun, 17 May 2020 15:52:25 +0000 (08:52 -0700)]
Move input sizing from empires to top-level

There's no reason the empires client should be overriding the size of
input fields. These should be consistent across all games.

And we choose the size of 40 that the empires client had, which is
slightly smaller than what we were getting otherwise, (which looked
just a tiny bit, comically large).

3 years agoMove paragraph-spacing from empires/style.css to style.css
Carl Worth [Sun, 17 May 2020 15:50:44 +0000 (08:50 -0700)]
Move paragraph-spacing from empires/style.css to style.css

This is a useful spacing directive, so we want it applied at the
top-level, not just in the empires directory.

3 years agoApply our selected text color to haeaders (h1 and h2)
Carl Worth [Sun, 17 May 2020 15:47:54 +0000 (08:47 -0700)]
Apply our selected text color to haeaders (h1 and h2)

This was previously happening in the empires client, but now we move
this up to the top-level.

Note that we don't use the selected text color at minimal font sizes
(such as in the "body" element in general). This is because we want a
high contrast there for maximal legibility. So we introduce an
additional named --text-fo-color-max-contrast which is set to pure
black.

3 years agoUse CSS custom properties to define named colors
Carl Worth [Sun, 17 May 2020 15:43:19 +0000 (08:43 -0700)]
Use CSS custom properties to define named colors

Hurrah! I've only wanted this feature for decades.

Thanks to Richard for pointing out that it's now been well-supported
long enough that I can reliably use it. This will really help so that
I can change colors in one place and have the entire style follow the
scheme.

3 years agoInsert a line break before the "Players in the game" section
Carl Worth [Sun, 17 May 2020 15:30:32 +0000 (08:30 -0700)]
Insert a line break before the "Players in the game" section

It would be more semantic to have actual "sections" in the content and
some styling that sets proper spacing between sections. But that feels
like overkill given the current simplicity of the page, and the
current problem that there was just too little space at this one
point.

If we do make the page more complex in the future, we can certainly
add semantic sections.

3 years agoFix the page width to allow the content to be a full 720px wide
Carl Worth [Sun, 17 May 2020 15:25:06 +0000 (08:25 -0700)]
Fix the page width to allow the content to be a full 720px wide

The code that was written here with numeric values of 720px was
assuming that the page interior would be as wide as 720px and that
padding would not be counted in that. But when we brought this code to
lmno we violated that assumption by using "box-sizing: border-box" on
the page, (making the padding be counted in computing the width of the
page.

The result of that was that the actual content of the page was only
620px and with actual paragraphs of text included now as part of the
empires client, it's clear that that was narrower than we really want.

So, in this commit, we account for the border-box semantics by using a
maximum page width of 820px (padding inclusive) so that the actual
page contents can be as wide as 720px.

3 years agoTweak the line-height down a bit
Carl Worth [Sun, 17 May 2020 15:23:41 +0000 (08:23 -0700)]
Tweak the line-height down a bit

Now that we've added some actual paragraphs of text, (with the empires
client), it's plain to see that a line spacing of 1.5 is just a bit
too much. It just looks better a bit smaller like this.

3 years agoempires: Adapt HTML to use 'form-field' instead of 'form-row' class
Carl Worth [Sun, 17 May 2020 15:15:45 +0000 (08:15 -0700)]
empires: Adapt HTML to use 'form-field' instead of 'form-row' class

The top-level style.css uses this slightly different (but more
accurate) class naming. By adapting to it here, we also simplify the
empires-specific CSS file to not need to define its own form layout.

3 years agoempires: Defer to top-level style sheet for as much as possible
Carl Worth [Sun, 17 May 2020 15:13:02 +0000 (08:13 -0700)]
empires: Defer to top-level style sheet for as much as possible

Most of the top-level lmno style.css was originally copied from the
style.css file from empires-html in the first place. So there was a
lot od fuplication in these files.

In this commit, we reference the top-level style.css from the empires
HTML file and drop from the empires style.css file all directives that
already exist above.

3 years agoRemove the reset.css from the empires sub-directory
Carl Worth [Sun, 17 May 2020 15:04:00 +0000 (08:04 -0700)]
Remove the reset.css from the empires sub-directory

Instead, just pointing up to the top-level one instead, (which happens
to be identical anyway).

3 years agoDrop the Makefile from the empires directory
Carl Worth [Sun, 17 May 2020 14:58:38 +0000 (07:58 -0700)]
Drop the Makefile from the empires directory

The top-level Makefile knows how to deploy all content including all
sub-directories, so we don't need a lower-level Makefile at all.

3 years agoMerge in empires-html client
Carl Worth [Sun, 17 May 2020 14:53:51 +0000 (07:53 -0700)]
Merge in empires-html client

This HTML client for the empires game was originally developed in a
separate repository (and at the top-level).

In order to create this commit, I first rewrote the history of the
empires-html repository with:

git-filter-repo --path-rename '':empires/

to move all of its content down into the empires sub-directory.

I then fetched things over to thi repository with:

git fetch ../empires-html-filtered
        git merge --allow-unrelated-histories FETCH_HEAD

Going forward, we can develop the empires client within a
sub-directory of the lmno.games content (so they can share common
resources such as reset.css and style.css, etc.).