Skip to content

Instantly share code, notes, and snippets.

@Dmuasya
Created December 6, 2022 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dmuasya/33d1c8d702b4f8aa61e84a0beedb6491 to your computer and use it in GitHub Desktop.
Save Dmuasya/33d1c8d702b4f8aa61e84a0beedb6491 to your computer and use it in GitHub Desktop.
$("#deviceTypes").change(function(e) {
$(".device").removeClass('device-android');
$(".device").removeClass('device-samsung');
$(".device").removeClass('device-htc');
$(".device").removeClass('device-nexus');
$(".device").removeClass('device-tablet');
$(".device").removeClass('device-windows');
$(".device").removeClass('device-iphone');
$(".device").addClass($(this).val())
});
$("#bcTypes").change(function(e) {
var bc = $(this).val();
if (bc == 'big') {
$('#appDiv').css('width', '820px');
$('#appDiv').css('padding', '20px');
$('.' + $("#deviceTypes").val()).css('margin', '20px');
canvas.setHeight(620);
canvas.setWidth(800)
} else {
$('#appDiv').css('width', '400px');
$('#appDiv').css('padding', '120px 0px 120px 0px');
$('.' + $("#deviceTypes").val()).css('margin', 'auto');
canvas.setHeight(800);
canvas.setWidth(380)
}
});
$("#saveImg").click(function() {
html2canvas($("#appDiv"), {
onrendered: function(fgfg) {
window.open(fgfg.toDataURL('png'))
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment