H
H
hellcaster2018-08-15 21:26:05
Images
hellcaster, 2018-08-15 21:26:05

Is there some kind of gulp plugin for retinizing images?

Is there any plugin for retinizing images (to create an image with double and triple magnification and adding suffixes)? I just found gulp-responsive , but as far as I understand, you need to set the names of all images there, and then there will be "magic". Is it possible somehow so that it itself creates all the images from the img folder in the size of x2 and x3 and with the suffixes @x2 and @x3?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Martovitskiy, 2018-08-15
@Martovitskiy

Have a look at gulp-retinize

I
IceJOKER, 2015-02-01
@loogle18

Because the first IF is triggered and that's it, else if means that you need to fulfill the condition if the previous one was fulfilled with false, so the first one was executed, and the last one remained so))

if (pressKey.keyCode == 38)
{
    //для этого условия код выполните в одном месте, тут можно проверить есть в аттрибуте style и т.д.
}
else if(pressKey.keyCode == 40)
{

}

And it’s possible without else , it’s unlikely that one key can have two values ​​​​at the same time O_O
ps some kind of terrible style check, is it possible to assign a class and then check hasClass

A
Alexey Shein, 2015-02-01
@conf

Third branch

else if (pressKey.keyCode == 38 && me.attr('style') == 'transform: rotate(-180deg) scale(1, 1)') { // При нажатии клавиши вверх и соответствии стиля
      me.animate({rotate : '360deg'}, 500);
    }

will never be executed, because the first branch ( pressKey.keyCode == 38) contains a milder condition than the third one. Those. in all cases when the third branch could be executed, the first one is executed, because it is checked before.
Rewrite to the following code:
if (pressKey.keyCode == 38) { // При нажатии клавиши вверх
    if (me.attr('style') == 'transform: rotate(-180deg) scale(1, 1)') { // При нажатии клавиши вверх и соответствии стиля
      me.animate({rotate : '360deg'}, 500);
    } else {
      me.attr('src', 'deep_space/me_up.png');
    }
}
    else if (pressKey.keyCode == 40) { // При нажатии клавиши вниз
      me.animate({rotate : '-180deg'}, 500);
      me.attr('src', 'deep_space/me_up.png');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question