Index: trunk/mockups/athena/athena.css |
— | — | @@ -51,6 +51,12 @@ |
52 | 52 | bottom: 0; |
53 | 53 | } |
54 | 54 | |
| 55 | +#bottom-bar.inplace { |
| 56 | + position: relative; |
| 57 | + top: inherit; |
| 58 | +} |
| 59 | + |
| 60 | + |
55 | 61 | .bar .detail { |
56 | 62 | background-color: gray; |
57 | 63 | } |
Index: trunk/mockups/athena/index.html |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | |
14 | 14 | <body> |
15 | 15 | |
16 | | -<div class="bar-wrapper"> |
| 16 | +<div id="top" class="bar-wrapper"> |
17 | 17 | <div id="top-bar" class="bar"> |
18 | 18 | <button class="button-main">Main</button> |
19 | 19 | <span class="search-box" class="stretch"> |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | |
28 | 28 | <div id="page-content"></div> |
29 | 29 | |
30 | | -<div class="bar-wrapper"> |
| 30 | +<div id="bottom" class="bar-wrapper"> |
31 | 31 | <div id="bottom-bar" class="bar"> |
32 | 32 | <button class="button-article">Article</button> |
33 | 33 | <span class="detail stretch"> |
— | — | @@ -36,34 +36,34 @@ |
37 | 37 | <button class="button-discuss">Discuss</button> |
38 | 38 | <button class="button-language">Language</button> |
39 | 39 | </div> |
40 | | - <div class="footer"> |
41 | | - <div> |
42 | | - <span class="search-box" class="stretch"> |
43 | | - <input class="search" placeholder="Search Wikipedia"> |
44 | | - </span> |
45 | | - </div> |
46 | | - <div> |
47 | | - <a href="#recentchanges">Recent Changes</a> - |
48 | | - <a href="#special">Special Pages</a> - |
49 | | - <a href="#random">Random Article</a> - |
50 | | - <a href="#donate">Donate to Wikipedia</a> |
51 | | - </div> |
52 | | - <div> |
53 | | - <a href="#about">About Wikipedia</a> - |
54 | | - <a href="#contact">Contact Wikipedia</a> - |
55 | | - <a href="#privacy">Privacy policy</a> - |
56 | | - <a href="#disclaimers">Disclaiimers</a> |
57 | | - </div> |
58 | | - <div> |
59 | | - Text is available under the <a href="#cc">Creative Commons Attribution-ShareAlike License</a>, additional terms may apply. |
60 | | - See <a href="#terms">Terms of Use</a> for details. |
61 | | - Wikipedia is a registered trademark of the <a href="#wmf">Wikimedia Foundation, Inc.</a>, a non-profit organization. |
62 | | - </div> |
63 | | - <div class="poweredby-logos"> |
64 | | - <img src="https://bits.wikimedia.org/images/wikimedia-button.png"> |
65 | | - <img src="https://bits.wikimedia.org/skins-1.18/common/images/poweredby_mediawiki_88x31.png"> |
66 | | - </div> |
| 40 | +</div> |
| 41 | +<div id="footer" class="footer"> |
| 42 | + <div> |
| 43 | + <span class="search-box" class="stretch"> |
| 44 | + <input class="search" placeholder="Search Wikipedia"> |
| 45 | + </span> |
67 | 46 | </div> |
| 47 | + <div> |
| 48 | + <a href="#recentchanges">Recent Changes</a> - |
| 49 | + <a href="#special">Special Pages</a> - |
| 50 | + <a href="#random">Random Article</a> - |
| 51 | + <a href="#donate">Donate to Wikipedia</a> |
| 52 | + </div> |
| 53 | + <div> |
| 54 | + <a href="#about">About Wikipedia</a> - |
| 55 | + <a href="#contact">Contact Wikipedia</a> - |
| 56 | + <a href="#privacy">Privacy policy</a> - |
| 57 | + <a href="#disclaimers">Disclaiimers</a> |
| 58 | + </div> |
| 59 | + <div> |
| 60 | + Text is available under the <a href="#cc">Creative Commons Attribution-ShareAlike License</a>, additional terms may apply. |
| 61 | + See <a href="#terms">Terms of Use</a> for details. |
| 62 | + Wikipedia is a registered trademark of the <a href="#wmf">Wikimedia Foundation, Inc.</a>, a non-profit organization. |
| 63 | + </div> |
| 64 | + <div class="poweredby-logos"> |
| 65 | + <img src="https://bits.wikimedia.org/images/wikimedia-button.png"> |
| 66 | + <img src="https://bits.wikimedia.org/skins-1.18/common/images/poweredby_mediawiki_88x31.png"> |
| 67 | + </div> |
68 | 68 | </div> |
69 | 69 | |
70 | 70 | </body> |
Index: trunk/mockups/athena/athena.js |
— | — | @@ -111,6 +111,29 @@ |
112 | 112 | var app = { |
113 | 113 | init: function() { |
114 | 114 | embed.init(); |
| 115 | + |
| 116 | + $('.button-main').click(function() { |
| 117 | + // temp hack |
| 118 | + // toggle the floating state |
| 119 | + $('.bar').toggleClass('bar-float'); |
| 120 | + }); |
| 121 | + |
| 122 | + // Fancy footwork to rebind a position-fixed footer bar when scrolling to bottom |
| 123 | + $(window).bind('scroll', function() { |
| 124 | + var viewportTop = $(document).scrollTop(), |
| 125 | + windowHeight = $(window).height(), |
| 126 | + viewportBottom = viewportTop + windowHeight, |
| 127 | + barHeight = $('#bottom-bar').height(), |
| 128 | + barTop = $('#bottom').position().top; |
| 129 | + |
| 130 | + if (viewportBottom - barHeight >= barTop) { |
| 131 | + console.log('should unfix'); |
| 132 | + $('#bottom-bar').addClass('inplace'); |
| 133 | + } else { |
| 134 | + $('#bottom-bar').removeClass('inplace'); |
| 135 | + } |
| 136 | + }); |
| 137 | + |
115 | 138 | app.loadPage('While My Guitar Gently Weeps'); |
116 | 139 | }, |
117 | 140 | |