4 <%inherit file="_templates/i3.mako" />
27 <div class="video clearfix">
28 <img src="http://i1.ytimg.com/vi/pKfP7Ws-CN8/default.jpg" width="240" style="float: left">
29 <div style="float: left; padding-top: 0.25em">
30 <strong>Screencast of v3.δ</strong>
32 This video shows the basic features of i3:
35 <li>Different layouts</li>
47 To get a quick impression of i3, have a look at these screenshots.
50 <div class="screenshots clearfix">
52 <a href="/screenshots/i3-1.png"><img src="/screenshots/i3-1.thumb.png" width="240" border="0"></a><br>
53 <span>Vimperator, VIM, MPlayer, dzen2</span>
57 <a href="/screenshots/i3-2.png"><img src="/screenshots/i3-2.thumb.png" width="240" border="0"></a><br>
58 <span>Vimperator, VIM, xpdf, bc</span>
62 <a href="/screenshots/i3-3.png"><img src="/screenshots/i3-3.thumb.png" width="240" border="0"></a><br>
63 <span>PCManFM, ROXTerm, evince</span>
69 <a href="/screenshots/i3-4.png"><img src="/screenshots/i3-4.thumb.png" width="240" border="0"></a><br>
70 <span>i3 logo out of terminals</span>
74 <a href="/screenshots/i3-6.png"><img src="/screenshots/i3-6.thumb.png" width="240" border="0"></a><br>
75 <span>VIM, zsh, i3status (FreeBSD)</span>
79 <a href="/screenshots/i3-7.png"><img src="/screenshots/i3-7.thumb.png" width="240" border="0"></a><br>
80 <span>GIMP, urxvt (both floating)</span>
86 <a href="/screenshots/i3-5.png"><img src="/screenshots/i3-5.thumb.png" width="240" border="0"></a><br>
87 <span>mc, xosview, MPlayer, irssi, gajim</span>
91 <a href="/screenshots/i3-8.jpg"><img src="/screenshots/i3-8.thumb.jpg" width="240" border="0"></a><br>
92 <span>git, synergy, htop, urxvt</span>
99 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js">
101 <script type="text/javascript" src="/js/jquery.mousewheel.js">
103 <script type="text/javascript" src="/js/jquery.ba-hashchange.js">
105 <script type="text/javascript">
106 $(document).ready(function() {
107 $('.shot span').css('color', '#888');
109 $('.shot').mouseover(function() {
110 $(this).children('span').css('color', 'white');
113 $('.shot').mouseout(function() {
114 $(this).children('span').css('color', '#888');
117 // build an array of all images (full URLs)
120 $('.shot a').each(function(idx, element) {
121 images[cnt++] = $(element).attr('href');
124 // handlers for mousewheel scrolling
125 // defined here because we need to enable it after the animation finished
126 $(window).mousewheel(function(event, delta) {
127 // if we are not in the slideshow mode, process the event as normal
128 return (!$('#mask').is(':visible'));
131 var wheelhandler = function(event, delta) {
132 //console.log('event = ' + event + ', delta = ' + delta);
134 // if we are not in the slideshow mode, process the event as normal
135 if (!$('#mask').is(':visible')) {
143 } else if (delta > 0) {
150 $(window).mousewheel(wheelhandler);
152 var loadimage = function(url, direction, fromhash) {
153 // now load the image
154 var img = new Image();
157 var loadcomplete = function() {
158 var winW = $(window).width();
159 var winH = $(window).height();
160 var max_w = winW - (2 * 64);
161 var max_h = winH - 64;
165 'width': (img.width > max_w ? max_w : img.width),
168 dims.height = (dims.width / img.width) * img.height;
169 if (dims.height > max_h) {
171 dims.width = (dims.height / img.height) * img.width;
173 dims.top = (winH - dims.height) / 2;
174 dims.left = ((max_w - dims.width) / 2) + 64;
175 $('#loading').hide();
176 var element = $('<img>');
177 element.attr({ 'src': url, 'width':dims.width });
178 element.css({ 'position': 'absolute', 'top':dims.top + 'px', 'left':dims.left + 'px' });
179 if (direction !== undefined) {
180 // slide from right to left
181 if (direction === 'left') {
182 element.css({ 'left':winW + 'px' });
183 element.animate({ 'left': '-=' + (winW - dims.left) }, 'fast', function() {
184 $(window).mousewheel(wheelhandler);
187 element.css({ 'left':'-' + winW + 'px' });
188 element.animate({ 'left': '+=' + (winW + dims.left) }, 'fast', function() {
189 $(window).mousewheel(wheelhandler);
193 $('#maskinner').append(element);
194 $('#maskinner').show();
198 if (!fromhash && window.history.pushState) {
199 window.history.pushState(undefined, 'i3 screenshot: ' + url, "#" + url);
204 //console.log('image already in cache');
207 //console.log('loading image');
208 img.onload = loadcomplete;
212 // clicking anywhere outside the image will bring you back to the page
213 var masks = $('#mask, #bigimg');
215 var endshow = function() {
217 $('#maskinner img').remove();
219 if (window.history.pushState) {
220 window.history.pushState(undefined, 'i3 screenshots', '#');
224 masks.click(function() {
228 $('.shot img').click(function() {
229 var winH = $(window).height();
230 var maskHeight = $(document).height();
231 var maskWidth = $(window).width();
233 var full = $(this).parent().attr('href');
234 var mask = $('#mask');
235 mask.css({ 'width': maskWidth, 'height': maskHeight }).show();
237 var loading = $('#loading');
240 loadimage(full, undefined, false);
242 // TODO: also preload the next image?
244 // don't follow the link
248 var imgright = function() {
249 var idx = $.inArray($('#maskinner img').attr('src'), images);
250 var next = images[idx+1];
252 if (next === undefined) {
253 //console.log('there is no next image');
257 //console.log('loading next one: ' + next);
258 // slide out the current image
259 var winW = $(window).width();
260 $('#maskinner img').animate({ 'left': '-=' + (winW - 64) }, 'fast', function() {
263 loadimage(next, 'left', false);
265 // disable mousewheel handler during load (will be re-enabled after the animation)
266 $(window).unmousewheel(wheelhandler);
270 $('#imgright').click(imgright);
272 var imgleft = function() {
273 var idx = $.inArray($('#maskinner img').attr('src'), images);
274 var prev = images[idx-1];
276 if (prev === undefined) {
277 //console.log('there is no next image');
281 //console.log('loading prev one: ' + prev);
282 // slide out the current image
283 var winW = $(window).width();
284 $('#maskinner img').animate({ 'left': '+=' + winW }, 'fast', function() {
287 loadimage(prev, 'right', false);
289 // disable mousewheel handler during load (will be re-enabled after the animation)
290 $(window).unmousewheel(wheelhandler);
294 $('#imgleft').click(imgleft);
296 // setup key press handlers for the left/right arrow keys
297 var keydown = function(e) {
314 if ($.browser.mozilla) {
315 $(document).keypress(keydown);
317 $(document).keydown(keydown);
320 if (location.hash.length > 0) {
321 var url = location.hash.substring(1);
322 loadimage(url, undefined, true);
325 $(window).hashchange(function() {
326 if (location.hash.length === 0) {
329 //console.log('hash has changed to ' + location.hash);
330 var url = location.hash.substring(1);
331 loadimage(url, undefined, true);