nairobilug.or.ke icon indicating copy to clipboard operation
nairobilug.or.ke copied to clipboard

Implement Fluidbox for images

Open alanorth opened this issue 10 years ago • 11 comments

See Fluidbox... https://terrymun.github.io/Fluidbox/

alanorth avatar Sep 06 '14 17:09 alanorth

I just tried it and it doesn't really work. In Chrome it almost works, but the fluidbox zooms and the image is huge. In Firefox the image is just huge even before you click it.

Also, you're modifying style.css, which comes from Bootstrap, so this will get overwritten the next time we update Bootstrap. We need a modular way to include this... I think SASS or LESS or whatever can do this...

Edit: Hmm, it might have been my browser's mixed-content blocking that made the script not work well. Lemme try again later. Edit 2: Nope, definitely doesn't work.

alanorth avatar Feb 03 '15 09:02 alanorth

@alanorth The issue of zoom out before you click means the fluidbox CSS and isn't loaded. I checked those in alchemy repo. basically after checkout, pelican content should add them. You could confirm that you have those by looking at the page source also. I saw that as well before I realized the alchemy was a different repo and that's where to checkin the assets. If you have these files https://github.com/nairobilug/pelican-alchemy/commit/688fc0fbae097c34298dd4b56332750eec25aeae in the page all works well.

ooduor avatar Feb 03 '15 13:02 ooduor

The javascript and css is loaded. Here's how it looks before and after clicking in Chrome 40 in Linux:

selection_064

Note the copious whitespace below the image.

selection_065

alanorth avatar Feb 03 '15 14:02 alanorth

@alanorth I see. Styles necessary for this to work

    <link rel="stylesheet" href="http://localhost:8000/theme/css/fluidbox.css" media="all" type="text/css" />
    <link rel="stylesheet" href="http://localhost:8000/theme/css/style.css">

The second one I appended extra fluid box styling. That's most likely the one not updated in this case.

Footer should have this

  <script src="http://localhost:8000/theme/js/bootstrap.min.js"></script>
  <script src="http://localhost:8000/theme/js/jquery.fluidbox.min.js"></script>
  <script>
        $('.full-post a[data-fluidbox]').fluidbox();
        // Trigger recomputing on Flexbox items, sometimes buggy width calculations due to browser recomputation of flex items
        $('.cols').each(function() {
            var a = [],
                $f = $(this).find('a.fluidbox');

            $f.find('img').each(function() {
                var i = $.Deferred();
                $(this).load(i.resolve).error(i.resolve);
                a.push(i);
            });

            $.when.apply(null, a).done(function() {
                $f.trigger('recompute');
            });
        });
  </script>

This is how it should look before and after: screenshot from 2015-02-03 17 10 10

screenshot from 2015-02-03 17 10 14

ooduor avatar Feb 03 '15 14:02 ooduor

A better way to know the CSS has loaded. When you mouse-over on the image, the mouse should toggle to zoom-out icon.

ooduor avatar Feb 03 '15 14:02 ooduor

Hello, interesting stuff, continue sending these messages I get them. I am in North Texas near Dallas and i'm using a Lenovo notebook.

On Tue, Feb 3, 2015 at 8:17 AM, Anthony Oduor [email protected] wrote:

A better way to know the CSS has loaded. When you mouse-over on the image, the mouse should toggle to zoom-out icon.

— Reply to this email directly or view it on GitHub https://github.com/nairobilug/nairobilug.or.ke/issues/75#issuecomment-72657132 .

Name: Erustus Omolo Tel: Web:

molo-rnrah avatar Feb 04 '15 18:02 molo-rnrah

Ok, I just had another look at this and found out that you hadn't included fluidbox.css in the base.html template.

Once I included it, I got a bunch of errors in the Chrome console like this:

GET http://localhost:8000/theme/css/fluidbox.css.map 404 (File not found)

And in Firefox the image starts out as full resolution on page load.

alanorth avatar Feb 09 '15 15:02 alanorth

You can ignore the .map ref, css preprocessors (less,sass,stylus) use those files to tell the browser how to map compiled css to preprocessor css. You can turn it off in the chrome dev tools ("Enable CSS source maps").

rwanyoike avatar Feb 09 '15 20:02 rwanyoike

Ok, so the error is non-fatal, but the code still doesn't work (and the .css isn't included). :)

On Mon Feb 09 2015 at 11:53:12 PM raymondwanyoike [email protected] wrote:

You can ignore the .map ref, css preprocessors (less,sass,stylus) use those files to tell the browser how to map compiled rule to processor rules. You can turn it off in the chrome dev tools ("Enable CSS source maps").

Reply to this email directly or view it on GitHub https://github.com/nairobilug/nairobilug.or.ke/issues/75#issuecomment-73587779 .

alanorth avatar Feb 10 '15 06:02 alanorth

@alanorth @raymondwanyoike will update/fix this later today...

ooduor avatar Feb 10 '15 08:02 ooduor

Talk to me @highPriestLOL :), what's the status here

rwanyoike avatar Dec 02 '16 15:12 rwanyoike