refactor(ses): Sharpen challenge demo
MODIFY
packages/ses/demos/challenge/README.md
packages/ses/demos/challenge/README.md
-# SES Demo
+# Hardened JavaScript Escape Room
This directory contains a brief online demonstration of how SES enables safe
interaction between mutually suspicious code. Visit

MODIFY
packages/ses/demos/challenge/main.js
packages/ses/demos/challenge/main.js
@@ -218,10 +218,10 @@ lockdown();
function* counter() {
for (let i = 0; true; i++) {
- let guessedCode = i.toString(36).toUpperCase();
- while (guessedCode.length < 10) {
- guessedCode = `0${guessedCode}`;
- }
+ const guessedCode = i
+ .toString(36)
+ .toUpperCase()
+ .padStart(10, '0');
guess(guessedCode);
yield;
}

MODIFY
packages/ses/demos/challenge/style.css
packages/ses/demos/challenge/style.css
+* {
+ box-sizing: border-box;
+}
+
+html {
+ font-family: San Francisco, Helvetica, Lucida Grande, sans-serif;
+ background-color: white;
+ color: black;
+ font-size: 20px;
+}
+
+body {
+ width: 80ex;
+ margin: 0 auto;
+ padding: 1ex;
+}
+
+textarea {
+ width: 100%;
+ font-size: 20px;
+}
+
+button {
+ font-size: 20px;
+ margin: 3px;
+}
+
div.outer-box {
- height: 110px;
- width: 340px;
+ height: 160px;
+ width: 400px;
+ margin: 20px;
padding: 20px;
background: #111;
}
div.code-box {
background: #111;
- padding-top: 30px;
- padding-bottom: 30px;
+ height: 120px;
+ line-height: 120px;
color: #9cf;
font-size: 40px;
font-family: HyperspaceBold;

MODIFY
packages/ses/demos/index.html
packages/ses/demos/index.html
<a href="./console">SES Demo Console</a>: a REPL to help you debug code running in SES.
</li>
<li>
- <a href="./challenge">SES Challenge</a>: try to break out of SES and read a secret!
+ <a href="./challenge">Hardened JavaScript Escape Room</a>: try to break out of SES and read a secret!
</li>
</ul>
</body>

refactor(ses): Sharpen challenge demo (#1133)