Pavel 7 years ago
parent
commit
176a3a5748
2 changed files with 23 additions and 5 deletions
  1. 19 3
      js12/index.html
  2. 4 2
      js12/main.js

+ 19 - 3
js12/index.html

@@ -25,9 +25,10 @@
 		}
 		input[type="button"] {
 			background-color: #5a5491;
+			color: #fff;
 		}
 		body {
-			font-size: 25px;
+			font-size: 20px;
 			font-family: arial, sans-serif;
 			background-color: #6962A8;
 			margin: 0;
@@ -35,7 +36,8 @@
 			color: #2d2d2d;
 		}
 		body * {
-			box-sizing: border-box;
+			-webkit-box-sizing: border-box;
+			        box-sizing: border-box;
 			outline: none;
 		}
 		#result img {
@@ -51,6 +53,11 @@
 			border-top-left-radius: 20px;
 			border-top-right-radius: 20px;
 			padding: 15px;
+			padding-bottom: 5px;
+		}
+
+		.container input#input2 {
+			margin-bottom: 5px;
 		}
 
 		#result {
@@ -58,6 +65,7 @@
 			padding: 15px;
 			margin-bottom: 175px;
 			border-radius: 15px;
+			padding-bottom: 30px;
 		}
 		#result div {
 			background-color: #F9F9F9;
@@ -87,13 +95,21 @@
 			border-radius: 20px;
 			background-color: #fff;
 			width: 40%;
+			font-size: 15px;
+			padding: 10px;
+			box-shadow: inset 1px 1px 1px
+		}
+
+		.canvas select {
+			border-right: 15px;
+			font-size: 15px;
 		}
 		
 	</style>
 </head>
 <body>
 <div class="canvas">
-		<canvas id='canvas' width=400 height=400></canvas> 
+		<canvas id='canvas' width=500 height=400></canvas> 
         <!--<br/>-->
         <!--<button id='+'>+</button>-->
          <input type="button" value="undo" id="undo">

+ 4 - 2
js12/main.js

@@ -6,6 +6,7 @@ var emoji = document.querySelectorAll(".emoji-item");
 var canvasIcon = document.querySelector(".draw img");
 var canvasBar = document.querySelector(".canvas");
 var main = document.querySelector("main");
+debugger;
 for (var i = 0; i < emoji.length; i++) {
 	emoji[i].onclick = function(){
 		var xmlhttp = new XMLHttpRequest();  
@@ -91,9 +92,10 @@ setInterval(function(){
 					else if(typeof obj[i].message != "object" && obj[i].message && /(https?:\/\/.*\.(?:png|jpg))/i.test(obj[i].message)){ // obj[i].message.indexOf('.jpg') > -1
 						var img = document.createElement("img");
 						img.setAttribute("src",obj[i].message);
-						result.innerHTML += obj[i].nick + ": ";   
+						img.setAttribute("style","width: 600px");
+						result.innerHTML += "<div><span>" +  obj[i].nick + "</span><br>  ";   
 						result.appendChild(img);
-						result.innerHTML += '<br>';   
+						result.innerHTML += '</div><br>';   
 
 					}
 					else if(typeof obj[i].message != "object" && obj[i].message && obj[i].message.indexOf('.gif') > -1){