Latest solutions
Interactive Card Details Form using Sass and CSS Grid (mobile/desktop)
#sass/scssSubmitted about 1 year ago
Latest comments
- @DrainGKSubmitted about 1 year ago@TheGroobiPosted about 1 year ago
Some quick issues i found in your code:
-
Your month and year values are not limited to two digits which breaks the design when you put in a higher value
-
Your year value accepts expired invalid cards
You could put a minlength/maxlength values on month year and cvc which eliminates the need for error if statement checking the regex at all
On the year input you could do something like this for checking the expiration of the card
let thisYear = new Date().getFullYear(); thisYear = thisYear.toString().slice(2, 4); if (input.value < thisYear) { //your error statement here };
i personally also included maxing the value at
thisYear + 20;
On another note i really like the animations you did with inputs
0 -
- @kaiketorresSubmitted over 1 year ago@TheGroobiPosted over 1 year ago
Your missing some margins on the bottom and on the learning text, and a border-radius on the graphic. Also the left margin on the whole thing is uneven. If you put all of the elements inside a container div it's way easier to control the margin. You could put the container width to the same as the graphic and add a padding with white background for it to have an even white border on all sides :)
0