Skip to content

Commit e0a1935

Browse files
committed
Improve the top level readme and update 001_web_components_hello_world
1 parent df7b5d2 commit e0a1935

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# Web Lab
22

3-
A scratch workspace for conducting experiments with HTML, CSS and JavaScript that are loaded by a web browser.
3+
This project is a scratch workspace for conducting experiments with HTML, CSS and JavaScript that is loaded by a web browser.
44

55
## Exercises
66

77
New expermiments are added as a subfolder to the `exercises` folder.
88

9-
Each experiment folder are prefixed with a three digit, zero padded number to perserve the order in which they were added.
9+
Each experiment folder is prefixed with a three digit, zero padded number to perserve a logical order to exploring the experiments.
1010

1111
This format was inspired by the [ziglings](https://codeberg.org/ziglings/exercises) project, which in turn was inspired by the [rustlings](https://github.com/rust-lang/rustlings) project.
12-

exercises/README.md renamed to exercises/001_web_components_hello_world/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Web Components - Hello World
22

3-
A simple web component that writes `Hello, world!` on load.
3+
This experiment is a simple web component that writes `Hello, world!` on page load.
44
The example referenced was [here](https://jonathanmh.com/p/web-components-101-hello-world/).
55

66
## How To Use It

exercises/001_web_components_hello_world/index.htm

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
</head>
66
<body>
77
<article>
8-
<h1>Web Components</h1>
9-
<p>Below is a simple hello world web component &#128515;</p>
8+
<h1>Web Components - Hello World</h1>
9+
<p>Below is a simple web component that displays a message on page load. &#128515;</p>
1010

1111
<hello-world></hello-world>
1212

1313
<script type="text/javascript">
1414
class HelloWorld extends HTMLParagraphElement {
1515
constructor() {
16-
super();
17-
const shadow = this.attachShadow({ mode: "closed" });
18-
const text = document.createElement("span");
19-
text.textContent = 'Hello, world!';
20-
shadow.appendChild(text);
16+
super();
17+
const shadow = this.attachShadow({ mode: "closed" });
18+
const text = document.createElement("span");
19+
text.textContent = 'Hello, world!';
20+
shadow.appendChild(text);
2121
}
2222
}
2323
customElements.define("hello-world", HelloWorld, { extends: "p" });

0 commit comments

Comments
 (0)