Created
April 26, 2026 00:20
-
-
Save dfrankland/2399763bf1137c76c2239f3646ef2401 to your computer and use it in GitHub Desktop.
2 Part Sashiko Design Print for 8.5inx11in Paper
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>2 Part Sashiko Design Print for 8.5inx11in Paper</title> | |
| </head> | |
| <body> | |
| <script> | |
| const SIZE_INCHES = 10; | |
| const GRID_INCHES = 0.25; | |
| const GRID_COLUMNS_ROWS = SIZE_INCHES / GRID_INCHES; | |
| const style = document.createElement('style'); | |
| style.textContent = ` | |
| body { | |
| margin: 0; | |
| } | |
| .page-break { | |
| page-break-after: always; | |
| } | |
| .half-circle { | |
| width: ${SIZE_INCHES / 2}in; | |
| padding: 2px; | |
| overflow: hidden; | |
| } | |
| .half-circle-left { | |
| transform: translateX(-50%); | |
| } | |
| .half-circle-right { | |
| transform: translateX(0%); | |
| } | |
| .circle { | |
| width: ${SIZE_INCHES}in; | |
| height: ${SIZE_INCHES}in; | |
| outline: 2px solid black; | |
| border-radius: 50%; | |
| } | |
| .grid { | |
| display: grid; | |
| grid-template-columns: repeat(${GRID_COLUMNS_ROWS}, ${GRID_INCHES}in); | |
| grid-template-rows: repeat(${GRID_COLUMNS_ROWS}, ${GRID_INCHES}in); | |
| width: ${SIZE_INCHES}in; | |
| height: ${SIZE_INCHES}in; | |
| } | |
| .grid-item { | |
| width: ${GRID_INCHES}in; | |
| height: ${GRID_INCHES}in; | |
| outline: 1px solid black; | |
| } | |
| `; | |
| document.head.appendChild(style); | |
| const circle = document.createElement('div'); | |
| circle.classList.add('circle'); | |
| const grid = document.createElement('div'); | |
| grid.classList.add('grid'); | |
| circle.appendChild(grid); | |
| Array.from({ length: GRID_COLUMNS_ROWS ** 2 }).forEach(() => { | |
| const gridItem = document.createElement('div'); | |
| gridItem.classList.add('grid-item'); | |
| grid.appendChild(gridItem); | |
| }); | |
| const halfCircleLeft = document.createElement('div'); | |
| halfCircleLeft.classList.add('half-circle'); | |
| const halfCircleLeftContent = circle.cloneNode(true); | |
| halfCircleLeftContent.classList.add('half-circle-left'); | |
| halfCircleLeft.appendChild(halfCircleLeftContent); | |
| const halfCircleRight = document.createElement('div'); | |
| halfCircleRight.classList.add('half-circle'); | |
| const halfCircleRightContent = circle.cloneNode(true); | |
| halfCircleRightContent.classList.add('half-circle-right'); | |
| halfCircleRight.appendChild(halfCircleRightContent); | |
| document.body.appendChild(halfCircleLeft); | |
| const pageBreak = document.createElement('div'); | |
| pageBreak.classList.add('page-break'); | |
| document.body.appendChild(pageBreak); | |
| document.body.appendChild(halfCircleRight); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment