cofeescript experiments 1

just some jamming around with divs

by Andy Bulka

HTML

hi there!!<br>
this is a <b>test</b>

<div>some div is here</div>

<div id="square">some div is here</div>
<div id="square"></div>
<div id="out"></div>

CSS

body {
    /* background-color: #000;
    color: #fff;
    text-shadow: 0 -1px 0 #000; */
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 1.8em;
    text-align: center;
}

div {
      height: 100px;
      width: 100px;
}
.border {
      border-width: 11px;
      border-color: black;
      border-style: solid
}

#square {
 width: 100px;
 height: 100px;
 background: #633;
 /*border-bottom: .31em solid #f00;    */
}
.d1 {
 background: #253;
 width: 200px;
 border-bottom: .1em solid #f00;
}

CoffeeScript

console.log("hi there")
#alert("hi")

class Animal
  constructor: (@name) ->
  
a = new Animal("cheetah")
#alert("Animal is a #{a.name}")

class Model
  constructor: () ->
    @things = [1,2,3,4]

m = new Model()
console.log("Model is a #{m} things is #{m.things}")
# $("#out").text = "hi"
   
divs = $ "div"
console.log(divs)   
divs = document.querySelectorAll("div")
console.log(divs)

#$('#out').html 'fred'
#$('#out').text 'freddy'
$('#out').append 'freddy'
$('#out').append ' was'
$('#out').append ' here'

$('#out').append """<div class='d1'>NEW </div>""" for num in [5..1]
   
console.log("zzzz")