Skip to content

Commit

Permalink
correct number of stars
Browse files Browse the repository at this point in the history
  • Loading branch information
shahata committed Dec 7, 2023
1 parent 91d36d1 commit 937a149
Show file tree
Hide file tree
Showing 23 changed files with 1,683 additions and 1,450 deletions.
2 changes: 1 addition & 1 deletion src/2022/end.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/2022/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=<
<main>
<article>
<p>From here, you can access all of the events (and the corresponding puzzles, leaderboards, stats, etc) ever run on Advent of Code:</p>
<div class="eventlist-event"><a href="../2023/index.html">[2023]</a> <a href="/2023/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
<div class="eventlist-event"><a href="../2023/index.html">[2023]</a> <span class="star-count">14*</span> <a href="/2023/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
<div class="eventlist-event"><a href="../2022/index.html">[2022]</a> <span class="star-count">50*</span> <a href="/2022/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
<div class="eventlist-event"><a href="../2021/index.html">[2021]</a> <span class="star-count">50*</span> <a href="/2021/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
<div class="eventlist-event"><a href="../2020/index.html">[2020]</a> <span class="star-count">50*</span> <a href="/2020/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
Expand All @@ -41,7 +41,7 @@ <h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=<
<div class="eventlist-event"><a href="../2017/index.html">[2017]</a> <span class="star-count">50*</span> <a href="/2017/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
<div class="eventlist-event"><a href="../2016/index.html">[2016]</a> <span class="star-count">50*</span> <a href="/2016/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
<div class="eventlist-event"><a href="../2015/index.html">[2015]</a> <span class="star-count">50*</span> <a href="/2015/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
<p>Total stars: <span class="star-count">400*</span></article>
<p>Total stars: <span class="star-count">414*</span></article>
</main>
</body>
</html>
68 changes: 34 additions & 34 deletions src/2022/index.html

Large diffs are not rendered by default.

2,973 changes: 1,593 additions & 1,380 deletions src/2022/leaderboard.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/2023/day01.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">14*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/2023/day02.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">14*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/2023/day03.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">14*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/2023/day04.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">14*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/2023/day05.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">14*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/2023/day06.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">14*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/2023/day07.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">14*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/2023/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">14*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
14 changes: 7 additions & 7 deletions src/2023/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">14*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand All @@ -31,14 +31,14 @@ <h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=<
</header>
<main>
<style>
.calendar .calendar-color-s { color:#e3b585; }
.calendar .calendar-color-m { color:#d4dde4; }
.calendar .calendar-color-y { color:#ffff66; text-shadow:0 0 5px #ffff66, 0 0 10px #ffff66; }
.calendar .calendar-color-b { color:#5555bb; }
.calendar .calendar-color-g { color:#00cc00; }
.calendar .calendar-color-n { color:#9b715b; }
.calendar .calendar-color-l { color:#ccccff; }
.calendar .calendar-color-w { color:#ffffff; }
.calendar .calendar-color-l { color:#ccccff; }
.calendar .calendar-color-s { color:#e3b585; }
.calendar .calendar-color-g { color:#00cc00; }
.calendar .calendar-color-m { color:#d4dde4; }
.calendar .calendar-color-b { color:#5555bb; }
</style>
<pre class="calendar"><span aria-hidden="true" class=""> </span>
<span aria-hidden="true" class=""> </span>
Expand All @@ -55,7 +55,7 @@ <h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=<
(function(){
var countdown = document.getElementById("calendar-countdown");
if (!countdown) return;
var server_eta = 77873;
var server_eta = 76387;
var key = "2023-8-"+server_eta;
var now = Math.floor(new Date().getTime()/1000);
var target = server_eta + now;
Expand Down
18 changes: 16 additions & 2 deletions src/2023/leaderboard.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/2023/solver.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">14*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/template/day.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">{{stars}}*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/template/end.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">{{stars}}*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/template/events.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">{{stars}}*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/template/index.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">{{stars}}*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/template/leaderboard.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">{{stars}}*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/template/solver.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</nav>
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge"
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">{{stars}}*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
20 changes: 13 additions & 7 deletions src/utils/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ function renderTemplate(year, name, extension, model) {
return fileName;
}

export async function downloadQuestion(year, day) {
export async function downloadQuestion(year, day, stars) {
const question = await getQuestionPage(year, day);
return renderTemplate(year, dayName(day), 'html', { question, year, day });
return renderTemplate(year, dayName(day), 'html', {
question,
year,
day,
stars,
});
}

export async function downloadInput(year, day) {
Expand All @@ -50,24 +55,25 @@ export function tempLeaderboard(year) {
}

export const downloadIndexTicks = 7;
export async function downloadIndex(year, bar) {
renderTemplate(year, 'solver', 'html', { year });
export async function downloadIndex(year, bar, stars) {
renderTemplate(year, 'solver', 'html', { year, stars });
bar.tick();
const page = await getYearPage(year);
renderTemplate(year, 'index', 'html', { year, page });
renderTemplate(year, 'index', 'html', { year, page, stars });
bar.tick();
const events = await getEventsPage(year);
renderTemplate(year, 'events', 'html', { year, page: events });
renderTemplate(year, 'events', 'html', { year, page: events, stars });
bar.tick();
const leaderboards = await getLeaderboardJsons(year);
renderTemplate(year, 'leaderboard', 'html', {
year,
...calcLeaderboard(leaderboards),
stars,
});
bar.tick();
const end = await getEndPage(year).catch(() => undefined);
if (end) {
renderTemplate(year, 'end', 'html', { year, page: end });
renderTemplate(year, 'end', 'html', { year, page: end, stars });
}
bar.tick();
downloadStatic('https://adventofcode.com/static/style.css');
Expand Down
4 changes: 2 additions & 2 deletions src/utils/solver.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ export default async function solveAll(year, day, run = true) {
total: days.length * 2 + downloadIndexTicks,
width: 40,
});
await downloadIndex(year, bar);
await downloadIndex(year, bar, days.length * 2);
for (const day of days) {
await downloadQuestion(year, day);
await downloadQuestion(year, day, days.length * 2);
bar.tick();
await downloadInput(year, day);
bar.tick();
Expand Down

0 comments on commit 937a149

Please sign in to comment.