Browse Source

svg centering, fonts

Maxim Sokhatsky 11 years ago
parent
commit
67c45e16c8

+ 13 - 12
apps/web/priv/static/doc/svg.js

@@ -234,6 +234,15 @@ loadFile('templates/Card.svg', function() {
         
         document.getElementById('Page-1').addEventListener("mousewheel", mouseWheelHandler, false);
         
+
+        
+        
+        
+        onRightMenuDown();
+
+    });
+});
+
         var clipPath1 = svg('<clipPath id="myClip1"><rect xmlns="http://www.w3.org/2000/svg" id="Clip-Path-Left" x="0" y="0" width="216" height="400"/></clipPath>');
         var clipPath2 = svg('<clipPath id="myClip2"><rect xmlns="http://www.w3.org/2000/svg" id="Clip-Path-Right" x="0" y="0" width="216" height="400"/></clipPath>');
         document.getElementsByTagName('defs').item(0).appendChild(clipPath1);
@@ -251,14 +260,6 @@ loadFile('templates/Card.svg', function() {
         document.getElementById('edit').setAttribute("contentEditable","true");
         document.getElementById('edit').onkeydown = chatEditor;
 
-        
-        
-        
-        onRightMenuDown();
-
-    }, "Refined");
-});
-
 
 var removeChilds = function (node) {
     var last;
@@ -363,7 +364,7 @@ function mouseWheelHandler(e) {
     var leftActive = leftFill == "skyblue";
     var rightActive = rightFill == "skyblue";
     if (!leftActive && !rightActive) return;
-    console.log(leftActive);
+//    console.log(leftActive);
 
     var evt = e;
     var scroll_dy = evt.detail ? evt.detail * scrollSensitivity : evt.wheelDelta * scrollSensitivity;
@@ -425,7 +426,7 @@ function onlineHoverOut(evt) { document.getElementById("Left-Bar").setAttribute(
 function onlineHoverColor(evt) {
     onlineHover(evt);
     var name = evt.target.getAttribute("xmlns:data");
-    if (null != name) document.getElementById(name).setAttribute("fill","#FFE0A5");
+    if (null != name) document.getElementById(name).setAttribute("fill","#FFF687");
 }
 function onlineHoverOutColor(evt) { 
     onlineHoverOut(evt);
@@ -457,8 +458,8 @@ function addOnlineUser(name,full_name,insertMode) {
             '<text xmlns:data="'+name+'" onmouseover="onlineHoverColor(evt);" onmouseout="onlineHoverOutColor(evt);" '+
             'font-family="Exo 2" font-size="18" font-weight="normal" line-spacing="18"'+
             ' fill="#3B5998">' + 
-                '<tspan xmlns:data="'+name+'" font-weight="bold" fill="green" x="19" y="22">'+full_name+'</tspan>' + 
-                '<tspan xmlns:data="'+name+'" x="19" y="40">Score: 1043 Pos: 13</tspan></text>'+
+                '<tspan xmlns:data="'+name+'" font-weight="normal" fill="green" x="19" y="22">'+full_name+'</tspan>' + 
+                '<tspan xmlns:data="'+name+'" font-size="14" x="19" y="40">Score: 1043 Pos: 13</tspan></text>'+
             '<rect onmouseover="onlineHover(evt);" onmouseout="onlineHoverOut(evt);"'+
             '  x="10" y="48" width="196" height="8"></rect></g>';
     var element = svg(html);

+ 3 - 1
apps/web/priv/static/doc/svg_clean.htm

@@ -8,9 +8,10 @@
 </head>
 <body  style="margin:0; padding:0; overflow:hidden;">
 
-<svg id="Refined" width="900px" style="position:fixed; top:0; left:0; height:100%; width:100%;">Placeholder for SVG Game Scene</svg>
+<svg id="Refined" width="100%" style="position:fixed; top:0; left:0; height:100%; width:100%;">Placeholder for SVG Game Scene</svg>
 
 <div class="controls" id="history" height=0 width=0>
+<p>
 <button class="controls" id="pluslogin" type="button" data-gapiattached="true">Login</button>
 <label class="controls"  id="gosterge"> Google</label></div>
 <label class="controls"  id="player1"> Albert Einstein </label><select  class="controls" id="h1"></select>
@@ -30,6 +31,7 @@
 <button class="controls"  id="have_8" type="button">8 Tashes</button>
 <button class="controls"  id="pause" type="button">Pause</button>
 <button class="controls"  id="info" type="button">PlayerInfo</button>
+</p>
 </div>
 
 <script src='kvs.js' type='text/javascript' charset='utf-8'></script>

+ 8 - 2
apps/web/priv/static/doc/synrc.css

@@ -3,7 +3,9 @@
     A:visited   { color: darkblue; }
     A:hover     { color: blue; }
     
-    .controls { display: none; visible: hidden; }
+    .controls { display: none; visibility:hidden; }
+    
+    svg { display: block; margin: auto; }
 
     SUP        { font-size:10pt; }
     BODY        { font-size:14pt; font-family: "Exo 2",Calibri, Lucida Sans, "Lucida Grande"; }
@@ -11,11 +13,15 @@
     H1          { font-size:30pt; color: blue; font-weight: bold; font-size:30pt; margin-top:20px; margin-bottom:10px; margin-right:6px; }
     H2          { font-size:20pt; color: darkblue; margin-top:20px; margin-bottom:10px; margin-right:6px; }
     H3          { font-size:18pt; margin-top:20px; margin-bottom:10px; margin-right:6px; } 
-    P           { font-size:14pt; margin-top: 0px; margin-bottom: 8px;  }
+    P           { display: none; visibility:hidden;font-size:14pt; margin-top: 0px; margin-bottom: 8px;  }
     H3 P        { font-size:16pt; margin-left: 70px; margin-top:20px; margin-bottom:10px; margin-right:6px; } 
     B           { font-size:14pt; background-color: lightblue; padding: 2px; }
     H2 B        { font-size:16pt; background-color: lightblue; padding: 5px; margin-top: 20px; margin-bottom: 20px;}
     LI          { font-size:14pt; }
+    button { display: none; visibility:hidden;}
+    label  { display: none; visibility:hidden;}
+    input  { display: none; visibility:hidden;}
+    select { display: none; visibility:hidden;}
 
  pre          { font-size:10pt; font-family: Lucida Console; }