{"id":5073,"date":"2012-03-28T09:32:01","date_gmt":"2012-03-28T02:32:01","guid":{"rendered":"http:\/\/www.arit.rmutp.ac.th\/kms\/?p=5073"},"modified":"2013-09-20T15:44:27","modified_gmt":"2013-09-20T08:44:27","slug":"circle-translation-with-html5","status":"publish","type":"post","link":"https:\/\/arit.rmutp.ac.th\/kms\/circle-translation-with-html5\/","title":{"rendered":"Circle Translation with HTML5"},"content":{"rendered":"<p style=\"text-align: center\"><a href=\"http:\/\/www.arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/08\/HTML5_Logo.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-4888\" style=\"border: 0px none\" alt=\"\" src=\"http:\/\/www.arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/08\/HTML5_Logo.jpg\" width=\"184\" height=\"184\" srcset=\"https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/08\/HTML5_Logo.jpg 512w, https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/08\/HTML5_Logo-150x150.jpg 150w, https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/08\/HTML5_Logo-300x300.jpg 300w\" sizes=\"(max-width: 184px) 100vw, 184px\" \/><\/a><\/p>\n<p style=\"text-align: right\">\u0e42\u0e14\u0e22 \u0e2a\u0e21\u0e42\u0e20\u0e0a\u0e19\u0e4c \u0e01\u0e38\u0e25\u0e18\u0e32\u0e23\u0e32\u0e23\u0e21\u0e13\u0e4c<\/p>\n<p style=\"text-align: center\"><!--more--><\/p>\n<p>&lt;head&gt; \u00a0\u00a0 &lt;title&gt;SVG Animation \u2013 Circle Translation&lt;\/title&gt;<br \/>\n&lt;script&gt; \u00a0var timer;\u00a0 \u00a0 var delay = 16;<br \/>\nfunction s2d(s)<br \/>\n{ \u00a0return (s \/ 1000) * delay; \u00a0 }<\/p>\n<p>function init()<br \/>\n{ \u00a0 svgElement = document.getElementById(\u201csvgElement\u201d);<br \/>\ncircle0 = document.getElementById(\u201ccircle0\u2033);<br \/>\ntimer = setInterval(doAnim, delay);<br \/>\ncircle0.vx = 150;\u00a0\u00a0 \u00a0 \u00a0 circle0.vy = 80;\u00a0 \u00a0 }<br \/>\nfunction doAnim()<br \/>\n{ \u00a0 \u00a0 \u00a0\u00a0 \u00a0 \u00a0 var r = circle0.r.baseVal.value;<br \/>\nvar boxWidth = svgElement.width.baseVal.value;<br \/>\nvar boxHeight = svgElement.height.baseVal.value;<br \/>\ncircle0.cx.baseVal.value += s2d(circle0.vx);<br \/>\ncircle0.cy.baseVal.value += s2d(circle0.vy);<br \/>\nif (circle0.cx.baseVal.value &gt;= (boxWidth \u2013 r))<br \/>\ncircle0.vx *=-1;<br \/>\nif (circle0.cy.baseVal.value &gt;= (boxHeight \u2013 r))<br \/>\ncircle0.vY *=-1;<br \/>\n\/\/clearInterval(timer);<br \/>\n}<br \/>\n&lt;\/script&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body onload=\u201dinit();\u201d&gt;<br \/>\n&lt;svg id=\u201dsvgElement\u201d width=\u201d800px\u201d height=\u201d600px\u201d viewBox=\u201d0 0 800 600\u2033&gt;<br \/>\n&lt;rect x=\u201d0\u2033 y=\u201d0\u2033 width=\u201d100%\u201d height=\u201d100%\u201d rx=\u201d10\u2033 ry=\u201d10\u2033 style=\u201dfill: white; stroke: black;\u201d \/&gt;<br \/>\n&lt;circle id=\u201dcircle0\u2033 cx=\u201d40\u2033 cy=\u201d40\u2033 r=\u201d40\u2033 style=\u201dfill: orange; stroke: black; stroke-width: 1;\u201d \/&gt;<br \/>\n&lt;\/svg&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<p>\u0e25\u0e39\u0e01\u0e1a\u0e2d\u0e25\u0e0a\u0e19\u0e02\u0e49\u0e32\u0e07\u0e41\u0e25\u0e49\u0e27\u0e08\u0e30\u0e40\u0e14\u0e49\u0e07\u0e01\u0e25\u0e31\u0e1a<\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align: center\"><a href=\"http:\/\/www.arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/08\/YELLOW.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-5074\" style=\"border: 0px none\" alt=\"\" src=\"http:\/\/www.arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/08\/YELLOW.jpg\" width=\"516\" height=\"451\" srcset=\"https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/08\/YELLOW.jpg 737w, https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/08\/YELLOW-300x262.jpg 300w\" sizes=\"(max-width: 516px) 100vw, 516px\" \/><\/a><\/p>\n<p style=\"text-align: center\"><a href=\"http:\/\/www.arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/08\/y2.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5075\" alt=\"\" src=\"http:\/\/www.arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/08\/y2.jpg\" width=\"520\" height=\"459\" srcset=\"https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/08\/y2.jpg 743w, https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/08\/y2-300x264.jpg 300w\" sizes=\"(max-width: 520px) 100vw, 520px\" \/><\/a><\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align: center\">\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>\u0e42\u0e14\u0e22 \u0e2a\u0e21\u0e42\u0e20\u0e0a\u0e19\u0e4c \u0e01\u0e38\u0e25\u0e18\u0e32\u0e23\u0e32\u0e23\u0e21\u0e13\u0e4c<\/p>\n","protected":false},"author":1,"featured_media":5689,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[3],"tags":[],"class_list":["post-5073","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-3"],"rttpg_featured_image_url":{"full":["https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/03\/index.jpg",289,174,false],"landscape":["https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/03\/index.jpg",289,174,false],"portraits":["https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/03\/index.jpg",289,174,false],"thumbnail":["https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/03\/index-150x150.jpg",150,150,true],"medium":["https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/03\/index.jpg",289,174,false],"large":["https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/03\/index.jpg",289,174,false],"folio":["https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/03\/index.jpg",289,174,false],"1536x1536":["https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/03\/index.jpg",289,174,false],"2048x2048":["https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/03\/index.jpg",289,174,false],"sow-carousel-default":["https:\/\/arit.rmutp.ac.th\/kms\/wp-content\/uploads\/2012\/03\/index.jpg",272,164,false]},"rttpg_author":{"display_name":"admin","author_link":"https:\/\/arit.rmutp.ac.th\/kms\/author\/admin\/"},"rttpg_comment":0,"rttpg_category":"<a href=\"https:\/\/arit.rmutp.ac.th\/kms\/category\/%e0%b8%84%e0%b8%a5%e0%b8%b1%e0%b8%87%e0%b8%84%e0%b8%a7%e0%b8%b2%e0%b8%a1%e0%b8%a3%e0%b8%b9%e0%b9%89-%e0%b8%a3%e0%b8%b0%e0%b8%9a%e0%b8%9a%e0%b8%aa%e0%b8%b2%e0%b8%a3%e0%b8%aa\/\" rel=\"category tag\">\u0e04\u0e25\u0e31\u0e07\u0e04\u0e27\u0e32\u0e21\u0e23\u0e39\u0e49 \u0e23\u0e30\u0e1a\u0e1a\u0e2a\u0e32\u0e23\u0e2a\u0e19\u0e40\u0e17\u0e28<\/a>","rttpg_excerpt":"\u0e42\u0e14\u0e22 \u0e2a\u0e21\u0e42\u0e20\u0e0a\u0e19\u0e4c \u0e01\u0e38\u0e25\u0e18\u0e32\u0e23\u0e32\u0e23\u0e21\u0e13\u0e4c","_links":{"self":[{"href":"https:\/\/arit.rmutp.ac.th\/kms\/wp-json\/wp\/v2\/posts\/5073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arit.rmutp.ac.th\/kms\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arit.rmutp.ac.th\/kms\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arit.rmutp.ac.th\/kms\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arit.rmutp.ac.th\/kms\/wp-json\/wp\/v2\/comments?post=5073"}],"version-history":[{"count":6,"href":"https:\/\/arit.rmutp.ac.th\/kms\/wp-json\/wp\/v2\/posts\/5073\/revisions"}],"predecessor-version":[{"id":5698,"href":"https:\/\/arit.rmutp.ac.th\/kms\/wp-json\/wp\/v2\/posts\/5073\/revisions\/5698"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arit.rmutp.ac.th\/kms\/wp-json\/wp\/v2\/media\/5689"}],"wp:attachment":[{"href":"https:\/\/arit.rmutp.ac.th\/kms\/wp-json\/wp\/v2\/media?parent=5073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arit.rmutp.ac.th\/kms\/wp-json\/wp\/v2\/categories?post=5073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arit.rmutp.ac.th\/kms\/wp-json\/wp\/v2\/tags?post=5073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}