Created
December 6, 2022 13:44
-
-
Save Dmuasya/33d1c8d702b4f8aa61e84a0beedb6491 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#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