mirror of
https://github.com/lovasoa/whitebophir
synced 2024-11-10 14:34:20 +00:00
improve display on mobile. There is still much to do...
This commit is contained in:
parent
1037eba5e2
commit
aebd2ef973
3 changed files with 43 additions and 13 deletions
|
@ -5,6 +5,7 @@ html, body, svg {
|
|||
|
||||
#menu {
|
||||
font-family:"Segoe UI","Roboto","Ubuntu";
|
||||
font-size:4vh;
|
||||
border-radius:0;
|
||||
box-shadow: 0px 0px 9px black;
|
||||
overflow:hidden;
|
||||
|
@ -13,8 +14,7 @@ html, body, svg {
|
|||
top:0;
|
||||
color:black;
|
||||
background-color:rgba(0,100,255,0.9);
|
||||
width:15%;
|
||||
max-width:200px;
|
||||
width:10vw;
|
||||
height:100%;
|
||||
transition-duration:1s;
|
||||
cursor:default;
|
||||
|
@ -35,9 +35,9 @@ html, body, svg {
|
|||
}
|
||||
|
||||
#menu h2{ /*Menu title ("Menu")*/
|
||||
font-size:22px;
|
||||
font-size:6vh;
|
||||
font-family:monospace;
|
||||
letter-spacing:5px;
|
||||
letter-spacing:.5vw;
|
||||
text-shadow: 0px 0px 9px white;
|
||||
color:black;
|
||||
word-wrap:break-word;
|
||||
|
@ -53,9 +53,7 @@ html, body, svg {
|
|||
#menu li {
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size:1.3em;
|
||||
list-style-position:inside;
|
||||
width:100%;
|
||||
color:#335;
|
||||
border:0;
|
||||
text-decoration:none;
|
||||
|
@ -77,19 +75,51 @@ html, body, svg {
|
|||
}
|
||||
|
||||
#menu .tool-icon {
|
||||
padding:3px;
|
||||
width:10px;
|
||||
padding:1vh;
|
||||
width:2vw;
|
||||
}
|
||||
#menu .tool-name {
|
||||
margin-left: 20px;
|
||||
margin-left: .5vw;
|
||||
font-size:4vh;
|
||||
}
|
||||
|
||||
@media (max-width: 1000px) {
|
||||
#menu {
|
||||
font-size:2.5vw;
|
||||
}
|
||||
#menu .tool-name {
|
||||
display: none;
|
||||
}
|
||||
#menu .tool-icon {
|
||||
width:100%;
|
||||
font-size:5vw
|
||||
}
|
||||
#menu h2 {
|
||||
white-space: nowrap;
|
||||
font-size:3vw;
|
||||
}
|
||||
#menu h3 {
|
||||
font-size:2.5vw;
|
||||
margin-top:0;
|
||||
}
|
||||
#chooseColor {
|
||||
width:100%;
|
||||
}
|
||||
#chooseSize {
|
||||
width:100%;
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
input {
|
||||
font-size:16px;
|
||||
}
|
||||
|
||||
#chooseColor {
|
||||
width:5em;
|
||||
width:5vw;
|
||||
height:4vh;
|
||||
border:1px solid black;
|
||||
border-radius:3px;
|
||||
color:black;
|
||||
|
@ -97,5 +127,5 @@ input {
|
|||
}
|
||||
|
||||
#chooseSize {
|
||||
width:100px;
|
||||
width:5vw;
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
//gist.github.com/lovasoa/8141243
|
||||
var canvascolor=(function(){function x(a,c){a/=Math.PI/6;var k=a|0,d=a-k,f=0*c,l=c*(1-1*d),d=c*(1-1*(1-d));switch(k%6){case 0:return[c,d,f];case 1:return[l,c,f];case 2:return[f,c,d];case 3:return[f,l,c];case 4:return[d,f,c];case 5:return[c,f,l]}}function y(a){do if("fixed"===getComputedStyle(a).position)return!0;while(null!==(a=a.parentElement));return!1}function v(a){function c(b){return"#"+(15*b[0]/255|0).toString(16)+(15*b[1]/255|0).toString(16)+(15*b[2]/255|0).toString(16)}function k(b){return x(b[0]/ g*Math.PI,255*(1-b[1]/m))}function d(b,z){a.style.backgroundColor=b;z&&0===a.style.backgroundColor.length?a.style.backgroundColor=t:(t=q.style.backgroundColor=b,a.value=b,a.focus())}function f(b){var a=document.createElement("div");a.style.width=g/3-10+"px";a.style.height=m/3-8+"px";a.style.backgroundColor=b;a.addEventListener("click",function(){d(b)},!0);1>=n.childElementCount?n.appendChild(a):n.insertBefore(a,n.children[1]);return a}function l(b){var a=h.getBoundingClientRect();return[b.clientX- a.left,b.clientY-a.top]}var t=a.value||"#000",g=200,m=g/2,e=r.cloneNode(!0);e.style.width=g+"px";e.style.position=y(a)?"fixed":"absolute";var h=e.getElementsByTagName("canvas")[0],p=h.getContext("2d");h.width=g;h.height=m;var n=e.getElementsByClassName("canvascolor-history")[0];n.style.width=g+"px";n.style.maxHeight=m+"px";var q=f(t);q.style.border="1px solid white";q.style.a="5px";document.body.appendChild(e);a.addEventListener("mouseover",function(){var b=a.getBoundingClientRect(),c=b.top+b.height+ 3,b=b.left;"fixed"!==e.style.position&&(c+=window.scrollY,b+=window.scrollX);e.style.top=c+"px";e.style.left=b+"px";e.style.display="block"},!0);e.addEventListener("mouseleave",function(){e.style.display="none"},!1);a.addEventListener("keyup",function(){d(a.value,!0)},!0);d(a.value,!0);var s=p.createImageData(g,m);(function(){for(var b=0;b<g;b++)for(var a=0;a<m;a++){var c=4*(b+a*g),d=k([b,a]);s.data[c]=d[0];s.data[c+1]=d[1];s.data[c+2]=d[2];s.data[c+3]=255}p.putImageData(s,0,0)})();h.addEventListener("mousemove", function(a){a=l(a);q.style.backgroundColor=c(k(a))},!0);h.addEventListener("click",function(a){a=l(a);a=c(k(a));f(a);d(a)},!0);h.addEventListener("mouseleave",function(){q.style.backgroundColor=t},!0)}(function(){var a=document.createElement("style");a.innerHTML=".canvascolor-container{background-color:black;border-radius:5px;overflow:hidden;width:179px;padding:2px;display:none;}.canvascolor-container canvas{cursor:crosshair;}.canvascolor-history{overflow:auto;}.canvascolor-history > div{margin:2px;display:inline-block;}"; document.head.appendChild(a)})();var r;(function(){r=document.createElement("div");r.className="canvascolor-container";var a=document.createElement("canvas"),c=document.createElement("div");c.className="canvascolor-history";r.appendChild(a);r.appendChild(c)})();for(var w=document.querySelectorAll("input.canvascolor, input[type=color]"),p=0;p<w.length;p++){var u=w.item(p);"color"===u.type&&-1===u.className.split(" ").indexOf("canvascolor")||v(u)}return v})();
|
||||
var canvascolor=(function(){function x(a,c){a/=Math.PI/6;var k=a|0,d=a-k,f=0*c,l=c*(1-1*d),d=c*(1-1*(1-d));switch(k%6){case 0:return[c,d,f];case 1:return[l,c,f];case 2:return[f,c,d];case 3:return[f,l,c];case 4:return[d,f,c];case 5:return[c,f,l]}}function y(a){do if("fixed"===getComputedStyle(a).position)return!0;while(null!==(a=a.parentElement));return!1}function v(a){function c(b){return"#"+(15*b[0]/255|0).toString(16)+(15*b[1]/255|0).toString(16)+(15*b[2]/255|0).toString(16)}function k(b){return x(b[0]/ g*Math.PI,255*(1-b[1]/m))}function d(b,z){a.style.backgroundColor=b;z&&0===a.style.backgroundColor.length?a.style.backgroundColor=t:(t=q.style.backgroundColor=b,a.value=b)}function f(b){var a=document.createElement("div");a.style.width=g/3-10+"px";a.style.height=m/3-8+"px";a.style.backgroundColor=b;a.addEventListener("click",function(){d(b)},!0);1>=n.childElementCount?n.appendChild(a):n.insertBefore(a,n.children[1]);return a}function l(b){var a=h.getBoundingClientRect();return[b.clientX- a.left,b.clientY-a.top]}var t=a.value||"#000",g=200,m=g/2,e=r.cloneNode(!0);e.style.width=g+"px";e.style.position=y(a)?"fixed":"absolute";var h=e.getElementsByTagName("canvas")[0],p=h.getContext("2d");h.width=g;h.height=m;var n=e.getElementsByClassName("canvascolor-history")[0];n.style.width=g+"px";n.style.maxHeight=m+"px";var q=f(t);q.style.border="1px solid white";q.style.a="5px";document.body.appendChild(e);a.addEventListener("mouseover",function(){var b=a.getBoundingClientRect(),c=b.top+b.height+ 3,b=b.left;"fixed"!==e.style.position&&(c+=window.scrollY,b+=window.scrollX);e.style.top=c+"px";e.style.left=b+"px";e.style.display="block"},!0);e.addEventListener("mouseleave",function(){e.style.display="none"},!1);a.addEventListener("keyup",function(){d(a.value,!0)},!0);d(a.value,!0);var s=p.createImageData(g,m);(function(){for(var b=0;b<g;b++)for(var a=0;a<m;a++){var c=4*(b+a*g),d=k([b,a]);s.data[c]=d[0];s.data[c+1]=d[1];s.data[c+2]=d[2];s.data[c+3]=255}p.putImageData(s,0,0)})();h.addEventListener("mousemove", function(a){a=l(a);q.style.backgroundColor=c(k(a))},!0);h.addEventListener("click",function(a){a=l(a);a=c(k(a));f(a);d(a)},!0);h.addEventListener("mouseleave",function(){q.style.backgroundColor=t},!0)}(function(){var a=document.createElement("style");a.innerHTML=".canvascolor-container{background-color:black;border-radius:5px;overflow:hidden;width:179px;padding:2px;display:none;}.canvascolor-container canvas{cursor:crosshair;}.canvascolor-history{overflow:auto;}.canvascolor-history > div{margin:2px;display:inline-block;}"; document.head.appendChild(a)})();var r;(function(){r=document.createElement("div");r.className="canvascolor-container";var a=document.createElement("canvas"),c=document.createElement("div");c.className="canvascolor-history";r.appendChild(a);r.appendChild(c)})();for(var w=document.querySelectorAll("input.canvascolor, input[type=color]"),p=0;p<w.length;p++){var u=w.item(p);"color"===u.type&&-1===u.className.split(" ").indexOf("canvascolor")||v(u)}return v})();
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"collaborative",
|
||||
"whiteboard"
|
||||
],
|
||||
"version": "0.2.1-14",
|
||||
"version": "0.2.1-17",
|
||||
"dependencies": {
|
||||
"node-static": "0.7.x",
|
||||
"socket.io": "0.9.x"
|
||||
|
|
Loading…
Reference in a new issue