-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from ppeters0502/100days_thirteen
Day Thirteen writeup done
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/data/100 Days of Code - Day Thirteen (or fourteen or fi.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
id: 25 | ||
title: 100 Days of Code - Day Thirteen (or fourteen fifteen or whatever) | ||
publishedDate: 06/17/2024 | ||
featureImage: https://i.imgur.com/KJMDnr9.gif | ||
tags: | ||
- 100_days | ||
--- | ||
## Intro | ||
Hello Internet! | ||
|
||
I'm not gonna lie, keeping this up over the weekends with two young kids and family obligations is getting tricky! | ||
|
||
For the obligatory recap, as mentioned in my [original post](https://screamintothevoid.today/blog/13) I'm working on a challenge to spend at least an hour writing code every day for the next 100 Days! Here are the rules I'm setting myself: | ||
* Code minimum an hour every day for the next 100 days. | ||
* Post my progress every day on my blog. | ||
|
||
Here is where I'm currently at: | ||
 | ||
## What are we doing today? | ||
Hopefully today I want to have the chessboard at least displaying on a webpage, and then I can start putting together a backend. | ||
|
||
For development purposes, I'm using Docker to setup nginx and host the webpage on my localhost, so I first set up a Dockerfile with nginx to serve up a basic html page. | ||
|
||
 | ||
## Chessboard.js | ||
After getting a basic html page to come up, I downloaded the files for [Chessboard.js](https://chessboardjs.com/) and added the correct imports. It's barebones, but here is what's there for now: | ||
 | ||
Rebuild the image, run a container, and now: | ||
the chessboard is here! | ||
|
||
Unfortunately right now none of the pieces are movable, since there aren't any JS event handlers setup yet, so I have some work to do in order to get the pieces moving. | ||
|
||
After looking at some of the example code that's on the chessboard.js site, I find one for clearing and setting the board. It's pretty much the same thing I had earlier, but with two extra buttons: | ||
 | ||
And a little bit of JS to handle clearing and creating the board: | ||
 | ||
After adding this, I refresh the page and | ||
we can move pieces now!! | ||
It's still super basic, but I think I'm going to leave that for now. Tomorrow I'm going to start digging into the chessboard.js API so that I can (hopefully) start setting up a back end that can work with the board. | ||
|
||
We'll see you on the next one! |