Showing posts with label Web. Show all posts
Showing posts with label Web. Show all posts

June 29, 2015

CSS3 Animations

Do you remember the hell to do something like this just few years ago? :) - http://jsfiddle.net/ondrejd/22Lczf3d/

1
2
3
<div class="snackbar">
 <p>New URL saved</p>
</div>

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
div.snackbar {
 animation-duration: 0.5s;
 animation-name: snackbarSlideIn;
 background-color: #323232;
 border-radius: 2px 2px 2px 2px;
 bottom: 10px;
 color: #FFFFFF;
 height: 48px;
 min-width: 288px;
 max-width: 568px;
 padding: 0 24px 0 24px;
 position: fixed;
 right: 10px;
}

June 21, 2015

GitBook

I don't know if you hear about GitBook - web solution for digital writing and publishing. I already heard about it but never got time to explore it and that was definitively a mistake.

See for yourself - here is some links to books you can find there:


If you're interested in writing your own book there is also pretty application that helps you with it: GitBook Editor.

June 26, 2014

DOM Insertion Test

While I worked on some task that includes inserting of many HTML elements into the document I was wandering what the fastest method is. I tried (basically) three methods:


The fastest method is the last and the slowest is the first method. But sometimes is better use safe DOM approach so in this cases is the best using of the second method.

Some advices

  1. Make HTML you are inserting as simple as is possible - each attribute counts!
  2. If you create many elements and want event handlers attached to them don`t do it for each one element but attach one event handler to the parent element and then inside the handler self determine what the target element is.
  3. Insert large amount of new elements in portions not in once. The advantage is that user always see that something is happening, the disadvantage is that it is little slower than do it at once.

Below is jsFiddle with the testing document (http://jsfiddle.net/ondrejd/kLw52/):

March 10, 2014

Mozilla Brick - UI Components for Modern Web Apps

I just discovered Mozilla Brick - a bundle of reusable UI components for rapid development of cross-browser and mobile-friendly HTML5 applications. What is interesting is made using X-Tag which JavaScript library that provide the same as old and powerful XBL.
Hopefully I will get opportunity to try it on same real project soon.

February 20, 2014

Simple Carousel

I was working on one web when I needed simple carousel - I have simple requirements:
  • based on jQuery (since I'm using it on that site)
  • really, really small footprint
  • allow multiple carousels on one page
I spent some time with searching but I found nothing what I like so I made mine. The code is really simple and works just fine - you can see for yourself on jsFiddle.

If you want you can download it: