erynwells.me/content/blog/2024/rubiks-scrambler.md
Eryn Wells 122e55b1fa blog: Rubiks' Cube Scrambler post
Implement the rubiks-cube-scrambler custom element, including JS and template
files. Put these things in the body-extras.html partial that the termlite theme
added.

resource-builders: Update submodule commit
termlite: Update submodule commit
2024-11-13 17:06:01 -08:00

30 lines
914 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Rubik's Cube Scrambler
date: 2024-11-13T15:34:22-08:00
tags:
- Tech
- Puzzles
- Rubik's Cube
- HTML
- JavaScript
- CSS
- Web Components
---
Here's a silly thing I made while I was home sick today. It's a widget that
produces a randomized pattern of [moves][rmoves] to scramble a 3×3 [Rubik's
Cube][rcube].
<figure class="figure--main-column figure--object">
{{< rubiks/scrambler >}}
</figure>
This thing is a [Web Component][wc]. The interactive logic lives inside a custom
[HTMLElement][htmlelement], and the content and styling are specified inside a
[`<template>`][template] element.
[rcube]: https://www.rubiks.com
[rmoves]: https://jperm.net/3x3/moves
[wc]: https://developer.mozilla.org/en-US/docs/Web/API/Web_components
[htmlelement]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
[template]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template