-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.coffee
63 lines (52 loc) · 1.47 KB
/
main.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
---
window.l = (x...) ->
console.log x
window.loren_alt = off
window.joint_alt = off
window.sidney_alt = off
animate_ideas = ->
return unless window.location.pathname in ["/index.html", "/"]
ideas = $('#ideas > li')
ul = $('#ideas')
ideas_top = $(ideas[0]).position().top
idea_i = 0
delta = 0
interval = setInterval ->
idea_i = (idea_i + 1) %% ideas.length
if idea_i is 0
delta = 0
else
next_top = $(ideas[idea_i]).position().top
delta += next_top - ideas_top
ul.animate
scrollTop: delta
, 1500
, 5000
ul.on 'mousedown mousewheel touchstart', ->
clearInterval interval
document.addEventListener "DOMContentLoaded", (event) ->
# emojify.setConfig({"only_crawl_id": "landing"});
# emojify.run();
if window.location.pathname in ["/index.html", "/"]
names = ['loren','sidney']
for name in names
do (name) ->
# l 'for', name
img = $('#' + name)
img.mouseenter ->
img.attr('src', "/images/" + name + "_alt.gif")
.mouseleave ->
img.attr('src', "/images/" + name + ".jpg")
img.click ->
# l 'click', name
alt = name + '_alt'
if window[alt]
img.attr('src', "/images/" + name + ".jpg")
else
img.attr('src', "/images/" + name + "_alt.gif")
window[alt] = not window[alt]
for n in names
if n isnt name
window["#{n}_alt"] = false
# animate_ideas()