{"id":413,"date":"2026-03-06T15:07:13","date_gmt":"2026-03-06T15:07:13","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/k_rai\/?p=413"},"modified":"2026-03-06T15:07:13","modified_gmt":"2026-03-06T15:07:13","slug":"time-stop","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/k_rai\/2026\/03\/06\/time-stop\/","title":{"rendered":"Time Stop"},"content":{"rendered":"\n<p>For this free friday I decided to work on a JavaScript project  where i make a watch website but can control the watch Basically like a time watch.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"648\" height=\"299\" src=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-1.png\" alt=\"\" class=\"wp-image-414\" srcset=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-1.png 648w, https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-1-300x138.png 300w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/figure>\n\n\n\n<p>I first started with making the Html and making id which bacially is a name where you can then control it with that name in the JavaScript<\/p>\n\n\n\n<p>I then put button for the watch where you can click and change the time<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"232\" height=\"185\" src=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-2.png\" alt=\"\" class=\"wp-image-415\" style=\"width:338px;height:auto\"\/><\/figure>\n\n\n\n<p> This is what the website looks with just the HTML and no JavaScript<\/p>\n\n\n\n<p>Since we need more than start button to function our watch <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"480\" height=\"132\" src=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-3.png\" alt=\"\" class=\"wp-image-420\" srcset=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-3.png 480w, https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-3-300x83.png 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/figure>\n\n\n\n<p>I just copy and pasted the first buttons and changed it to stop and Reset button <\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"231\" src=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-4.png\" alt=\"\" class=\"wp-image-421\" style=\"aspect-ratio:2.77074730251765;width:624px;height:auto\" srcset=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-4.png 640w, https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-4-300x108.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>I then started working on the JavaScript for the Functionality of the watch <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"482\" height=\"380\" src=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-5.png\" alt=\"\" class=\"wp-image-423\" srcset=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-5.png 482w, https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-5-300x237.png 300w\" sizes=\"auto, (max-width: 482px) 100vw, 482px\" \/><\/figure>\n\n\n\n<p>There are four function for the four buttons on HTML<\/p>\n\n\n\n<p>The Let is a variable that lets the Java know to that we&#8217;ll be changing it later like you are able to change the number like how it is zero right now       <\/p>\n\n\n\n<p>The null on the let interval stands for nothing.<\/p>\n\n\n\n<p>const is where you cannot change it, it stands for constant   The &#8220;time&#8221; is from HTML where we can control it in JAVA<\/p>\n\n\n\n<p>The ++ on Second Elapsed tells the Java to add one <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"468\" height=\"187\" src=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-6.png\" alt=\"\" class=\"wp-image-424\" srcset=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-6.png 468w, https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Js-6-300x120.png 300w\" sizes=\"auto, (max-width: 468px) 100vw, 468px\" \/><\/figure>\n\n\n\n<p>The buttons don&#8217;t do anything yet so the functions set Time and timer starts the timer<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"224\" style=\"aspect-ratio: 248 \/ 224;\" width=\"248\" controls src=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/stop-watch.mp4\"><\/video><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For this free friday I decided to work on a JavaScript project where i make a watch website but can control the watch Basically like a time watch. I first started with making the Html and making id which bacially is a name where you can then control it with that name in the JavaScript [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":415,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-413","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-free-friday"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/posts\/413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/comments?post=413"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/posts\/413\/revisions"}],"predecessor-version":[{"id":426,"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/posts\/413\/revisions\/426"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/media\/415"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/media?parent=413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/categories?post=413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/tags?post=413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}