AliMD / 1Tuts

:+1: Web Design Technology Tutorials
http://ali.md/tuts
62 stars 41 forks source link

C14 W3 S8 #644

Closed hbehkamal closed 10 years ago

hbehkamal commented 10 years ago

Khafan ClassWork

  1. register in firebase.com
  2. get your unique url like me: https://shining-fire-1234.firebaseio.com/
  3. check firebase.com/tutorial/

    Sample in our design pattern

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <title>Ali.MD Tutorial</title>
  <meta name="description" content="An AliMD Web Technologies Tutorial" />
  <meta name="author" content="Ali Mihandoost" />
  <script src='https://cdn.firebase.com/v0/firebase.js'></script>
</head>
<body>
  <div class="container">
    <div id="chats"></div>
    <input id="esm" type="text" size="10" placeholder="Name" value="Ali.MD">
    <input id="msg" type="text" size="35" placeholder="Message">
  </div>
</body>
</html>
*{
  padding: 0;
  margin: 0;
}

body{
  background-color: #eee;
}

.container{
  width: 400px;
  margin: 40px auto 0;
}

#chats{
  width: 400px;
  height: 300px;
  border: 1px solid gray;
  background-color: #fff;
  overflow: auto;
}

Note: Replace yoururl

(function(){
  var
  chatDB = new Firebase("https://yoururl/chat"),
  msgKeyDown = function(evt){
    if(evt.keyCode === 13){
      chatDB.push({name: esm.value, text: msg.value});
      msg.value='';
    }
  },
  newchat = function(evt){
    var myval = evt.val();
    chats.innerHTML += '<b>'+myval.name+' : </b>'+myval.text+'<br/>';
  },
  setEvents = function(){
    msg.onkeydown = msgKeyDown;
    chatDB.on("child_added", newchat);
  },
  init = function(){
    setEvents();
  };

  init();
})();
akbarzadeamin commented 10 years ago

یه چیز جالب. این الآن چرا این جوری میشه. من که هنوز برای چوز۱ چیزی ننوشتم :laughing: http://jsbin.com/osEsaVAN/1/edit

akbarzadeamin commented 10 years ago

soal:

agar bekham too java rotate bedam bayad che joori benvisam. intoori ke neveshtam kar nemikone: divclass.item(rand(1, divclass.length)).style.transform= "rotate("+45+"deg)";

akbarzadeamin commented 10 years ago

خودم فهمیدم: divclass.item(rand(1, divclass.length)).style.webkitTransform= "rotate(45deg)"; ‍‍‍ کس نخارد پشت من جز ناخن انگشت من

akbarzadeamin commented 10 years ago

soal:

chera to mesal zir, div ha 2 bare rotate nemishan. faghat 1 bar mishan. magar dastoore choose2, har 100 ms ejra nemishe? pas bayad 2bare rotate beshe http://jsbin.com/UkenofI/7/edit

akbarzadeamin commented 10 years ago

soal mohem:

chera to mesal zir, background hich vaght ghermez nemishe? eshkal az chie? chetor pas divha, coloreshoon ghermez mishe amma nobat be bgcolor ke mirese aslan too un mayeha nemiad. hatta naranji ham nemishe. dar zemn soalate ghabli ro khodam javabesho fahmidam. nemikhad javab bedin http://jsbin.com/isikerO/1/edit

akbarzadeamin commented 10 years ago

home work: http://jsbin.com/isikerO/4/edit

hbehkamal commented 10 years ago

The Falling Balls Game

with lot's of problem :D :))

hbehkamal commented 10 years ago

Next : C14 W3 S9