{"__browser":{"country":"US","device":"unknown_device","mobile":false,"name":"unknown browser","platform":"unknown_platform","version":"0"},"__constants":{},"__CPDATA":{"domain_iframe":"https://cdpn.io","environment":"production","host":"codepen.io","iframe_allow":"accelerometer *; ambient-light-sensor *; camera *; display-capture *; encrypted-media *; geolocation *; gyroscope *; microphone *; midi *; payment *; serial *; vr *; web-share *; xr-spatial-tracking *","iframe_sandbox":"allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts allow-top-navigation-by-user-activation"},"__graphql":{"data":{"data":{"sessionUser":{"id":"VoDkNZ","name":"Captain Anonymous","title":"Captain Anonymous","avatar":"https://assets.codepen.io/t-1/user-default-avatar.jpg?format=auto&version=0","currentContext":{"id":"VoDkNZ","title":"Captain Anonymous","name":"Captain Anonymous","avatar":"https://assets.codepen.io/t-1/user-default-avatar.jpg?format=auto&version=0","username":"anon","__typename":"User"},"currentTeamId":null,"username":"anon","admin":false,"anon":true,"pro":false,"verified":false,"featureFlags":[],"teams":[],"__typename":"User"}}},"url":"https://codepen.io/graphql","api":"cprails"},"__user":{"anon":true,"base_url":"/anon/","cohorts":[],"current_team_hashid":null,"current_team_id":0,"hashid":"VoDkNZ","id":1,"itemType":"user","name":"Captain Anonymous","paid":false,"tier":0,"username":"anon","created_at":null,"email_verified":null,"collections_count":0,"collections_private_count":0,"followers_count":0,"followings_count":0,"pens_count":0,"pens_private_count":0,"projects_count":0,"projects_private_count":0},"__firebase":{"config":{"apiKey":"AIzaSyBgLAe7N_MdFpuVofMkcQLGwwhUu5tuxls","authDomain":"codepen-store-production.firebaseapp.com","databaseURL":"https://codepen-store-production.firebaseio.com","disabled":false,"projectId":"codepen-store-production"},"token":"eyJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJodHRwczovL2lkZW50aXR5dG9vbGtpdC5nb29nbGVhcGlzLmNvbS9nb29nbGUuaWRlbnRpdHkuaWRlbnRpdHl0b29sa2l0LnYxLklkZW50aXR5VG9vbGtpdCIsImNsYWltcyI6eyJvd25lcklkIjoiVm9Ea05aIiwiYWRtaW4iOmZhbHNlfSwiZXhwIjoxNzQ4MDg4NTg4LCJpYXQiOjE3NDgwODQ5ODgsImlzcyI6ImZpcmViYXNlLWFkbWluc2RrLThva3lsQGNvZGVwZW4tc3RvcmUtcHJvZHVjdGlvbi5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInN1YiI6ImZpcmViYXNlLWFkbWluc2RrLThva3lsQGNvZGVwZW4tc3RvcmUtcHJvZHVjdGlvbi5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInVpZCI6IlZvRGtOWiJ9.v9Gof6MI--LbONcLva94urTw0G3nptAJqoDsniSYD5EQh9rXMTiRFtqN_YTZhBgrlULDcCXTiMbD4g7FC8-g2p1EEatn40dchpcaFkGF3RDDztadFQBDdNuVu6UQIKxwI9ev1wQxWL2cEMIr_1L5RB4B-vwiFim5opPIpl8lPggMsYl_vJDiW4k9i3cmGq7skK1bFbfKpMCXHbzE9gDdC2dkX0hKybjrasYPTLJXS2lzLYVfyJ2wcO37OlMAG1HCMRaGhZAPXa2m51C12QDrTKA2DMQFa-thShiE80hihMKkUO6goQibuKgE7TM4PjKzY6Gmin_webSDoq6OouQMKg"},"__pay_stripe_public_key":"pk_live_2GndomDfiklqpSNQn8FrGuwZSMIMzha7DkLJqlYe7IR0ihKAlKdiHg68JJc5eVPt68rzAjzAAVXcUwjySHRCsgjQQ00gtRBUFNH","__pay_braintree_env":"production","__item":"{\"id\":55848493,\"user_id\":4559259,\"html\":\"\",\"css\":\"\",\"js\":\"\\/\\/press a key to change the type of sum (right,left, trapezoid, midpoint)\\n\\/\\/click to change dx\\nlet dx = 20;\\nlet rule = 3;\\nfunction setup() {\\n createCanvas(windowWidth, windowHeight);\\n angleMode(DEGREES);\\n noFill();\\n strokeWeight(1);\\n stroke(255);\\n}\\n\\nfunction draw() {\\n background(0);\\n t = frameCount;\\n line(0, height \\/ 2, width, height \\/ 2);\\n beginShape();\\n a = height \\/ 4;\\n for (let i = 0; i < width; i++) {\\n x = i;\\n y = a * sin(i + t) + height \\/ 2; \\/\\/-a*cos(i)+height\\/2;\\n vertex(x, y);\\n if (i % dx === 0) {\\n r = map(i, 0, width, 0, 255) \\/ 2 + 50;\\n g = map(i, 0, width, 0, 255) + 50;\\n b = map(i, 0, width, 0, 255) + 50;\\n fill(r, g, b);\\n if (rule === 0) {\\n \\/\\/right\\n rect(x, y, dx, height \\/ 2 - y);\\n } else if (rule === 1) {\\n \\/\\/left\\n rect(x, y, -dx, height \\/ 2 - y);\\n } else if (rule === 2) {\\n \\/\\/trapazoid\\n quad(\\n x,\\n y,\\n x + dx,\\n a * sin(x + dx + t) + height \\/ 2,\\n x + dx,\\n height \\/ 2,\\n x,\\n height \\/ 2\\n );\\n } else {\\n \\/\\/midpoint\\n rect(\\n x,\\n a * sin((2 * x + dx) \\/ 2 + t) + height \\/ 2,\\n dx,\\n -a * sin((2 * x + dx) \\/ 2 + t)\\n );\\n }\\n\\n noFill();\\n }\\n }\\n endShape();\\n}\\n\\nfunction mousePressed() {\\n if (dx > 1) {\\n dx--;\\n } else {\\n dx = 15;\\n }\\n}\\n\\nfunction keyPressed() {\\n if (rule < 3) {\\n rule++;\\n } else {\\n rule = 0;\\n }\\n}\\n\",\"html_pre_processor\":\"none\",\"css_pre_processor\":\"none\",\"js_pre_processor\":\"none\",\"html_classes\":\"\",\"css_starter\":\"neither\",\"js_library\":null,\"created_at\":\"2021-10-12T18:29:38.626Z\",\"updated_at\":\"2021-10-12T22:24:42.507Z\",\"title\":\"area\",\"description\":\"\",\"slug_hash\":\"WNEvbwz\",\"head\":\"\",\"private\":false,\"slug_hash_private\":\"8ff57aff680dd499ed3f6f4c3cdbe4fd\",\"has_animation\":false,\"team_id\":0,\"css_prefix\":\"neither\",\"template\":false,\"parent_id\":0,\"comments_count\":0,\"custom_screenshot_filename\":null,\"loves_count\":5,\"pick\":false,\"popularity\":30,\"views_count\":48,\"pick_visible_at\":null,\"cpid\":\"017c75c4-68c2-7bc7-b076-540f57b41e46\",\"is_new_editor_pen\":false,\"access\":\"Public\",\"pen_hash\":null,\"hashid\":\"WNEvbwz\"}"}