You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
import Component from '../rivets/Component.js'
|
|
|
|
// The root application component
|
|
export default class App extends Component {
|
|
static selector() { return 'app-root' }
|
|
static template() { return `
|
|
<h1>Connect 4 by Garrett Mills</h1>
|
|
<p>This is a simple Connect-4 webtoy that I built as a project for EECS 368 at the University of Kansas. It's a two person game - take turns. Click the slot at the top of a column on the grid to drop the token on your turn.</p>
|
|
<app-grid parent-app="self"></app-grid>
|
|
<app-scoreboard parent-app="self"></app-scoreboard>
|
|
<p><small>© { year } <a href="https://garrettmills.dev/">Garrett Mills</a> | <a href="#">Source Code</a></small></p>
|
|
` }
|
|
|
|
// The current year for the copyright message
|
|
year = ''
|
|
|
|
constructor(el, data) {
|
|
super(el, data)
|
|
|
|
// Set the current year
|
|
this.year = (new Date).getFullYear()
|
|
}
|
|
|
|
// Callback for the grid creation. Gives access to the Grid class
|
|
register_grid(grid) {
|
|
this.grid = grid
|
|
}
|
|
|
|
// Callback for the scoreboard creation. Gives access to the Scoreboard class
|
|
register_scoreboard(scoreboard) {
|
|
this.scoreboard = scoreboard
|
|
}
|
|
}
|