Thanks to @RobinZigmond I've found the solution.
if(e.keyCode == 37){
console.log("left")
const currentLeft = parseInt($('.fa-circle').css('left'));
const percentage = currentLeft - (3*currentLeft)/100
$('.fa-circle').css('left', percentage)
console.log($('.fa-circle').css('left'))
}
})
The browsers calculate the percentage of screen size to px so we can't to manipulate as %. The @RobinZigmond answer is not good because currentLeft may be 931 and if we add % we got 931% on left.
Firstly we have to parse the value of Left position to int.
The second step is very easy to do, We have to calculate the currentLeft - 3% with math.
EDIT:
The solution above is incorrect. Why? Using code above we subtract 3% of existing value. For 5 click the left value should be 35% => 672px. Using code above after 5 click we got (1)960px-3% = 931px then (2) 931px -3% ... (5)824px at the end left value is equal to 42.93%.
Correct code:
var fullscreenWidth = window.innerWidth
var widthMinusThreePercent = Math.floor(fullscreenWidth- ( fullscreenWidth- (3*fullscreenWidth) /100))
document.addEventListener("keydown", function (e) {
if(e.keyCode == 37){
console.log("left")
const currentLeft = parseInt($('.fa-circle').css('left'));
//const percentage = currentLeft - (3*currentLeft)/100
$('.fa-circle').css('left', currentLeft - widthMinusThreePercent)
})