Moved site to hugo

This commit is contained in:
Drew Galbraith 2023-12-06 16:38:11 -08:00
parent 1339d09535
commit cd8be31924
49 changed files with 243 additions and 615 deletions

View file

@ -0,0 +1,30 @@
.box {
border: 2px solid black;
width: 210px;
height: 210px;
float: left;
}
.cell {
border: 1px solid black;
width: 70px;
height: 70px;
float:left;
box-sizing: border-box;
font-size: 40px;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
}
.cell > span {
font-size: 12px;
font-weight: normal;
text-align: center;
letter-spacing: 11px;
word-wrap: anywhere;
padding-left: 10px;
}

4
content/sudoku/index.md Normal file
View file

@ -0,0 +1,4 @@
+++
title = 'Sudoku'
layout = 'sudoku'
+++

View file

@ -0,0 +1,40 @@
window.onload = (event) => {
var params = new URLSearchParams(window.location.search);
var puzzle = params.get("p");
if (puzzle === null) {
return;
}
if (puzzle.length != 81) {
console.log("Failure: puzzle url len is " + puzzle.length);
return;
}
for (i = 0; i < 81; i++) {
if (puzzle[i] != '.') {
document.getElementById(i+1).innerText = puzzle[i]
}
}
var marks_param = params.get("m");
if (marks_param === null) {
return;
}
var marks = marks_param.split(",");
if (marks.length != 81) {
console.log("Failure: marks url len is " + marks.length);
return;
}
for (i = 0; i < 81; i++) {
if (marks[i].length > 0) {
var cell = document.getElementById(i+1);
if (cell.innerHTML.trim().length > 0) {
console.log("Pencil marks in cell with number: " + (i+1));
} else {
cell.innerHTML = "<span>" + marks[i] + "</span>";
}
}
}
}