Skip to content

Instantly share code, notes, and snippets.

@Shankjbs571
Last active October 7, 2024 15:24
Show Gist options
  • Save Shankjbs571/c3581aaa0e8dce702ba3724026077a90 to your computer and use it in GitHub Desktop.
Save Shankjbs571/c3581aaa0e8dce702ba3724026077a90 to your computer and use it in GitHub Desktop.
image_array = ['https://www.reborns.com/user/1/17261951281b.webp','https://www.reborns.com/user/1/17261951283b.webp','https://www.reborns.com/user/1/172669568211b.webp','https://www.reborns.com/user/1/17261951284b.webp','https://www.reborns.com/user/1/172669568210b.webp','https://www.reborns.com/user/1/172669568212b.webp'];
if(typeof image_array != 'undefined' && image_array instanceof Array)
{
for( i = 0 ; i < image_array.length; i++)
{
noFiles++;
j = i+1;
if(i == 0)
{
feature = 'block';
hover = 'none';
color = featured_color;
border = '';
ratio_3_4="ratio_3_4";
}
// else if(i == 1)
// {
// feature = 'none';
// hover = 'block';
// color = hover_color;
// border = '';
// }
else
{
feature = 'none';
hover = 'none';
color = regular;
border = 'border-top-left-radius:8px;';
ratio_3_4="";
}
document.write('<li class="col-md-4 col-sm-6 col-xs-12" style="max-width:250px;text-align: center;padding:5px;background:rgba(0,0,0,0.0); height: 378px; " id="image'+j+'"><div class="kuchv" style="position:relative;background-color:rgba(0,0,0,0.0);height:inherit;width:100%;border-radius:8px;">');
temp = new Array();
temp = getCookie_images('files');
if(temp == undefined)
temp = [image_array[i]];
else
{
len = temp.length;
console.log('len : '+len);
temp[len] = image_array[i];
}
setCookie_images('files',temp);
$('#processed-files').attr('value',temp.join('|'));
document.write('<div class="loader" style="display:none;z-index:10000;vertical-align:middle;position:absolute;top:60px;right:30px;left:30px;"><img src="loader.gif" style=""/></div><div class="modal fade " id="modal'+j+'" aria-labelledby="modalLabel" role="dialog" tabindex="-1"><div class="modal-dialog modal-my" role="document"><div class="modal-content"><div class="modal-body"><div><img id="image'+j+'" class="modal-img" src="'+image_array[i]+'" alt="Picture"/></div></div><div class="modal-footer text-center"><button type="button" class="btn btn-default btn-save" id="save'+j+'" data-dismiss="modal">Crop</button><button type="button" style="margin-left:50px;" class="btn btn-default" data-dismiss="modal">Cancel</button></div></div></div></div><div class="modal fade " id="big-modal'+j+'" aria-labelledby="modalLabel" role="dialog" tabindex="-1"><div class="modal-dialog modal-my" role="document"><div class="modal-content"><div class="modal-body"><div><img id="big-image'+j+'" class="big-img" style="max-width:100%;max-height:65vh;" src="'+image_array[i]+'" alt="Picture"/></div></div><div class="modal-footer text-center"><button type="button" style="margin-left:50px;" class="btn btn-default" data-dismiss="modal">Close</button></div></div></div></div><div style="width:100%;height:20px;background:rgba(0,0,0,0.0);"><p class="feature handle" style="position:absolute;left:0px;top:0px;background-color:'+color+';color:white;height:20px;font-size:12px;padding: 2px 15px 2px 15px; display:'+feature+';border-top-left-radius:8px;border-top-right-radius:8px;">Featured Image</p><!---Hover Image--></div><div class="br" style=" height:348px;width:100%;background:'+color+';'+border+'border-top-right-radius:8px; border-bottom-right-radius:8px; border-bottom-left-radius:8px;padding:8px; display: flex;flex-direction: column;justify-content: space-between;"><img src="'+image_array[i]+'" id="main-image'+j+'" class=" handle '+ratio_3_4+' img" style="background-color: #ccc; max-height: 300px;height: 100%; max-width:100%;" data-target="#big-modal'+j+'" data-toggle="modal"/><div class="zone handle" style="display: flex;flex-direction: row;justify-content: space-between; padding-top: 10px;"><div class="btn-group" style=""><a class="btn rotate" style="background-color: rgba(0,0,0,0.8);border-radius:4px;padding:0px ;"><i class="fa fa-rotate-right" style="color:white;padding:2px ;"></i></a><a class="btn crop" style="background-color: rgba(0,0,0,0.8);margin-left:10px;border-radius:4px;padding:0px ;" data-target="#modal'+j+'" data-toggle="modal"><i class="fa fa-crop" style="color:white;padding:2px ;"></i></a></div><a class="btn remove" style="background-color: rgba(150,0,0,0.8);padding:0px ;"><i class="fa fa-close" style="color:white;padding:2px ;"></i></a></div></div></div></li>');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment