{"id":13278,"date":"2024-08-09T15:13:20","date_gmt":"2024-08-09T07:13:20","guid":{"rendered":"https:\/\/sec.rakuten.com.hk\/?page_id=23838"},"modified":"2025-03-31T10:31:11","modified_gmt":"2025-03-31T02:31:11","slug":"landing-uat","status":"publish","type":"page","link":"https:\/\/www.sec.rakuten.com.hk\/en\/landing-uat","title":{"rendered":"Landing UAT"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"13278\" class=\"elementor elementor-13278\" data-elementor-post-type=\"page\">\n\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-17d89f6 e-con-full e-flex e-con\" data-id=\"17d89f6\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;full&quot;,&quot;jet_parallax_layout_list&quot;:[]}\">\n\t\t\t\t<div class=\"elementor-element elementor-element-48af6aa elementor-widget elementor-widget-html\" data-id=\"48af6aa\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<div style=\"display: flex; gap:50px; justify-content:center; font-size: 20px; padding: 0; margin: 0;\">\r\n  <div style=\"display: flex; gap: 20px;\">\r\n    <div>Score:<\/div>\r\n    <div id=\"score\">0<\/div>\r\n  <\/div>\r\n  <div style=\"display: flex; gap: 20px;\">\r\n    <div>Time: <\/div>\r\n    <div id=\"timer\"><\/div>\r\n  <\/div>  \r\n<\/div>\r\n<div style=\"background-color: brown; color: white\">Start<\/div>\r\n<div id=\"test\" style=\"width:100%;\"><\/div>\r\n<script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/matter-js\/0.14.2\/matter.min.js\"><\/script>\r\n<!--script src=\"https:\/\/sec.rakuten.com.hk\/wp-content\/plugins\/rshk-wp_toolkit\/common\/js\/matter.min.js\"><\/script-->\r\n<script>\r\n  \/*\r\nconst portrait = window.matchMedia(\"(orientation: portrait)\").matches;\r\nif (portrait) {\r\n  alert(\"Please rotate the screen to Landscape mode and reload\");\r\n} else {\r\n*\/\r\n\r\n  var timeleft = 10;\r\n  var downloadTimer = setInterval(function(){\r\n    if(timeleft <= 0){\r\n      clearInterval(downloadTimer);\r\n    }\r\n\r\n    let timerPrefix = \"00:\";\r\n    if (timeleft < 10) {\r\n      timerPrefix = \"00:0\";\r\n    }\r\n    document.getElementById(\"timer\").innerHTML = timerPrefix + timeleft;\r\n    timeleft -= 1;\r\n  }, 1000);\r\n\r\n  let screenWidth = jQuery('#test').width();\r\n\r\n  let score = 0;\r\n  let engine = Matter.Engine.create();\r\n  let render = Matter.Render.create({\r\n      \/\/element: document.body,\r\n      element: document.getElementById(\"test\"),\r\n      engine: engine,\r\n      options: {\r\n        width: screenWidth-20,\r\n        height: 600, \r\n        wireframes: false\r\n    }\r\n  });\r\n    \r\n  let ground = Matter.Bodies.rectangle(1150, 300, 280, 20, { isStatic: true, label: \"plate\" });\r\n  ground.collisionFilter = {\r\n            'category': 0o12,\r\n            'mask': 0o10\r\n          \r\n                    };\r\n  ground.render.fillStyle = '#fcba03';\r\n\r\n  let score_ground = Matter.Bodies.rectangle(960, 550, 1500, 20, { isStatic: true, label: \"bowl\" });\r\n  score_ground.collisionFilter = { \r\n    'category': 0o12,\r\n    'mask': 0o10\r\n  };\r\n  score_ground.render.fillStyle = '#bf0000';\r\n\r\n  let wall_left = Matter.Bodies.rectangle(760, 515, 20, 50, { isStatic: true, label: \"wall\" });\r\n  wall_left.collisionFilter = { \r\n    'category': 0o12,\r\n    'mask': 0o10\r\n  };\r\n\r\n  let wall_right = Matter.Bodies.rectangle(1440, 515, 20, 50, { isStatic: true, label: \"wall\" });\r\n  wall_right.collisionFilter = { \r\n    'category': 0o12,\r\n    'mask': 0o10\r\n  };\r\n\r\n  let ball = Matter.Bodies.circle(100, 400, 20, {\r\n    collisionFilter: {category: 0b10}\r\n  });\r\n  ball.render.fillStyle = '#bf0000';\r\n  \r\n  let sling = Matter.Constraint.create({ \r\n    pointA: { x: 100, y: 400 }, \r\n    bodyB: ball, \r\n    stiffness: 0.005\r\n  });\r\n      \r\n  let mouse = Matter.Mouse.create(render.canvas);\r\n  let mouseConstraint = Matter.MouseConstraint.create(engine, {\r\n    mouse: mouse,\r\n    collisionFilter: {mask: 0b10},\r\n    constraint: {\r\n        render: {visible: false}\r\n    }\r\n  });\r\n  render.mouse = mouse;\r\n      \r\n      let firing = false;\r\n      Matter.Events.on(mouseConstraint,'enddrag', function(e) {\r\n        if(e.body === ball) firing = true;\r\n      });\r\n      Matter.Events.on(engine,'afterUpdate', function() {\r\n        if (firing && Math.abs(ball.position.x-100) < 20 && Math.abs(ball.position.y-400) < 20) {\r\n\r\n          ball.collisionFilter = {\r\n            'category': 0o14,\r\n            'mask' : 0o10\r\n          }, \/\/0x0004;*\/\r\n            ball = Matter.Bodies.circle(100, 400, 20, {\r\n              collisionFilter: {category: 0b10}\r\n            });\r\n            ball.render.fillStyle = '#bf0000';\r\n            Matter.World.add(engine.world, ball);\r\n            sling.bodyB = ball;\r\n            firing = false;\r\n        }\r\n      });\r\n\r\n      let stack = Matter.Composites.stack(1040, 70, 4, 4, 0, 0, function(x, y) { \r\n          \/\/return Matter.Bodies.polygon(x, y, 8, 30);\r\n          return Matter.Bodies.polygon(x, y, 8, 30, {\r\n            render: {\r\n              sprite: {\r\n                texture: 'https:\/\/www.sec.rakuten.com.hk\/wp-content\/uploads\/ico_chevron-1.svg'\r\n              }\r\n            },\r\n            collisionFilter: {\r\n              category: 0o10,\r\n              mask: 0o14 | 0o12\r\n            }\r\n          });\r\n      });\r\n\r\n      Matter.Events.on(engine, 'collisionStart', (event) => {\r\n        let pairs = event.pairs;\r\n        for (const pair of pairs) {\r\n\r\n          if (pair.bodyA.label === 'bowl') {\r\n            if (pair.bodyB.label === 'Polygon Body') {\r\n              score++;\r\n              jQuery('#score').html(score);\r\n              console.log(\"target hit\");\r\n              \r\n              let comBody = stack.bodies;\r\n              comBody.forEach(function(item, index, arr) {\r\n                  if( arr[index].id == pair.bodyB.id ) {\r\n                    Matter.Composite.remove(stack, stack.bodies[index]);\r\n                  }\r\n              }\r\n\r\n              );\r\n            } else if (pair.bodyB.label === 'Circle Body') {\r\n              \/\/pair.bodyB.collisionFilter = { 'category': 0o14 };\r\n            }\r\n          } else if (pair.bodyA.label === 'plate') {\r\n            if (pair.bodyB.label === 'Circle Body') {\r\n              \/\/pair.bodyB.collisionFilter = { 'category': 0o14 };\r\n            }\r\n          }\r\n          \r\n        }\r\n        console.log(score);\r\n      })\r\n\r\n      Matter.Events.on(engine, 'collisionEnd', (event) => {\r\n        let pairs = event.pairs;\r\n        pairs.forEach(function(pair){\r\n          if(pair.bodyA.label === 'bowl' && pair.bodyB.label === 'Polygon Body'){\r\n            console.log('end hit');\r\n            console.log(pair.bodyB);\r\n            \/\/Matter.Composite.remove(stack, stack.bodies[0])\r\n          }\r\n        });\r\n      })\r\n\r\n      Matter.World.add(engine.world, [stack, ground, score_ground, ball, sling, mouseConstraint]);\r\n      Matter.Engine.run(engine);\r\n      Matter.Render.run(render);\r\n    \r\n  function gameExit() {\r\n    Matter.Composite.clear(engine.world);\r\n  }\r\n<\/script>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Score: 0 Time: Start<\/p>\n","protected":false},"author":10,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_jet_sm_ready_style":"","_jet_sm_style":"","_jet_sm_controls_values":"","_jet_sm_fonts_collection":"","_jet_sm_fonts_links":"","_links_to":"","_links_to_target":""},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.11 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Landing UAT | Foreign Exchange Trading Firm \u2013 Rakuten Securities HK<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sec.rakuten.com.hk\/en\/landing-uat\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Landing UAT | Foreign Exchange Trading Firm \u2013 Rakuten Securities HK\" \/>\n<meta property=\"og:description\" content=\"Score: 0 Time: Start\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sec.rakuten.com.hk\/en\/landing-uat\" \/>\n<meta property=\"og:site_name\" content=\"Foreign Exchange Trading Firm \u2013 Rakuten Securities HK\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-31T02:31:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sec.rakuten.com.hk\/wp-content\/uploads\/rshk_ogp_1200x630_whiteBg.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sec.rakuten.com.hk\/en\/landing-uat\",\"url\":\"https:\/\/www.sec.rakuten.com.hk\/en\/landing-uat\",\"name\":\"Landing UAT | Foreign Exchange Trading Firm \u2013 Rakuten Securities HK\",\"isPartOf\":{\"@id\":\"http:\/\/127.0.0.1\/#website\"},\"datePublished\":\"2024-08-09T07:13:20+00:00\",\"dateModified\":\"2025-03-31T02:31:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sec.rakuten.com.hk\/en\/landing-uat#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sec.rakuten.com.hk\/en\/landing-uat\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sec.rakuten.com.hk\/en\/landing-uat#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sec.rakuten.com.hk\/en\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Landing UAT\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/127.0.0.1\/#website\",\"url\":\"http:\/\/127.0.0.1\/\",\"name\":\"Foreign Exchange Trading Firm \u2013 Rakuten Securities HK\",\"description\":\"\",\"publisher\":{\"@id\":\"http:\/\/127.0.0.1\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/127.0.0.1\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/127.0.0.1\/#organization\",\"name\":\"Foreign Exchange Trading Firm \u2013 Rakuten Securities HK\",\"url\":\"http:\/\/127.0.0.1\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/127.0.0.1\/#\/schema\/logo\/image\/\",\"url\":\"\/wp-content\/uploads\/2023\/05\/brand-logo-2021.png\",\"contentUrl\":\"\/wp-content\/uploads\/2023\/05\/brand-logo-2021.png\",\"width\":231,\"height\":51,\"caption\":\"Foreign Exchange Trading Firm \u2013 Rakuten Securities HK\"},\"image\":{\"@id\":\"http:\/\/127.0.0.1\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Landing UAT | Foreign Exchange Trading Firm \u2013 Rakuten Securities HK","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sec.rakuten.com.hk\/en\/landing-uat","og_locale":"en_US","og_type":"article","og_title":"Landing UAT | Foreign Exchange Trading Firm \u2013 Rakuten Securities HK","og_description":"Score: 0 Time: Start","og_url":"https:\/\/www.sec.rakuten.com.hk\/en\/landing-uat","og_site_name":"Foreign Exchange Trading Firm \u2013 Rakuten Securities HK","article_modified_time":"2025-03-31T02:31:11+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.sec.rakuten.com.hk\/wp-content\/uploads\/rshk_ogp_1200x630_whiteBg.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sec.rakuten.com.hk\/en\/landing-uat","url":"https:\/\/www.sec.rakuten.com.hk\/en\/landing-uat","name":"Landing UAT | Foreign Exchange Trading Firm \u2013 Rakuten Securities HK","isPartOf":{"@id":"http:\/\/127.0.0.1\/#website"},"datePublished":"2024-08-09T07:13:20+00:00","dateModified":"2025-03-31T02:31:11+00:00","breadcrumb":{"@id":"https:\/\/www.sec.rakuten.com.hk\/en\/landing-uat#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sec.rakuten.com.hk\/en\/landing-uat"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sec.rakuten.com.hk\/en\/landing-uat#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sec.rakuten.com.hk\/en"},{"@type":"ListItem","position":2,"name":"Landing UAT"}]},{"@type":"WebSite","@id":"http:\/\/127.0.0.1\/#website","url":"http:\/\/127.0.0.1\/","name":"Foreign Exchange Trading Firm \u2013 Rakuten Securities HK","description":"","publisher":{"@id":"http:\/\/127.0.0.1\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/127.0.0.1\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/127.0.0.1\/#organization","name":"Foreign Exchange Trading Firm \u2013 Rakuten Securities HK","url":"http:\/\/127.0.0.1\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/127.0.0.1\/#\/schema\/logo\/image\/","url":"\/wp-content\/uploads\/2023\/05\/brand-logo-2021.png","contentUrl":"\/wp-content\/uploads\/2023\/05\/brand-logo-2021.png","width":231,"height":51,"caption":"Foreign Exchange Trading Firm \u2013 Rakuten Securities HK"},"image":{"@id":"http:\/\/127.0.0.1\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.sec.rakuten.com.hk\/en\/wp-json\/wp\/v2\/pages\/13278"}],"collection":[{"href":"https:\/\/www.sec.rakuten.com.hk\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sec.rakuten.com.hk\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sec.rakuten.com.hk\/en\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sec.rakuten.com.hk\/en\/wp-json\/wp\/v2\/comments?post=13278"}],"version-history":[{"count":0,"href":"https:\/\/www.sec.rakuten.com.hk\/en\/wp-json\/wp\/v2\/pages\/13278\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sec.rakuten.com.hk\/en\/wp-json\/wp\/v2\/media?parent=13278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}