Title: Color match solution · Issue #7 · ByteGrad/Professional-JavaScript-Course · GitHub
Open Graph Title: Color match solution · Issue #7 · ByteGrad/Professional-JavaScript-Course
X Title: Color match solution · Issue #7 · ByteGrad/Professional-JavaScript-Course
Description: It is indeed a major hassle to match the colors on the jobs, but there is a simple solution. Just hash the id with the last digit to each color, since 4 colors are provided, then we just need to use id % 10 % 10 % 4, then add that select...
Open Graph Description: It is indeed a major hassle to match the colors on the jobs, but there is a simple solution. Just hash the id with the last digit to each color, since 4 colors are provided, then we just need to us...
X Description: It is indeed a major hassle to match the colors on the jobs, but there is a simple solution. Just hash the id with the last digit to each color, since 4 colors are provided, then we just need to us...
Opengraph URL: https://github.com/ByteGrad/Professional-JavaScript-Course/issues/7
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Color match solution","articleBody":"It is indeed a major hassle to match the colors on the jobs, but there is a simple solution. Just hash the id with the last digit to each color, since 4 colors are provided, then we just need to use id % 10 % 10 % 4, then add that selector to each jobItem, add those 4 colors with differnt selector. We just can't guarantee the color is rotated like it was set before.\r\n\r\nJobList.js\r\n```\r\n \u003cdiv class=\"job-item__badge job-item__badge--color${parseInt(jobItem.id % 10 % 4)}\"\u003e${jobItem.badgeLetters}\u003c/div\u003e\r\n```\r\nJobDetails.js\r\n```\r\n\t\t\t\t\t\t\t\t\t\u003cdiv class=\"job-info__badge job-info__badge--color${parseInt(jobItem.id % 10 % 4)}\"\u003e${jobItem.badgeLetters}\u003c/div\u003e\t\t\t\t\t\t\t\t\t\r\n```\r\nindex.css\r\n```\r\n.job-item__badge {\r\n font-size: 13px;\r\n height: 46px;\r\n width: 38px;\r\n /* background-color: #8dd335; */\r\n border-radius: 5px;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n font-weight: 600;\r\n margin-right: 13px;\r\n}\r\n\r\n.job-item__badge--color0 {\r\n background-color: #8dd335;\r\n}\r\n\r\n.job-item__badge--color1 {\r\n background-color: #3D87F1;\r\n}\r\n\r\n.job-item__badge--color2 {\r\n background-color: #D2D631;\r\n}\r\n\r\n.job-item__badge--color3 {\r\n background-color: #D96A46;\r\n}\r\n\r\n/* .job-item:nth-child(4n+2) .job-item__badge {\r\n background-color: #3D87F1;\r\n}\r\n\r\n.job-item:nth-child(4n+3) .job-item__badge {\r\n background-color: #D2D631;\r\n}\r\n\r\n.job-item:nth-child(4n+4) .job-item__badge {\r\n background-color: #D96A46;\r\n} */\r\n\r\n\r\n\r\n.job-info__badge {\r\n width: 55px;\r\n height: 70px;\r\n /* background-color: #d0d335; */\r\n border-radius: 5px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n font-size: 22px;\r\n font-weight: 600;\r\n margin-bottom: 13px;\r\n}\r\n\r\n.job-info__badge--color0 {\r\n background-color: #8dd335;\r\n}\r\n\r\n.job-info__badge--color1 {\r\n background-color: #3D87F1;\r\n}\r\n\r\n.job-info__badge--color2 {\r\n background-color: #D2D631;\r\n}\r\n\r\n.job-info__badge--color3 {\r\n background-color: #D96A46;\r\n}\r\n```\r\n","author":{"url":"https://github.com/Rope-a-dope","@type":"Person","name":"Rope-a-dope"},"datePublished":"2024-06-05T22:58:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/7/Professional-JavaScript-Course/issues/7"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a070beb2-fd5b-13dc-d6cf-924648ecd89d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B602:221685:157DA4A:1C7EB6D:6A51C25A |
| html-safe-nonce | c0b9699f03dedaf6526db9e4090a9d45968c909603061c98159cf37d3aafad58 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjAyOjIyMTY4NToxNTdEQTRBOjFDN0VCNkQ6NkE1MUMyNUEiLCJ2aXNpdG9yX2lkIjoiNTAzNzQ5NzQ4MzE4NzU2OTI0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c2f49e9c83567f524eb4654afe0d64138d707da879cbf359480dc90625c3acdb |
| hovercard-subject-tag | issue:2336962567 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ByteGrad/Professional-JavaScript-Course/7/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3ce06704629b3d7685151f3507c21e738b1a08499cfb02158fd65c2a23b6e391/ByteGrad/Professional-JavaScript-Course/issues/7 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3ce06704629b3d7685151f3507c21e738b1a08499cfb02158fd65c2a23b6e391/ByteGrad/Professional-JavaScript-Course/issues/7 |
| og:image:alt | It is indeed a major hassle to match the colors on the jobs, but there is a simple solution. Just hash the id with the last digit to each color, since 4 colors are provided, then we just need to us... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Rope-a-dope |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/ByteGrad/Professional-JavaScript-Course git https://github.com/ByteGrad/Professional-JavaScript-Course.git |
| octolytics-dimension-user_id | 82057865 |
| octolytics-dimension-user_login | ByteGrad |
| octolytics-dimension-repository_id | 480343983 |
| octolytics-dimension-repository_nwo | ByteGrad/Professional-JavaScript-Course |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 480343983 |
| octolytics-dimension-repository_network_root_nwo | ByteGrad/Professional-JavaScript-Course |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width