Title: Adjusting how the hands work · Issue #5 · WebDevSimplified/JavaScript-Clock · GitHub
Open Graph Title: Adjusting how the hands work · Issue #5 · WebDevSimplified/JavaScript-Clock
X Title: Adjusting how the hands work · Issue #5 · WebDevSimplified/JavaScript-Clock
Description: So I took WebDevSimplified's code and tried to tinker it so that on the final output, the hands of the clock would move like how a normal clock moves. I changed the CSS and JS. With the JS, I got rid of three variables and based fixing t...
Open Graph Description: So I took WebDevSimplified's code and tried to tinker it so that on the final output, the hands of the clock would move like how a normal clock moves. I changed the CSS and JS. With the JS, I got r...
X Description: So I took WebDevSimplified's code and tried to tinker it so that on the final output, the hands of the clock would move like how a normal clock moves. I changed the CSS and JS. With the JS, I g...
Opengraph URL: https://github.com/WebDevSimplified/JavaScript-Clock/issues/5
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Adjusting how the hands work","articleBody":"So I took WebDevSimplified's code and tried to tinker it so that on the final output, the hands of the clock would move like how a normal clock moves.\r\n\r\nI changed the CSS and JS. With the JS, I got rid of three variables and based fixing the rotations around only having the second hand moving initially. \r\n\r\nWhat I came up with doesn't work, but hopefully someone can look at what I wrote and debug it.\r\n``\r\nconst hourHand = document.querySelector('[data-hour-hand]')\r\nconst minuteHand = document.querySelector('[data-minute-hand]')\r\nconst secondHand = document.querySelector('[data-second-hand]')\r\nconst begin = document.getElementById('top')\r\n\r\nconst leverage = minuteHand.style.transform\r\nconst constant = hourHand.style.transform\r\n\r\nconst manos = document.getElementsByClassName('.number').innerText // get all the numbers on the clock and their inner text\r\nconst typeclock = Array.from(manos) // create an array out of all the numbers collected\r\n\r\nfunction setMinuteHand () {\r\n while (secondHand.style.transform === 'rotate(360deg)') {\r\n minuteHand.style.position = begin.style.position // the minute hand starts at 12\r\n if (secondHand.style.position === begin.style.position) { // Once the second hand hits \"12\" again...\r\n leverage.style.transform = 'rotateZ(30deg)' // the minute hand should shift 30 degrees right\r\n }\r\n for (var i = 0; i \u003c typeclock.length; i++) {\r\n minuteHand.style.position = typeclock[i]++ // Buffer in case the leverage statement doesn't work (we shift from \"12\" to \"1\")\r\n }\r\n }\r\n}\r\n\r\nsetMinuteHand()\r\n\r\nfunction setHourHand () {\r\n while (secondHand.style.transform === 'rotate(360deg)') {\r\n hourHand.style.position = begin.style.position // the hour hand starts at 12\r\n if (secondHand.style.position === begin.style.position) { // Once the second hand hits \"12\" again...\r\n constant.style.transform = 'rotateZ(30deg)'// the hour hand should shift 30 degrees right\r\n }\r\n for (var i = 0; i \u003c typeclock.length; i++) {\r\n hourHand.style.position = typeclock[i]++ // Buffer in case the statement with constant above doesn't work (we shift from \"12\" to \"1\")\r\n }\r\n }\r\n}\r\n\r\nsetHourHand()''","author":{"url":"https://github.com/JustinDCole","@type":"Person","name":"JustinDCole"},"datePublished":"2020-11-12T19:23:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/5/JavaScript-Clock/issues/5"}
| 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:784db4f6-0b35-6546-55e9-97f42ca89c65 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB22:385565:5907C6:78A86F:6977DBCC |
| html-safe-nonce | a2ffaeea31298e62d57c55653883005ab3b58be975d24c8dafc7914740e70f90 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjIyOjM4NTU2NTo1OTA3QzY6NzhBODZGOjY5NzdEQkNDIiwidmlzaXRvcl9pZCI6IjU0NTk0Mjg1ODkyMjY2NzkyNDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 83ab1186f110ca93defb5e46139aa983105b119131920040937b5ea1656d0fa9 |
| hovercard-subject-tag | issue:741865600 |
| 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/WebDevSimplified/JavaScript-Clock/5/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2a301da888c4b9ed544664ef14d2ba298dd67bdb55067490d18c7fe3e90955c3/WebDevSimplified/JavaScript-Clock/issues/5 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2a301da888c4b9ed544664ef14d2ba298dd67bdb55067490d18c7fe3e90955c3/WebDevSimplified/JavaScript-Clock/issues/5 |
| og:image:alt | So I took WebDevSimplified's code and tried to tinker it so that on the final output, the hands of the clock would move like how a normal clock moves. I changed the CSS and JS. With the JS, I got r... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JustinDCole |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8909f95e78dc1ccc1b9acf9d5c963c2515579e48d2898151cf571437facd1d7b |
| turbo-cache-control | no-preview |
| go-import | github.com/WebDevSimplified/JavaScript-Clock git https://github.com/WebDevSimplified/JavaScript-Clock.git |
| octolytics-dimension-user_id | 39717099 |
| octolytics-dimension-user_login | WebDevSimplified |
| octolytics-dimension-repository_id | 185291355 |
| octolytics-dimension-repository_nwo | WebDevSimplified/JavaScript-Clock |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 185291355 |
| octolytics-dimension-repository_network_root_nwo | WebDevSimplified/JavaScript-Clock |
| 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 | d6b13f6e4712dc1242cf12b5e75dec8b1bf3a9ab |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width