Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Fluidbox for images #75

Open
alanorth opened this issue Sep 6, 2014 · 11 comments
Open

Implement Fluidbox for images #75

alanorth opened this issue Sep 6, 2014 · 11 comments
Assignees

Comments

@alanorth
Copy link
Contributor

alanorth commented Sep 6, 2014

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

@ooduor ooduor self-assigned this Dec 11, 2014
ooduor added a commit to ooduor/nairobilug.or.ke that referenced this issue Jan 30, 2015
Requires latest pelican-alchemy submodule to function
@alanorth
Copy link
Contributor Author

alanorth commented Feb 3, 2015

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.

@ooduor
Copy link
Contributor

ooduor commented Feb 3, 2015

@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 nairobilug/pelican-alchemy@688fc0f in the page all works well.

@alanorth
Copy link
Contributor Author

alanorth commented Feb 3, 2015

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

@ooduor
Copy link
Contributor

ooduor commented Feb 3, 2015

@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
Copy link
Contributor

ooduor commented Feb 3, 2015

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

@molo-rnrah
Copy link

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
#75 (comment)
.

Name: Erustus Omolo
Tel:
Web:

@alanorth
Copy link
Contributor Author

alanorth commented Feb 9, 2015

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.

@rwanyoike
Copy link
Contributor

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").

@alanorth
Copy link
Contributor Author

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
#75 (comment)
.

@ooduor
Copy link
Contributor

ooduor commented Feb 10, 2015

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

@rwanyoike
Copy link
Contributor

rwanyoike commented Dec 2, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants