From 133915edc702d85080dc03bc4585ba342ca498b6 Mon Sep 17 00:00:00 2001 From: Anne-Greeth van Herwijnen Date: Mon, 27 Nov 2023 18:43:11 +0100 Subject: [PATCH] Update styling, responsiveness & fix linting --- .template-lintrc.js | 2 ++ README.md | 2 ++ app/components/day.hbs | 4 ++-- app/components/inputtoggle.hbs | 4 ++-- app/controllers/puzzles/1.js | 2 ++ app/controllers/puzzles/10.js | 1 + app/controllers/puzzles/11.js | 1 + app/controllers/puzzles/12.js | 1 + app/controllers/puzzles/13.js | 1 + app/controllers/puzzles/14.js | 1 + app/controllers/puzzles/15.js | 1 + app/controllers/puzzles/16.js | 1 + app/controllers/puzzles/17.js | 1 + app/controllers/puzzles/18.js | 1 + app/controllers/puzzles/19.js | 1 + app/controllers/puzzles/2.js | 1 + app/controllers/puzzles/20.js | 1 + app/controllers/puzzles/21.js | 1 + app/controllers/puzzles/22.js | 1 + app/controllers/puzzles/23.js | 1 + app/controllers/puzzles/24.js | 1 + app/controllers/puzzles/25.js | 1 + app/controllers/puzzles/3.js | 1 + app/controllers/puzzles/4.js | 1 + app/controllers/puzzles/5.js | 1 + app/controllers/puzzles/6.js | 1 + app/controllers/puzzles/7.js | 1 + app/controllers/puzzles/8.js | 1 + app/controllers/puzzles/9.js | 1 + app/controllers/puzzles/base.js | 17 +++++++++++++++-- app/styles/app.css | 34 +++++++++++++++++++++++++++++---- app/templates/application.hbs | 2 +- blueprints/puzzle/index.js | 1 + 33 files changed, 81 insertions(+), 11 deletions(-) diff --git a/.template-lintrc.js b/.template-lintrc.js index f35f61c..0b2f00b 100644 --- a/.template-lintrc.js +++ b/.template-lintrc.js @@ -2,4 +2,6 @@ module.exports = { extends: 'recommended', + + ignore: ['blueprints/**'], }; diff --git a/README.md b/README.md index c367723..e4b0bff 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Welcome to our amazing Advent of Code app. We (MinThamie & LiuLangZhe (sis & bro)) will try to solve as many of the 2023 Advent of Code puzzles as possible. In previous years we used to do this seperately, but this year we want to bundle our efforts, so we've updated MinThaMie's UI to house both our inputs! Each day will show a silver or gold medal, depending on wheter we got 1 or two stars! +[![Netlify Status](https://api.netlify.com/api/v1/badges/5ec72945-2653-447b-9a0a-1b8cf3ac89b3/deploy-status)](https://app.netlify.com/sites/advent-of-code-2023/deploys) + ## Prerequisites You will need the following things properly installed on your computer. diff --git a/app/components/day.hbs b/app/components/day.hbs index fcf9a69..cf01bf0 100644 --- a/app/components/day.hbs +++ b/app/components/day.hbs @@ -1,8 +1,8 @@

Day {{@number}}

-

The puzzle can be found here.
+

The puzzle can be found here.
The puzzle always has example input and a personalised input.
- You can use the toggle below to toggle between the example solution and the personalised solution + You can use the toggle below to toggle between the example solution and the personalised solution.

diff --git a/app/components/inputtoggle.hbs b/app/components/inputtoggle.hbs index 5f6bf84..605daba 100644 --- a/app/components/inputtoggle.hbs +++ b/app/components/inputtoggle.hbs @@ -1,9 +1,9 @@ diff --git a/app/controllers/puzzles/1.js b/app/controllers/puzzles/1.js index 7259aa9..2222985 100644 --- a/app/controllers/puzzles/1.js +++ b/app/controllers/puzzles/1.js @@ -1,3 +1,5 @@ +/* eslint-disable no-unused-vars */ + import PuzzlesBaseController from './base'; export default class Puzzles1Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/10.js b/app/controllers/puzzles/10.js index 5c34c3a..58093ef 100644 --- a/app/controllers/puzzles/10.js +++ b/app/controllers/puzzles/10.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles10Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/11.js b/app/controllers/puzzles/11.js index a4662c9..14f0ba1 100644 --- a/app/controllers/puzzles/11.js +++ b/app/controllers/puzzles/11.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles11Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/12.js b/app/controllers/puzzles/12.js index 08a3dc6..6b422b8 100644 --- a/app/controllers/puzzles/12.js +++ b/app/controllers/puzzles/12.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles12Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/13.js b/app/controllers/puzzles/13.js index f5ffaea..da64a48 100644 --- a/app/controllers/puzzles/13.js +++ b/app/controllers/puzzles/13.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles13Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/14.js b/app/controllers/puzzles/14.js index 55876e1..2baecad 100644 --- a/app/controllers/puzzles/14.js +++ b/app/controllers/puzzles/14.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles14Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/15.js b/app/controllers/puzzles/15.js index 93a26b1..bac39dc 100644 --- a/app/controllers/puzzles/15.js +++ b/app/controllers/puzzles/15.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles15Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/16.js b/app/controllers/puzzles/16.js index 841cf52..89a8878 100644 --- a/app/controllers/puzzles/16.js +++ b/app/controllers/puzzles/16.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles16Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/17.js b/app/controllers/puzzles/17.js index c858390..5989bf5 100644 --- a/app/controllers/puzzles/17.js +++ b/app/controllers/puzzles/17.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles17Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/18.js b/app/controllers/puzzles/18.js index d6e51b7..be79bac 100644 --- a/app/controllers/puzzles/18.js +++ b/app/controllers/puzzles/18.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles18Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/19.js b/app/controllers/puzzles/19.js index 1255db6..2259129 100644 --- a/app/controllers/puzzles/19.js +++ b/app/controllers/puzzles/19.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles19Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/2.js b/app/controllers/puzzles/2.js index 664033d..76f81ef 100644 --- a/app/controllers/puzzles/2.js +++ b/app/controllers/puzzles/2.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles2Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/20.js b/app/controllers/puzzles/20.js index 1a0c68c..f000c64 100644 --- a/app/controllers/puzzles/20.js +++ b/app/controllers/puzzles/20.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles20Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/21.js b/app/controllers/puzzles/21.js index 2517ee5..4f54582 100644 --- a/app/controllers/puzzles/21.js +++ b/app/controllers/puzzles/21.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles21Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/22.js b/app/controllers/puzzles/22.js index 624b29f..43fedf7 100644 --- a/app/controllers/puzzles/22.js +++ b/app/controllers/puzzles/22.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles22Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/23.js b/app/controllers/puzzles/23.js index 0e538c6..79f2f76 100644 --- a/app/controllers/puzzles/23.js +++ b/app/controllers/puzzles/23.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles23Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/24.js b/app/controllers/puzzles/24.js index 09fee3f..cb8986b 100644 --- a/app/controllers/puzzles/24.js +++ b/app/controllers/puzzles/24.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles24Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/25.js b/app/controllers/puzzles/25.js index 2b2c1f7..1299f0f 100644 --- a/app/controllers/puzzles/25.js +++ b/app/controllers/puzzles/25.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles25Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/3.js b/app/controllers/puzzles/3.js index e48038d..cecf117 100644 --- a/app/controllers/puzzles/3.js +++ b/app/controllers/puzzles/3.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles3Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/4.js b/app/controllers/puzzles/4.js index 8392ef3..e47709f 100644 --- a/app/controllers/puzzles/4.js +++ b/app/controllers/puzzles/4.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles4Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/5.js b/app/controllers/puzzles/5.js index a006e96..c64602d 100644 --- a/app/controllers/puzzles/5.js +++ b/app/controllers/puzzles/5.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles5Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/6.js b/app/controllers/puzzles/6.js index 040482e..b445721 100644 --- a/app/controllers/puzzles/6.js +++ b/app/controllers/puzzles/6.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles6Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/7.js b/app/controllers/puzzles/7.js index f5df6a3..36fefc6 100644 --- a/app/controllers/puzzles/7.js +++ b/app/controllers/puzzles/7.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles7Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/8.js b/app/controllers/puzzles/8.js index 9102d30..b61f2ef 100644 --- a/app/controllers/puzzles/8.js +++ b/app/controllers/puzzles/8.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles8Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/9.js b/app/controllers/puzzles/9.js index 370c8e1..8e6fd53 100644 --- a/app/controllers/puzzles/9.js +++ b/app/controllers/puzzles/9.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import PuzzlesBaseController from './base'; export default class Puzzles9Controller extends PuzzlesBaseController { diff --git a/app/controllers/puzzles/base.js b/app/controllers/puzzles/base.js index c9e6324..097d988 100644 --- a/app/controllers/puzzles/base.js +++ b/app/controllers/puzzles/base.js @@ -1,16 +1,29 @@ import Controller from '@ember/controller'; +import { htmlSafe } from '@ember/template'; export default class PuzzlesBaseController extends Controller { get example1() { return this.solve1(this.model.example); } get solution1() { - return `MinThaMie's solution: ${this.solve1(this.model.fullMinThaMie)}

LiuLangZhe's solution: ${this.solve1(this.model.fullLiuLangzhe)}`;; + return htmlSafe( + ``, + ); } get example2() { return this.solve2(this.model.example); } get solution2() { - return `MinThaMie's solution: ${this.solve2(this.model.fullMinThaMie)}

LiuLangZhe's solution: ${this.solve2(this.model.fullLiuLangzhe)}`; + return htmlSafe( + ``, + ); } } diff --git a/app/styles/app.css b/app/styles/app.css index 9391b25..723e449 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -36,6 +36,7 @@ a { h1 { margin-top: 0; + font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; } .navigation { @@ -98,6 +99,17 @@ h1 { .button { float: right; + cursor: pointer; + background: transparent; + border: 2px solid var(--theme-color); + border-radius: 8px; + padding: 2px 4px; + transition: all 0.3s; +} + +.button:hover { + background-color: var(--theme-color); + color: white; } /* Day */ @@ -108,6 +120,10 @@ h1 { gap: 20px; } +.intro p { + line-height: 1.5em; +} + .solution1, .solution2, .description { @@ -118,11 +134,19 @@ h1 { margin-top: 0; } -@media (max-width: 900px) { +@media (width <= 900px) { + body { + display: flex; + flex-flow: wrap column; + } + .container { flex-direction: column; } - .solution1, .solution2, .description { + + .solution1, + .solution2, + .description { width: 100%; } } @@ -130,7 +154,9 @@ h1 { /* Input toggle */ .input-container { + margin-top: 20px; display: flex; + font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; } .input-container input[type="checkbox"] { @@ -142,7 +168,7 @@ h1 { } .switch { - margin: 0px 5px; + margin: 0 5px; display: flex; align-items: center; width: 40px; @@ -166,7 +192,7 @@ h1 { border-radius: 50%; background-color: var(--theme-color); z-index: 1; - transition: transform .8s; + transition: transform 0.8s; } .circle.focused { diff --git a/app/templates/application.hbs b/app/templates/application.hbs index f59248f..400e9e1 100644 --- a/app/templates/application.hbs +++ b/app/templates/application.hbs @@ -29,7 +29,7 @@
-

Welcome to MinThaMie & Liulangzhe's advent of code 2023

+

Welcome to MinThaMie & LiuLangZhe's advent of code 2023

{{outlet}}