Skip to content

Instantly share code, notes, and snippets.

@hklcf
Created August 4, 2016 12:48
Show Gist options
  • Save hklcf/e131523dda4780d50b576e9dafd7cda4 to your computer and use it in GitHub Desktop.
Save hklcf/e131523dda4780d50b576e9dafd7cda4 to your computer and use it in GitHub Desktop.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>將您的訊息繪製成畫!</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://intridea.github.com/sketch.js/lib/sketch.min.js"></script>
<style type='text/css'>
.tools {
height: 32px;
border-bottom: 1px solid #c5c5c5;
overflow: hidden;
white-space: nowrap;
}
.tools a {
border: 1px solid black;
height: 16px;
padding: 0 10px;
vertical-align: middle;
text-align: center;
text-decoration: none;
display: inline-block;
color: black;
font-weight: bold;
}
.color a {
display: inline-block;
height: 16px;
width: 16px;
-webkit-border-radius: 50%;
border-radius: 50%;
margin: 0 2px;
-webkit-box-shadow: 0 0 0 1px rgba(0,0,0,.1) inset;
box-shadow: 0 0 0 1px rgba(0,0,0,.1) inset;
cursor: pointer;
}
canvas {
border: 1px solid #ccc;
}
</style>
</head>
<body>
<div class="tools">
<div class="size">
<a href='#sketch' data-size="0.5" title="超幼筆刷" style="background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAN0lEQVQ4T2NkoAFgpIGZDKOGUj9UR8OUqDB9wMDAoECUSgaG0XRKbECRoG40nZIQWEQqHeFhCgAnaAEW3Cl+7wAAAABJRU5ErkJggg==);"></a>
<a href='#sketch' data-size="2.5" title="幼筆刷" style="background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAdElEQVQ4T+2SwQ2AIBAEh0osQe3AErQyLU070Eo0l/DgQdwQIX7ufuTCsDsh0GBCAyYOrW/1F6cTsAIDcAILsKtuKqkB+gRi5/Er9M4AVBD5T61yl4CPqOI1rHrVnG5RwQXMNZwqfdm9SurQcgPutNyZuvEAYCILFgDuDRwAAAAASUVORK5CYII=);"></a>
<a href='#sketch' data-size="4.5" title="粗筆刷" style="background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAi0lEQVQ4T+2T0Q2AIAwFj4nUSXQjdSNH0Yk0L4EvaVESPkzkk7SXx7UEGpzQgMkPda0uwAj0wA5swFqag+dUkC4D0P3ggS2oEs5Oo9KqJnssqJUyQdy0FvQseQN7HWuTHnF4r57fxKkSWF7dlGosfVMlnuJqCaY9NaeeXJSgD+Z1L/mhVdrcpu84vQACGxMW88OdjAAAAABJRU5ErkJggg==);"></a>
<a href='#sketch' data-size="7.5" title="超粗筆刷" style="background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAA2klEQVQ4T72U7Q0BQRRFz1ZACVSASlABKkMF6IQKKIEKyEmQ2TW7ZjfGSybz583JfR93CjJEkYFJE3QGTIHx8xwBzwHYN4mJQfvAGhBaF0JXwDWWUIUKPAPe30LgMAauQlVgyalh/ryaHEItd5dKC/KElnocQjfAogN0CyzDdyHUyY46QH03qYPeOwBfT0qz+YXS03OP35qy9zTL9JXfdk+17IfzYo66AL2Eod2AQYqjZGlRd7bJWSp0N5O8Hwq0LI+/lPvrlN1JW9T6l0qovDnl7590Z8VZlD4AaHMlFtCZbpwAAAAASUVORK5CYII=);"></a>
</div>
<div class="tool">
<a href='#sketch' data-tool="marker" title="鉛筆" style="background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvY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tLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAADuSURBVHjapNMhUsNAFMbx/3uJAJ2VyGQHwxXQXCCyJ0DhYFCAKEfAV7Yaw0APgSCTLNxgr7AP1U4mgmbL596++X27Zgsy0jTNo3Pu1Tl3GmP8ACjmYu/9UkTugRK4rKrqJMb4LnNwXddnqroF6snqQWfcfKuq25TSAgiT9Y0ewsASqFV1NS0xsxeZgccJKaWFqq7M7G0YhmvJwOOSqxDCD2BlJgbYhBC+d4Nk4ue+7+/GB/IfvC/w3p8DX7kYQAFEpD0G7wvMrD0GA8gfzz+IAUoRac1sN3dmti6KYt113eecf1Ka2YWZPeWgcX4HAND9b4zgixd5AAAAAElFTkSuQmCC);"></a>
</div>
</div>
<div class="color">
<a href='#sketch' style="background-color: #ffffff" data-color="#ffffff" title="白色"></a>
<a href='#sketch' style="background-color: #d4d4d4" data-color="#d4d4d4" title="灰白色"></a>
<a href='#sketch' style="background-color: #aaaaaa" data-color="#aaaaaa" title="淺灰色"></a>
<a href='#sketch' style="background-color: #7f7f7f" data-color="#7f7f7f" title="灰色"></a>
<a href='#sketch' style="background-color: #555555" data-color="#555555" title="深灰色"></a>
<a href='#sketch' style="background-color: #383838" data-color="#383838" title="深灰色"></a>
<a href='#sketch' style="background-color: #1a1a1a" data-color="#1a1a1a" title="極深灰色"></a>
<a href='#sketch' style="background-color: #000000" data-color="#000000" title="黑色"></a>
<a href='#sketch' style="background-color: #edc12d" data-color="#edc12d" title="橙黃色"></a>
<a href='#sketch' style="background-color: #df5b16" data-color="#df5b16" title="橙紅色"></a>
<a href='#sketch' style="background-color: #d82d18" data-color="#d82d18" title="紅色"></a>
<a href='#sketch' style="background-color: #55a436" data-color="#55a436" title="深綠色"></a>
<a href='#sketch' style="background-color: #198ebf" data-color="#198ebf" title="深藍色"></a>
<a href='#sketch' style="background-color: #692282" data-color="#692282" title="暗紫色"></a>
<a href='#sketch' style="background-color: #71174c" data-color="#71174c" title="栗紅色"></a>
<a href='#sketch' style="background-color: #441e14" data-color="#441e14" title="啡色"></a>
<a href='#sketch' style="background-color: #f6eb3b" data-color="#f6eb3b" title="黃色"></a>
<a href='#sketch' style="background-color: #f38618" data-color="#f38618" title="橙色"></a>
<a href='#sketch' style="background-color: #ef6b48" data-color="#ef6b48" title="暗橙紅色"></a>
<a href='#sketch' style="background-color: #7bbb61" data-color="#7bbb61" title="綠色"></a>
<a href='#sketch' style="background-color: #41b2d0" data-color="#41b2d0" title="藍色"></a>
<a href='#sketch' style="background-color: #8b519f" data-color="#8b519f" title="紫色"></a>
<a href='#sketch' style="background-color: #d05da1" data-color="#d05da1" title="豔粉紅"></a>
<a href='#sketch' style="background-color: #75554b" data-color="#75554b" title="淺棕色"></a>
<a href='#sketch' style="background-color: #f6f697" data-color="#f6f697" title="淺黃色"></a>
<a href='#sketch' style="background-color: #f9c787" data-color="#f9c787" title="橙色"></a>
<a href='#sketch' style="background-color: #f4a38a" data-color="#f4a38a" title="淡橙紅"></a>
<a href='#sketch' style="background-color: #add59b" data-color="#add59b" title="淺綠色"></a>
<a href='#sketch' style="background-color: #84d0e2" data-color="#84d0e2" title="淺藍"></a>
<a href='#sketch' style="background-color: #b18cbc" data-color="#b18cbc" title="淡紫色"></a>
<a href='#sketch' style="background-color: #f4c6e0" data-color="#f4c6e0" title="粉紅色"></a>
<a href='#sketch' style="background-color: #99817a" data-color="#99817a" title="淺棕色"></a>
</div>
<div>
<a href='#sketch' data-download="png" style="float: right; width: 100px;">Download</a>
</div>
<canvas id="sketch" width="720" height="480"></canvas>
<script type="text/javascript">
$(function() {
$('#sketch').sketch();
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment