Просмотр исходного кода

improve display on mobile. There is still much to do...

dev_h
Ophir LOJKINE 12 лет назад
Родитель
Сommit
aebd2ef973
3 измененных файлов: 43 добавлений и 13 удалений
  1. 41
    11
      client-data/board.css
  2. 1
    1
      client-data/js/canvascolor/canvascolor.min.js
  3. 1
    1
      package.json

+ 41
- 11
client-data/board.css Просмотреть файл

@@ -5,6 +5,7 @@ html, body, svg {
5 5
 
6 6
 #menu {
7 7
 	font-family:"Segoe UI","Roboto","Ubuntu";
8
+	font-size:4vh;
8 9
 	border-radius:0;
9 10
 	box-shadow: 0px 0px 9px black;
10 11
 	overflow:hidden;
@@ -13,8 +14,7 @@ html, body, svg {
13 14
 	top:0;
14 15
 	color:black;
15 16
 	background-color:rgba(0,100,255,0.9);
16
-	width:15%;
17
-	max-width:200px;
17
+	width:10vw;
18 18
 	height:100%;
19 19
 	transition-duration:1s;
20 20
 	cursor:default;
@@ -35,9 +35,9 @@ html, body, svg {
35 35
 }
36 36
 
37 37
 #menu h2{ /*Menu title ("Menu")*/
38
-	font-size:22px;
38
+	font-size:6vh;
39 39
 	font-family:monospace;
40
-	letter-spacing:5px;
40
+	letter-spacing:.5vw;
41 41
 	text-shadow: 0px 0px 9px white;
42 42
 	color:black;
43 43
 	word-wrap:break-word;
@@ -53,9 +53,7 @@ html, body, svg {
53 53
 #menu li {
54 54
 	text-overflow: ellipsis;
55 55
 	white-space: nowrap;
56
-	font-size:1.3em;
57 56
 	list-style-position:inside;
58
-	width:100%;
59 57
 	color:#335;
60 58
 	border:0;
61 59
 	text-decoration:none;
@@ -77,19 +75,51 @@ html, body, svg {
77 75
 }
78 76
 
79 77
 #menu .tool-icon {
80
-	padding:3px;
81
-	width:10px;
78
+	padding:1vh;
79
+	width:2vw;
82 80
 }
83 81
 #menu .tool-name {
84
-	margin-left: 20px;
82
+	margin-left: .5vw;
83
+	font-size:4vh;
84
+}
85
+
86
+@media (max-width: 1000px) {
87
+    #menu {
88
+        font-size:2.5vw;
89
+    }
90
+    #menu .tool-name {
91
+        display: none;
92
+    }
93
+    #menu .tool-icon {
94
+    	width:100%;
95
+    	font-size:5vw
96
+    }
97
+    #menu h2 {
98
+        white-space: nowrap;
99
+        font-size:3vw;
100
+    }
101
+    #menu h3 {
102
+        font-size:2.5vw;
103
+        margin-top:0;
104
+    }
105
+    #chooseColor {
106
+        width:100%;
107
+    }
108
+    #chooseSize {
109
+    	width:100%;
110
+    	padding:0;
111
+    	margin:0;
112
+    }
85 113
 }
86 114
 
115
+
87 116
 input {
88 117
 	font-size:16px;
89 118
 }
90 119
 
91 120
 #chooseColor {
92
-	width:5em;
121
+	width:5vw;
122
+	height:4vh;
93 123
 	border:1px solid black;
94 124
 	border-radius:3px;
95 125
 	color:black;
@@ -97,5 +127,5 @@ input {
97 127
 }
98 128
 
99 129
 #chooseSize {
100
-	width:100px;
130
+	width:5vw;
101 131
 }

+ 1
- 1
client-data/js/canvascolor/canvascolor.min.js Просмотреть файл

@@ -1,2 +1,2 @@
1 1
 //gist.github.com/lovasoa/8141243
2
-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})();
2
+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})();

+ 1
- 1
package.json Просмотреть файл

@@ -3,7 +3,7 @@
3 3
       "collaborative",
4 4
       "whiteboard"
5 5
    ],
6
-   "version": "0.2.1-14",
6
+   "version": "0.2.1-17",
7 7
    "dependencies": {
8 8
       "node-static": "0.7.x",
9 9
       "socket.io": "0.9.x"

Загрузка…
Отмена
Сохранить