Skip to content

Commit

Permalink
✨ Finish basic we components guide
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyYuuki committed Aug 25, 2024
1 parent 2398b82 commit b996192
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- [Team Member Component](./chapter1/web-components/team-member.md)
- [Table of Contents Component](./chapter1/web-components/table-of-contents.md)
- [Table Component](./chapter1/web-components/table.md)
- [Image Component]()
- [Video Component]()
- [References Component]()
- [Image Component](./chapter1/web-components/image.md)
- [Video Component](./chapter1/web-components/video.md)
- [References Component](./chapter1/web-components/references.md)
- [Optional enhancement]()
18 changes: 18 additions & 0 deletions src/chapter1/web-components/image.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Image Component

The image component is a simple component that can be used to quickly display an image with an attached subtitle. The format is as follow:

```html
<image-component
tag="image"
source="assets/requirement.png"
subtitle="Image 1: iDP suggested pathway"
></image-component>
```

The image componet has 3 main attributes:
- `tag`: this is the same as the `id` attributes in the `div` element, you can use this with `<a>` link to point to the picture.
- `source`: this is the source of your image, it can be an image in the `assets` folder like in the example, or it could also be an url pointing to an image from an external page.
- `subtitle`: add subtitle text under the image.

This is a very simple component that you can also create through raw html, but if you don't need much modifications, using this component would be faster and cleaner.
36 changes: 36 additions & 0 deletions src/chapter1/web-components/references.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# References Component

The references component format is as follow:

```html
<div id="references" class="references">
<sl-divider></sl-divider>
<h2>References</h2>
<ul>
<li>
Brody, J. E. (2007, December 11). Mental reserves keep brain agile. The New York Times. Retrieved from
http://www.dowjones.com/factiva/
</li>
<li>
Chamberlin, J., Novotney, A., Packard, E., & Price, M. (2008, May). Enhancing worker well-being: Occupational
health psychologists convene to share their research on work, stress, and health. Monitor on Psychology,
39(5), 26-29.
</li>
<li>
Jones, T. J., & Fields, N. (2003). Emotional quotient and personality. E-Journal of Applied Psychology, 2(2),
38-45. Retrieved from http://ejournalappliedpsyc/index.php/ejap
</li>
</ul>
</div>
```

The only part that you should modifi is between the `<ul>` tag. You simply just need to add an entry as follows:

```html
<li>
your reference entry
</li>
```

in between the `<ul>` tag as shown above and you are good to.

21 changes: 21 additions & 0 deletions src/chapter1/web-components/video.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Video Component

The video component is very similar to the image component, with the difference is that it display video instead. This is actually how video from site such as Youtube can be embedded in different webpage. The format is as follow:

```html
<video-component
tag="rick"
source="https://www.youtube.com/embed/dQw4w9WgXcQ"
subtitle="Video: Never gonna give you up?"
></video-component>
```

The image componet has 3 main attributes:
- `tag`: this is the same as the `id` attributes in the `div` element, you can use this with `<a>` link to point to the picture.
- `source`: this is the source of your video, in this template, we encourage you to upload the video you want as a listed or unlisted video on Youtube first. Then, you can use the link provided from Youtube to your video as the source.Putting a video into the `assets` folder and then put the link to the source, may or may not work. It also bad practice as Github only meant to host small static file, so you might meet their file size restriction.
- `subtitle`: add subtitle text under the video.

> <p class="note"> Note
>
> The video might not be able to render properly when you are using the local server. This is because Youtube is protecting your browser and their videos from potential exploit. Don't worry if it doesn't show the video properly on your website while developing. As long as the link is correct, it will load just fine once it is deployed to Github.

0 comments on commit b996192

Please sign in to comment.