Jump to content

diogo

Moderators
  • Posts

    4,296
  • Joined

  • Last visited

  • Days Won

    79

Everything posted by diogo

  1. diogo

    Dancing Bear Music

    No messing var scrollTo = $(window).height() - 250; // eyeball this number $('html, body').animate({ scrollTop: ($playerdiv.offset().top - scrollTo) },500);
  2. diogo

    Dancing Bear Music

    Hm, not that easy to calculate the exact place because the player is closed before the animation starts, and we would need it's height to subtract to the browser window height. All we can do is hardcode the approximate height of the player. I prepared a small example: What you have: http://codepen.io/diogo-ed/pen/HJaxn How I think it should be: http://codepen.io/diogo-ed/pen/jbueD
  3. diogo

    Dancing Bear Music

    I get it, you are bringing the player above the fold while it opens. Maybe you can take the bottom of the player and the bottom of the window as the reference for the automatic scrolling. I think if you fine tune what you're doing now it will end up working well.
  4. Maybe like this? http://www.tehplayground.com/#PF1X9PHPL
  5. But will you need all those pages? People are not going to press "next" 10k times And even if they do (they won't) you can always increase the start for each next page https://processwire.com/api/selectors/#start
  6. diogo

    Dancing Bear Music

    Use a media query and change the width in the stylesheet.
  7. If there isn't any random behaviour involved, you can simply pass the used selector string to $session, and reuse in in another find. Don't worry about reruning the query, but make sure you use limit.
  8. diogo

    Dancing Bear Music

    It's such a small image, I would serve the large version to everyone.
  9. http://www.tehplayground.com/#91kqu1Uyz It works, but doesn't make much sense
  10. diogo

    Dancing Bear Music

    Looks great Joss! I noticed some things you can improve: The mouth appears later than everything else. On the home page, when the first player is open and I click to open the second, the movement doesn't feel natural because it's not obvious that the first player closes before the second opens happening—on a 13" laptop all i see is the site going up and down. I think there isn't the need to close the open player to open the other and would just leave it open, but if you want to close it, try doing it at the same time, it will be smoother. The "eject" buttons is a link and ruins all the experience by sending me to #. There are 3 possible fixes that I can remember: 1. remove the href from the link (faster but dirty) 2. stop the event with jquery by adding "return: false" or "event.preventDefault()" inside the click (ok to do) 3. replace the <a> tag by a <button> tag and correct the styling to match what you have (more work but also more correct) EDIT: ah! also, when I clicked the first "listen now" on my small laptop, I didn't notice that something had changed under the fold. Only after scrolling down I noticed it.
  11. If it's a one image problem, give the image a transparent margin in an image editing software.
  12. I think it makes sense to keep the direct output, since more advanced developers will most probably start with a blank state anyway.
  13. Nico, I like your implementation very much! Strangely, the areas don't collapse when I go there through the links, but they do if I go directly through the menu. Is it supposed to be like that?
  14. Just don't forget that "0" != 0 and "0" != FALSE because it's a string. A string is always TRUE
  15. Ok, it's more clear now. But consider what I said before. I would avoid duplication as much as possible by using the page fieldtype. You can keep those fields in the user template, or move them to new page template, while keeping the User page connected to the new page.
  16. The code goes in the template file. I'm still not sure I understand what you want to do, but I get the feeling that there is some confusion going on. What I'm interpreting from your question, you want to copy one of the fields that is in a User page, or even in all Users pages (You mean the default users pages in the system, right?) to a field in another page. You could do that, and as onjegolders showed to you, it's not difficult. But you would create an unnecessary duplication of data. Unnecessary because you can use the original data when needed. To get that data, you only need t know how to access the user page and get the required field. To get the current user (the user that is viewing the website), do as i said before $user->nameOfField. To another specific user use find() or get() with the $users object http://cheatsheet.processwire.com/#users. If you want to create pages that are directly connected to a user, create a page field to refer to that user http://wiki.processwire.com/index.php/Page_Field. Like this you will have access to all the actual info of that user, instead of a copy of the content of one their fields.
  17. Thats not how you call the user. Try this: $user->nameOfField
  18. http://www.tinyprocesshouse.com/posts/why-processhouse/
  19. Great site Nico! I have some some trouble with the scroll inside the content areas (about/contact), but love the rest.
  20. Sérgio, you got me curious
  21. No one noticed that I forgot to save the field in my code Added it already
  22. Hm, not that cool, my free trial will expire in 3 days The demo is here: $.get( "http://rhodium-4zp.lightningpw.com/test/", // <- there, see? sorted, function( data ) { $( "#result" ).html( data ); }); }
  23. changing the order of a page field is as easy as pushing the elements one at a time: I prepared an example on codepen using jqueryUI "sortable widget" with the "serialize" option and get http://codepen.io/diogo-ed/pen/fgazd On the pen I followed the instructions from the serialize method and used the ids of the pages after the underscore on the ID "page_123" http://api.jqueryui.com/sortable/#method-serialize The code in PW is really simple: foreach($input->get->page as $g){ //iterate all the page[] array from GET $p = $pages->get($g); // look for the page with this ID echo "<li>".$p->id."</li>"; $page->of(false); // set output formatting of $page->page_field->push($p); // push it to the end of the field $page->save("page_field"); // save page } EDIT: I'm using lightning.pw for the ajax call in the demo EDIT2: Like kongondo says, you need to sanitize the get calls. Take this only as a prof of concept. EDIT3: Added the output formatting of and save the field (forgot before)
×
×
  • Create New...