{"id":15408695,"url":"https://github.com/attomos/hdoc-ribbon","last_synced_at":"2026-07-18T08:33:27.171Z","repository":{"id":57262038,"uuid":"449362474","full_name":"attomos/hdoc-ribbon","owner":"attomos","description":"A custom HTML element to put in my #100DaysOfCode projects.","archived":false,"fork":false,"pushed_at":"2022-04-03T10:44:31.000Z","size":153,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-28T02:43:22.829Z","etag":null,"topics":["100daysofcode","web-componenets"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/attomos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-18T16:30:21.000Z","updated_at":"2023-03-08T04:05:56.000Z","dependencies_parsed_at":"2022-08-25T06:11:00.036Z","dependency_job_id":null,"html_url":"https://github.com/attomos/hdoc-ribbon","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/attomos/hdoc-ribbon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attomos%2Fhdoc-ribbon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attomos%2Fhdoc-ribbon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attomos%2Fhdoc-ribbon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attomos%2Fhdoc-ribbon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/attomos","download_url":"https://codeload.github.com/attomos/hdoc-ribbon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attomos%2Fhdoc-ribbon/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259991203,"owners_count":22942583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["100daysofcode","web-componenets"],"created_at":"2024-10-01T16:34:51.935Z","updated_at":"2025-10-17T14:45:18.327Z","avatar_url":"https://github.com/attomos.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hdoc-ribbon (100-days-of-code-ribbon)\n\n`hdoc-ribbon` is a custom HTML element I worked on as part of my #100DaysOfCode journey to learn\nnew stuffs and re-learn many things\n\n## Usage\n\nInclude this script in your HTML\n\n```html\n\u003cscript src=\"https://unpkg.com/hdoc-ribbon@latest/index.js\"\u003e\u003c/script\u003e\n\u003c!-- Or use specific tag --\u003e\n\u003cscript src=\"https://unpkg.com/hdoc-ribbon@1.2.0/index.js\"\u003e\u003c/script\u003e\n```\n\nAnd start using `\u003chdoc-ribbon\u003e` element in your document:\n\n```html\n\u003c!-- put the ribbon on the top right corner --\u003e\n\u003chdoc-ribbon\n  data-day=\"11\"\n  position=\"right\"\n  href=\"https://github.com/attomos/100-days-of-code\"\n\u003e\u003c/hdoc-ribbon\u003e\n\n\u003c!-- put the ribbon on the top left corner --\u003e\n\u003chdoc-ribbon\n  data-day=\"100\"\n  position=\"left\"\n  href=\"https://github.com/attomos/100-days-of-code\"\n\u003e\u003c/hdoc-ribbon\u003e\n```\n\n| Attribute | Data Type | Description                                      | Observed Attribute\\* |\n| --------- | --------- | ------------------------------------------------ | -------------------- |\n| data-day  | string    | The day you're on the challenge, e.g. 1-100      | false                |\n| position  | string    | Where to put the ribbon either `left` or `right` | true                 |\n| href      | string    | The URL that points to your repo or whatever     | false                |\n\n| Observed Attribute can be modified from JavaScript.\n\n## Customization\n\n```html\n\u003chdoc-ribbon\n  data-day=\"11\"\n  position=\"right\"\n  href=\"https://github.com/attomos/100-days-of-code\"\n\u003e\u003c/hdoc-ribbon\u003e\n```\n\n```js\nconst ribbon = document.querySelector(\"hdoc-ribbon\");\nribbon.theme = {\n  backgroundColor: \"#c8e8de\",\n  borderHoverColor: \"#4e635c\",\n  backgroundHoverColor: \"#8ebdae\",\n};\n```\n\n### Customizable Properties\n\n| Property                   | Data Type | Description                                    |\n| -------------------------- | --------- | ---------------------------------------------- |\n| theme.borderColor          | string    | Border color of the ribbon in normal state     |\n| theme.backgroundColor      | string    | Background color of the ribbon in normal state |\n| theme.borderHoverColor     | string    | Border color when the ribbon is hovered        |\n| theme.backgroundHoverColor | string    | Background color when the ribbon is hovered    |\n\n## Inspirations\n\nI got this idea by looking at what @narze did in his day 5 and day 6 of #100DaysOfCode challenge.  \nHe created #100DaysOfCode CSS ribbon and published it to [npm](https://www.npmjs.com/package/hundred-days-of-code-css-ribbon).\n\nPlease check out his work from the links below.\n\n- https://100daysofcode-narze.vercel.app/days/5/\n- https://100daysofcode-narze.vercel.app/days/6/\n- https://github.com/narze/100-days-of-code-ribbon\n\n### Things I learned from @narze ribbon as well as creating my own\n\n1. Learn about https://unpkg.com/ which is CDN to serve files from npm packages\n2. Some CSS transforms to make the ribbon on the corner\n3. My ribbon is a bit different from [@narze's](https://github.com/narze/100-days-of-code-ribbon). I\n   create custom HTML element, while his ribbon is CSS magic (use the ribbon class and pass data to\n   attr() function).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fattomos%2Fhdoc-ribbon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fattomos%2Fhdoc-ribbon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fattomos%2Fhdoc-ribbon/lists"}