Skip to content

Instantly share code, notes, and snippets.

@ctlusto
Last active January 13, 2017 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ctlusto/49c72a63eddb87f8341cd535a2bb6155 to your computer and use it in GitHub Desktop.
Save ctlusto/49c72a63eddb87f8341cd535a2bb6155 to your computer and use it in GitHub Desktop.
Desmos Mockup Tool with Custom Colors
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Desmos Custom Colors</title>
<link href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://www.desmos.com/api/v0.8/calculator.js?apiKey=dcb31709b452b1cf9dc26972add0fda6"></script>
<style>
html,
body {
width: 100%;
height: 100%;
}
#calculator {
width: 550px;
height: 450px;
}
</style>
</head>
<body>
<div id="calculator"></div>
<script>
$(function() {
var $elt = $('#calculator');
window.calculator = Desmos.GraphingCalculator($elt[0], {
colors: {
niceRed: '#F15A22',
prettyOkayBlue: '#0092C8',
standardGreen: '#0AB14B',
veryNicePurple: '#812990',
theOnlyBlack: '#000000',
lessBlackThanBlack: '#58595B'
}
});
$elt.resizable({
handles: 'e, s',
resize: function(evt, ui) {
calculator.resize();
console.log('width: ' + ui.size.width);
console.log('height: ' + ui.size.height);
}
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment