Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
drewlesueur committed Mar 28, 2011
1 parent 9b424f5 commit fc48560
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 78 deletions.
39 changes: 13 additions & 26 deletions index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@
@el.css
width: "#{@width}px"
height: "#{@height}px"
"background-color": "rgb(70,70,70)"
position: "absolute"
top: 0
overflow: "hidden"
Expand Down Expand Up @@ -334,8 +333,6 @@
@el = $('#home-wrapper')
@state = "home"
@thumbGroupings = []
$('#main-logo').click @triggerMainLogoClick

@thumbsView = new HorizontalSliderView @thumbsWidth, 640
$('#thumbs').append @thumbsView.el
@imageDisplayer = new ImageDisplayerView $('#viewer')
Expand All @@ -355,22 +352,8 @@
alert "Error while sending contact form"


triggerMainLogoClick: () =>
@trigger "homeclick"
setImage: (url) ->
@imageDisplayer.showImage url
clearNavLinks: () ->
@el.find("#links").empty()
addNavLink: (linkName, linkAddress='#', type) ->
a = $ "<a class='nav' href='#{linkAddress}'>#{linkName}</a>"
@el.find("#links").append a
if type is "normal"
return
a.bind "click", (event) =>
event.preventDefault();
@triggerLinkClick linkName
triggerLinkClick: (linkName) =>
@trigger "link", linkName
displayFirstImage: () =>
@thumbsView.currentPanelEl().find("img:first").click()

Expand Down Expand Up @@ -429,9 +412,15 @@





class HomeRoutes extends Backbone.Controller
routes:
"galleries/:gallery" : "gallery"
"home" : "home"

gallery: (galleryName) =>
app.handleLinkClick galleryName
home: () =>
app.handleHomeClick()

class HomePresenter
constructor: () ->
Expand All @@ -447,24 +436,23 @@
height: "43px"
opacity: "0.5"
@model.bind "change:galleries", @handleGalleriesChange
@view.bind "link", @handleLinkClick
@model.loadGalleries()
@view.bind "homeclick", () =>
handleHomeClick: () ->
@view.hideViewer()
@slideShow.show()
@slideShow.start()
@view.galleryState = ""
@view.slideThumbnails "in"
@view.slideBanner "up"

handleLinkClick: (linkName) =>
linkName = k.capitalize linkName
if @slideShow.hidden == false
@slideShow.hide()
@view.showViewer()
if linkName is @view.galleryState
return
@view.galleryState = linkName
@view.slideThumbnails "out"
@view.slideBanner "down"
gallery_name = "gallery_" + linkName.toLowerCase()
@view.thumbsView.goto @linkPanelMap[linkName]
@view.displayFirstImage()
Expand All @@ -475,12 +463,10 @@
for image in k.s @model.get("galleries").gallery_slideshow.images, 0
@slideShow.addPicture image
@slideShow.init()
@view.clearNavLinks()
@linkPanelMap = {}
galleryIndex = 0
for gallery, info of @model.get "galleries"
linkName = k.capitalize(k(gallery).s("gallery_".length))
@view.addNavLink linkName, "#"
imagePanel = new ImagePanelView
imagePanel.linkName = linkName
imagePanel.bind "click", (meta) =>
Expand All @@ -492,11 +478,12 @@
@view.thumbsView.addPanel imagePanel
@linkPanelMap[linkName] = galleryIndex
galleryIndex++
@view.addNavLink "Online Viewing", "http://troybrinkerhoff.com/onlineviewing/", "normal"
Backbone.history.start()


app = new HomePresenter
window.app = app
routes = new HomeRoutes



Expand Down
16 changes: 13 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,19 @@
<div id="banner">
<img id="banner-img" src="http://troybrinkerhoff.com/files/banner.png" usemap="#nav-map"/>
<map name="nav-map">
<area shape="rect" coords="0,0,331,35" id="main-logo"/>
<area shape="rect" coords="390,0,484,35" href="#" data-gallery="wedding"/>

<area shape="rect" coords="0,0,331,35" id="main-logo"
href="#home"/>
<area shape="rect" coords="390,0,484,35" href="#galleries/wedding" alt="wedding" data-gallery="wedding"/>
<area shape="rect" coords="485,0,561,35" href="#galleries/portrait" alt="portrait" />
<area shape="rect" coords="562,0,679,35" href="#galleries/commercial"
alt="commercial" />
<area shape="rect" coords="680,0,740,35"
href="http://troybrinkerhoff.com/blog" alt="blog" />
<area shape="rect" coords="741,0,820,35" href="#contact"
alt="contact" />
<area shape="rect" coords="821,0,958,35"
href="http://troybrinkerhoff.com/onlineviewing/"
alt="online viewing" />
</map>
<div id="links">
</div>
Expand Down
75 changes: 31 additions & 44 deletions index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions styles.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@siteWidth: 960px;
@bannerHeight: 35px;
@lightGray: rgb(196, 196, 196);

.arrow {
font-size: 100px;
Expand Down Expand Up @@ -29,11 +30,12 @@ a {
}
body {
font-family: 'CenturyGothicRegular';
background-color: rgb(196, 196, 196);
background-color: @lightGray;
height: 1200px;

}
#viewer {
margin-top: @bannerHeight;
.absolute;
}
#viewer-img {
Expand Down Expand Up @@ -62,7 +64,9 @@ body {
}



img a map area{
boder: none;
}

.shadowy {
-webkit-box-shadow: 0px 0px 5px #000;
Expand All @@ -74,7 +78,6 @@ body {
}

#main-logo {
color: rgb(70,70,70);
.absolute;
left: 10px;
font-size: 20px;
Expand All @@ -85,13 +88,14 @@ body {
height: 43px;
}
#thumbs {
background-color: @lightGray;
z-index: 990;
@width: 200px;
right: -1 * @width;
.absolute;
background-color: green;
height: 640px;
width: @width;

}
#home {

Expand All @@ -104,7 +108,6 @@ body {
#links a {
margin-right: 15px;
font-size: 20px;
color: rgb(100,100,100);
text-decoration: none;
}

Expand Down

0 comments on commit fc48560

Please sign in to comment.