{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":762888915,"defaultBranch":"main","name":"calculator","ownerLogin":"henrylin03","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2024-02-25T00:57:26.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/83106787?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1709186033.0","currentOid":""},"activityList":{"items":[{"before":"10360cf9c2a70ca0895b4b1ee8897b2f432df8b1","after":"6c9d80066a1cd0296afb4455032350a7c1950358","ref":"refs/heads/main","pushedAt":"2024-04-23T09:28:20.000Z","pushType":"push","commitsCount":4,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"reduce size of both buttons and the calculator on smaller screens, thereby increasing the border around it\n\nupdating padding on body element didn't work, so i used min functions mixing px and vw (dynamic) units. fixes #24","shortMessageHtmlLink":"reduce size of both buttons and the calculator on smaller screens, th…"}},{"before":"ad1831a89d0002b9f008032371d1863d02586773","after":"10360cf9c2a70ca0895b4b1ee8897b2f432df8b1","ref":"refs/heads/main","pushedAt":"2024-03-13T00:00:35.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"use backspace icon's svg as inline element in html to change its colour programmatically instead of hardcoding - fixes #7","shortMessageHtmlLink":"use backspace icon's svg as inline element in html to change its colo…"}},{"before":"b28b3997cb7dc5e2dc4a0c1fb5cb385c2915a228","after":"ad1831a89d0002b9f008032371d1863d02586773","ref":"refs/heads/main","pushedAt":"2024-03-04T03:09:13.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"reposition calculator towards centre of page - fixes #22","shortMessageHtmlLink":"reposition calculator towards centre of page - fixes #22"}},{"before":"99a59d2f1edb1feffa16dd9c4bfbd737dad73140","after":"b28b3997cb7dc5e2dc4a0c1fb5cb385c2915a228","ref":"refs/heads/main","pushedAt":"2024-03-03T23:11:12.000Z","pushType":"pr_merge","commitsCount":1,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"feat: add hover effect to footer icon (#19)\n\n* feat: add hover effect to footer icon\r\n\r\n* remove github icons because using svg in index.html for github icon\r\n\r\n* update colours to align with colour scheme\r\n\r\nprogrammatically update fill of github svg file instead of hardcoding it into index.html\r\n\r\n* align colours of the footer text with the initial colour of the github icon, and darken the hovered fill of the github icon\r\n\r\n---------\r\n\r\nCo-authored-by: henrylin03 <83106787+henrylin03@users.noreply.github.com>","shortMessageHtmlLink":"feat: add hover effect to footer icon (#19)"}},{"before":"e62ca6dac379da149eda6e1c66ca59c4d43e1e77","after":"99a59d2f1edb1feffa16dd9c4bfbd737dad73140","ref":"refs/heads/main","pushedAt":"2024-03-03T05:52:50.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"update readme, resolves #3","shortMessageHtmlLink":"update readme, resolves #3"}},{"before":"3f269de67f8de8a2f7769ecd717985ace3e9f41d","after":"e62ca6dac379da149eda6e1c66ca59c4d43e1e77","ref":"refs/heads/main","pushedAt":"2024-02-29T06:00:44.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"add favicon","shortMessageHtmlLink":"add favicon"}},{"before":"39f7687e8d281bcb6578707424fcb28e3dbf551e","after":null,"ref":"refs/heads/enable-keyboard-entry","pushedAt":"2024-02-29T05:53:53.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"}},{"before":"036de3dfbd6784c0c011b4c0843e32962c4be966","after":"3f269de67f8de8a2f7769ecd717985ace3e9f41d","ref":"refs/heads/main","pushedAt":"2024-02-29T05:53:50.000Z","pushType":"pr_merge","commitsCount":1,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"feat: enable using keyboard (#2)\n\n* add todo and placeholder function\r\n\r\n* test alerting the .key attribute of event e parameter\r\n\r\n* enable decimal point to be added via keyboard\r\n\r\n* fix: double decimals\r\n\r\nchanged logic around so that if the last character is already a decimal, the decimal pressed again just removes it\r\n\r\n* update event type to keydown so that users can hold a key for multiple numbers\r\n\r\n* feat: enable key digit input, and increase max characters displayed\r\n\r\nthe code in the function displayDigitOrDecimalWithKeyboard is unclean. if the input is a digit, the arg passed into displayDigit function (which is common event handler, fired when user clicks the digits with their mouse) is event e, rather than the digit itself. ideally, and perhaps for future refactoring, displayDigit's parameter is the actual digit input, which can either be the e.key of a keyboard event, or e.target.textContent of the button element being clicked\r\n\r\n* feat: enable key digit input, and reduce max characters displayed\r\n\r\nthe code in the function displayDigitOrDecimalWithKeyboard is unclean. if the input is a digit, the arg passed into displayDigit function (which is common event handler, fired when user clicks the digits with their mouse) is event e, rather than the digit itself. ideally, and perhaps for future refactoring, displayDigit's parameter is the actual digit input, which can either be the e.key of a keyboard event, or e.target.textContent of the button element being clicked\r\n\r\n* use dispatch event to force a mousedown and mouseup, then click\r\n\r\n* programmatically add the digits as a class for each digit button\r\n\r\nthis makes it easier to identify when mapping keyboard .key's to the buttons\r\n\r\n* ensure the class that i am adding to each of the digits don't start with a number\r\n\r\nthis is not allowed in css\r\n\r\n* make decimal button change colour once selected and held\r\n\r\n* use else if statement as clearer\r\n\r\n* click decimal button and equivalent digit button, identified via class\r\n\r\nI believe, right now as I'm writing, that this code is more readable by routing all key strokes to the equivalent button on the calculator, rather than calling the functions that are triggered by mouseclicks, directly\r\n\r\n* align event listeners on the entire page\r\n\r\n* feat: clicking digit buttons inputs into display, and also changes the style of the button (looks like it's been pressed)\r\n\r\n* fix: backspace button was on hold when it was meant to come off clicked once you let go of mouse on the button\r\n\r\n* rename function to be more inclusive of other buttons\r\n\r\n* add underscores to all capitalised constants\r\n\r\n* fix: update variable references to max_chars_displayed (with underscores). reduce indentation by using return statements in conditionals\r\n\r\n* start creating hashmap where key is the button, and values are the keys that would trigger them\r\n\r\nhad to do it this way (rather than the key of object being keyboard key) as there could be multiple keys to trigger a button, but you need to have unique keys in an object\r\n\r\n* add hashmap of operators, where keys are the operator (shown in html), and values are the keyboard keys\r\n\r\n* find equivalent button by looking through all button's textContent\r\n\r\n* create set of operator keyboard keys\r\n\r\nuse set instead of array because faster. i think this is best practice. checking whether the key is inside of it (coming up next commit) is also more intuitive imo with .has method\r\n\r\n* feat: enable keyboard input for operators (+, -, *times, divide)\r\n\r\n* using hashmap, find the button to click if an operator button is clicked\r\n\r\ni tried to use || to find the right button, but it kept defaulting to divide if i used +. this means i had to hardcode in that '+' means '+' which feels really dumb. I also have two ways (used to be 3, if i included capital X, which i've now removed by lowercasing everything at the start) to map to multiplication, which again feels silly, but it's way easier to hardcode this at my skill level right now, from what i can find on google, to find the equivalent _key_ of an object, if a value is in the _value_ (as array) of an object\r\n\r\n* feat: backspace on keyboard (or delete) does backspace/delete on display\r\n\r\n* enable equals button to be pressed via enter key or equals key on keyboard. also ensured it isn't 'stuck'\r\n\r\n* click escape button with keyboard\r\n\r\n* move variables to top of function for clarity\r\n\r\n* write ternary statement to get equivalentBtn\r\n\r\n* use ternary statements to conditionally assign equivalent button (to key), which is then mousedown'd (to change its colour) and then clicked (to trigger its functionality)\r\n\r\ni had to put in an exit condition because using ternary statements was the cleanest way, in my opinion. otherwise, using normal conditionals, i'd have to type out 'equivalentBtn' variables multiple times.\r\n\r\n* fix: esc did not refresh page","shortMessageHtmlLink":"feat: enable using keyboard (#2)"}},{"before":null,"after":"39f7687e8d281bcb6578707424fcb28e3dbf551e","ref":"refs/heads/enable-keyboard-entry","pushedAt":"2024-02-29T05:50:44.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"fix: esc did not refresh page","shortMessageHtmlLink":"fix: esc did not refresh page"}},{"before":"b869a24fa63682002db712f5d1dfe57c2e8fd9e3","after":"036de3dfbd6784c0c011b4c0843e32962c4be966","ref":"refs/heads/main","pushedAt":"2024-02-28T22:18:35.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"make backspace button bigger","shortMessageHtmlLink":"make backspace button bigger"}},{"before":"c045115f4547557cb3a4489bc8ed46ae2649da15","after":"b869a24fa63682002db712f5d1dfe57c2e8fd9e3","ref":"refs/heads/main","pushedAt":"2024-02-28T22:10:33.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"change cursor to pointer to give user prompt that button is clickable","shortMessageHtmlLink":"change cursor to pointer to give user prompt that button is clickable"}},{"before":"f1fe78429678a00829b4152bb8da9947f0c4059a","after":"c045115f4547557cb3a4489bc8ed46ae2649da15","ref":"refs/heads/main","pushedAt":"2024-02-28T06:19:30.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"fix: remove outline from display so that when users click it, they don't see an ugly white border","shortMessageHtmlLink":"fix: remove outline from display so that when users click it, they do…"}},{"before":"84dc75abb2bf01e56e449c7b0c503dbdefe83625","after":"f1fe78429678a00829b4152bb8da9947f0c4059a","ref":"refs/heads/main","pushedAt":"2024-02-28T06:06:34.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"ensured responsive design (tested on smaller screens in google chrome)\n\ninstead of media queries, which would make the css very wordy, made calculator to the thinnest phone and adjusted padding, margin and gap between calculator and footer in flex container","shortMessageHtmlLink":"ensured responsive design (tested on smaller screens in google chrome)"}},{"before":"2e28521b14850544437a9b4687b60325c52b9bc1","after":"84dc75abb2bf01e56e449c7b0c503dbdefe83625","ref":"refs/heads/main","pushedAt":"2024-02-28T06:01:18.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"fix: user can hold down on a digit and drag somewhere else (and not mouseup on the digit specifically) and have the colour of the digit button not stuck\n\nattach event listener on body. although, this has one downside of mouse up potentially going out of the screen.","shortMessageHtmlLink":"fix: user can hold down on a digit and drag somewhere else (and not m…"}},{"before":"8d3d166670788a36bf081dada052b71c97b0a268","after":null,"ref":"refs/heads/use-bkspace-instead-of-percent","pushedAt":"2024-02-28T05:36:09.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"}},{"before":"eae8128ceb3c69295fc5c669ea59969d212abf9c","after":"2e28521b14850544437a9b4687b60325c52b9bc1","ref":"refs/heads/main","pushedAt":"2024-02-28T05:36:06.000Z","pushType":"pr_merge","commitsCount":1,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"add backspace button instead of % calculations (#1)\n\n* add backspace button and colour\r\n\r\ni tried to use fill='currentColor'\r\nto update the colour of the backspace vector image programmatically in css, but it didn't work, so i had to update it manually in the svg itself\r\n\r\n* feat: add backspace button to delete a character that has been inputted by user\r\n\r\nif the display is 0, nothing happens. if the display only has one character, then show 0, otherwise chop off the last digit. also, if the display is showing something that has been calculated, then do nothing also","shortMessageHtmlLink":"add backspace button instead of % calculations (#1)"}},{"before":null,"after":"8d3d166670788a36bf081dada052b71c97b0a268","ref":"refs/heads/use-bkspace-instead-of-percent","pushedAt":"2024-02-28T05:35:15.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"feat: add backspace button to delete a character that has been inputted by user\n\nif the display is 0, nothing happens. if the display only has one character, then show 0, otherwise chop off the last digit. also, if the display is showing something that has been calculated, then do nothing also","shortMessageHtmlLink":"feat: add backspace button to delete a character that has been inputt…"}},{"before":"9baf671dadae47a51b8d1a2e4650047d7576fe67","after":"eae8128ceb3c69295fc5c669ea59969d212abf9c","ref":"refs/heads/main","pushedAt":"2024-02-28T05:12:42.000Z","pushType":"push","commitsCount":47,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"push calculator towards middle, and footer furrther down","shortMessageHtmlLink":"push calculator towards middle, and footer furrther down"}},{"before":"cc7653545a3cef997d3b7d77e59bab4d519d7026","after":"9baf671dadae47a51b8d1a2e4650047d7576fe67","ref":"refs/heads/main","pushedAt":"2024-02-27T22:10:13.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"use if/else for clarity","shortMessageHtmlLink":"use if/else for clarity"}},{"before":"5284a4718d8dc36f7e47e8ce0e1bb8c9e5f1c98e","after":"cc7653545a3cef997d3b7d77e59bab4d519d7026","ref":"refs/heads/main","pushedAt":"2024-02-27T07:09:41.000Z","pushType":"push","commitsCount":26,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"fix: buttons and calculator don't get squished when screen narrows","shortMessageHtmlLink":"fix: buttons and calculator don't get squished when screen narrows"}},{"before":"1b72313274e19599452183358954db5166f0a481","after":"5284a4718d8dc36f7e47e8ce0e1bb8c9e5f1c98e","ref":"refs/heads/main","pushedAt":"2024-02-26T22:50:24.000Z","pushType":"push","commitsCount":45,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"assign num2 to the digits after last operator and perform calculations\n\nallows 2 sets of numbers to be calculated using calculator","shortMessageHtmlLink":"assign num2 to the digits after last operator and perform calculations"}},{"before":null,"after":"1b72313274e19599452183358954db5166f0a481","ref":"refs/heads/main","pushedAt":"2024-02-25T00:57:26.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"henrylin03","name":"Henry Lin","path":"/henrylin03","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/83106787?s=80&v=4"},"commit":{"message":"Initial commit","shortMessageHtmlLink":"Initial commit"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"startCursor":"Y3Vyc29yOnYyOpK7MjAyNC0wNC0yM1QwOToyODoyMC4wMDAwMDBazwAAAAQ34TAT","endCursor":"Y3Vyc29yOnYyOpK7MjAyNC0wMi0yNVQwMDo1NzoyNi4wMDAwMDBazwAAAAQEQJMP"}},"title":"Activity · henrylin03/calculator"}