-
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.
- Loading branch information
Showing
139 changed files
with
7,294 additions
and
3,940 deletions.
There are no files selected for viewing
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,3 @@ | ||
.button { | ||
float: right; | ||
} |
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,6 @@ | ||
<button type="button" local-class="button" {{on "click" this.toggle}}>{{if this.show "Hide code" "Show code"}}</button> | ||
{{#if this.show}} | ||
{{#let (get-code-snippet @name) as |snippet|}} | ||
<CodeBlock @code= {{snippet.source}} @language={{snippet.language}} /> | ||
{{/let}} | ||
{{/if}} |
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,12 @@ | ||
import Component from '@glimmer/component'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { action } from '@ember/object'; | ||
|
||
export default class CodeSnippetComponent extends Component { | ||
@tracked show = false; | ||
|
||
@action | ||
toggle() { | ||
this.show = !this.show; | ||
} | ||
} |
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,21 @@ | ||
.container { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.solution1, .solution2, .description { | ||
width: 30vw; | ||
} | ||
|
||
.description h2 { | ||
margin-top: 0px; | ||
} | ||
|
||
@media (max-width: 900px) { | ||
.container { | ||
flex-direction: column; | ||
} | ||
.solution1, .solution2, .description { | ||
width: 100%; | ||
} | ||
} |
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,21 @@ | ||
<div local-class="intro"> | ||
<h2>Day {{@number}}</h2> | ||
<p>The puzzle can be found <a href='https://adventofcode.com/2022/day/{{@number}}'>here</a>.<br> | ||
The puzzle always has example input and a personalised input.<br> | ||
You can use the toggle below to toggle between the example solution and the personalised solution | ||
<Inputtoggle @toggle={{this.toggle}}/> | ||
</p> | ||
</div> | ||
<div local-class="container"> | ||
<div local-class="solution1"> | ||
Solution 1 is {{if this.input @solution1 @example1}} | ||
<CodeSnippet @name="day{{ @number}}-solution1.js"/> | ||
</div> | ||
<div local-class="solution2"> | ||
Solution 2 is {{if this.input @solution2 @example2}} | ||
<CodeSnippet @name="day{{ @number}}-solution2.js"/> | ||
</div> | ||
<div local-class="description"> | ||
{{yield}} | ||
</div> | ||
</div> |
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,12 @@ | ||
import Component from '@glimmer/component'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { action } from '@ember/object'; | ||
|
||
export default class DayComponent extends Component { | ||
@tracked input = false; | ||
|
||
@action | ||
toggle(val) { | ||
this.input = val; | ||
} | ||
} |
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,46 @@ | ||
.container { | ||
display: flex; | ||
} | ||
|
||
.container input[type="checkbox"] { | ||
position: absolute; | ||
opacity: 0; | ||
width: 250px; | ||
height: 25px; | ||
cursor: pointer; | ||
} | ||
|
||
.switch { | ||
margin: 0px 5px; | ||
display: flex; | ||
align-items: center; | ||
width: 40px; | ||
} | ||
|
||
.circle.right { | ||
transform: translateX(24px) | ||
} | ||
|
||
|
||
.bar { | ||
width: 40px; | ||
height: 5px; | ||
border-radius: 5px; | ||
background-color: var(--base0); | ||
position: absolute; | ||
} | ||
|
||
.circle { | ||
height: 16px; | ||
width: 16px; | ||
border-radius: 50%; | ||
background-color: var(--theme-color); | ||
z-index: 1; | ||
transition: transform .8s; | ||
} | ||
|
||
.circle.focused { | ||
box-shadow: 0 0 8px var(--blue); | ||
} | ||
|
||
|
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,9 @@ | ||
<label local-class="container" for="input"> | ||
<span>example</span> | ||
<div local-class="switch"> | ||
<div local-class="bar"></div> | ||
<div local-class="circle {{if this.input "right" "left"}} {{if this.focused "focused" ""}}"></div> | ||
</div> | ||
<input type="checkbox" id="input" name="input" value="input" checked={{this.input}} {{on 'click' this.toggle}} {{on 'focusin' this.handleFocusIn}} | ||
{{on 'focusout' this.handleFocusOut}}>personalised input | ||
</label> |
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,23 @@ | ||
import Component from '@glimmer/component'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { action } from '@ember/object'; | ||
|
||
export default class InputtoggleComponent extends Component { | ||
@tracked input = true; | ||
@tracked focused = false; | ||
@action | ||
toggle() { | ||
this.input = !this.input; | ||
this.args.toggle?.(this.input); | ||
} | ||
|
||
@action | ||
handleFocusIn() { | ||
this.focused = true; | ||
} | ||
|
||
@action | ||
handleFocusOut() { | ||
this.focused = false; | ||
} | ||
} |
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,15 @@ | ||
import PuzzlesBaseController from './base'; | ||
|
||
export default class Puzzles1Controller extends PuzzlesBaseController { | ||
// BEGIN-SNIPPET day1-solution1 | ||
solve1(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
|
||
// BEGIN-SNIPPET day1-solution2 | ||
solve2(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
} |
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,15 @@ | ||
import PuzzlesBaseController from './base'; | ||
|
||
export default class Puzzles10Controller extends PuzzlesBaseController { | ||
// BEGIN-SNIPPET day10-solution1 | ||
solve1(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
|
||
// BEGIN-SNIPPET day10-solution2 | ||
solve2(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
} |
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,15 @@ | ||
import PuzzlesBaseController from './base'; | ||
|
||
export default class Puzzles11Controller extends PuzzlesBaseController { | ||
// BEGIN-SNIPPET day11-solution1 | ||
solve1(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
|
||
// BEGIN-SNIPPET day11-solution2 | ||
solve2(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
} |
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,15 @@ | ||
import PuzzlesBaseController from './base'; | ||
|
||
export default class Puzzles12Controller extends PuzzlesBaseController { | ||
// BEGIN-SNIPPET day12-solution1 | ||
solve1(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
|
||
// BEGIN-SNIPPET day12-solution2 | ||
solve2(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
} |
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,15 @@ | ||
import PuzzlesBaseController from './base'; | ||
|
||
export default class Puzzles13Controller extends PuzzlesBaseController { | ||
// BEGIN-SNIPPET day13-solution1 | ||
solve1(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
|
||
// BEGIN-SNIPPET day13-solution2 | ||
solve2(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
} |
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,15 @@ | ||
import PuzzlesBaseController from './base'; | ||
|
||
export default class Puzzles14Controller extends PuzzlesBaseController { | ||
// BEGIN-SNIPPET day14-solution1 | ||
solve1(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
|
||
// BEGIN-SNIPPET day14-solution2 | ||
solve2(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
} |
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,15 @@ | ||
import PuzzlesBaseController from './base'; | ||
|
||
export default class Puzzles15Controller extends PuzzlesBaseController { | ||
// BEGIN-SNIPPET day15-solution1 | ||
solve1(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
|
||
// BEGIN-SNIPPET day15-solution2 | ||
solve2(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
} |
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,15 @@ | ||
import PuzzlesBaseController from './base'; | ||
|
||
export default class Puzzles16Controller extends PuzzlesBaseController { | ||
// BEGIN-SNIPPET day16-solution1 | ||
solve1(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
|
||
// BEGIN-SNIPPET day16-solution2 | ||
solve2(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
} |
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,15 @@ | ||
import PuzzlesBaseController from './base'; | ||
|
||
export default class Puzzles17Controller extends PuzzlesBaseController { | ||
// BEGIN-SNIPPET day17-solution1 | ||
solve1(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
|
||
// BEGIN-SNIPPET day17-solution2 | ||
solve2(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
} |
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,15 @@ | ||
import PuzzlesBaseController from './base'; | ||
|
||
export default class Puzzles18Controller extends PuzzlesBaseController { | ||
// BEGIN-SNIPPET day18-solution1 | ||
solve1(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
|
||
// BEGIN-SNIPPET day18-solution2 | ||
solve2(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
} |
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,15 @@ | ||
import PuzzlesBaseController from './base'; | ||
|
||
export default class Puzzles19Controller extends PuzzlesBaseController { | ||
// BEGIN-SNIPPET day19-solution1 | ||
solve1(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
|
||
// BEGIN-SNIPPET day19-solution2 | ||
solve2(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
} |
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,15 @@ | ||
import PuzzlesBaseController from './base'; | ||
|
||
export default class Puzzles2Controller extends PuzzlesBaseController { | ||
// BEGIN-SNIPPET day2-solution1 | ||
solve1(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
|
||
// BEGIN-SNIPPET day2-solution2 | ||
solve2(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
} |
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,15 @@ | ||
import PuzzlesBaseController from './base'; | ||
|
||
export default class Puzzles20Controller extends PuzzlesBaseController { | ||
// BEGIN-SNIPPET day20-solution1 | ||
solve1(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
|
||
// BEGIN-SNIPPET day20-solution2 | ||
solve2(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
} |
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,15 @@ | ||
import PuzzlesBaseController from './base'; | ||
|
||
export default class Puzzles21Controller extends PuzzlesBaseController { | ||
// BEGIN-SNIPPET day21-solution1 | ||
solve1(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
|
||
// BEGIN-SNIPPET day21-solution2 | ||
solve2(input) { | ||
return 'Solution 1'; | ||
} | ||
// END-SNIPPET | ||
} |
Oops, something went wrong.