Animated sort buttons
Hover and Table Headers to see the effect
Hover and Table Headers to see the effect
.container
.container
table
thead
tr
th
| Name
.sort
th
| Position
.sort
th
| Office
.sort
script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery.min.js"
script src="//cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"
@import "nib"
@import "nib"
easeInOutSine = cubic-bezier(0.445, 0.050, 0.550, 0.950)
easeOutBack = cubic-bezier(0.250,-0.250, 0.750, 1.250)
sw = 2px
ss = 3px
fc = #411026
sc = fc + 80%
sh = fc + 30%
sa = fc + 10%
bc = fc + 70%
od = fc + 99%
ev = fc + 97%
ea = easeOutBack
du = .2s
.dataTables_filter
.dataTables_processing
.dataTables_length
.dataTables_info
.dataTables_paginate
display none !important
table
width 100%
box-shadow 0 2px 50px 0 rgba(#000, .5)
border 1px solid bc
border-radius 2px
th
font-weight 500
cursor pointer
position relative
border-right 1px solid bc
border-bottom 1px solid bc
box-shadow 0 1px 0 bc inset
line-height 30px
background linear-gradient(top, od, ev)
outline none
&:last-child
border-right none
.sort
right 10px
top 50%
width sw
height sw
background sc
border-radius 50%
transition box-shadow du ea, transform du ea
position absolute
transform translate((.5 * sw))
transform translate3d((.5 * sw), 0)
box-shadow 0 0 sc, 0 0 sc, 0 0 sc, 0 0 sc, 0 0 sc, 0 0 sc, 0 0 sc, 0 0 sc
th:hover .sort
background sh
transform translate((.5 * sw))
transform translate3d((.5 * sw), 0)
box-shadow (-2 * ss) 0 sh, 0 0 sh, 0 (-2 * ss) sh, 0 0 sh, (2 * ss) 0 sh, 0 0 sh, 0 0 sh, 0 (2 * ss) sh
th.sorting_asc
.sort
&:hover .sort
background sa
transform translate((.5 * sw + ss))
transform translate3d((.5 * sw + ss), 0)
box-shadow (-2 * ss) 0 sa, (-1 * ss) 0 sa, (-1 * ss) (-1 * ss) sa, 0 (-1 * ss) sa, 0 (-2 * ss) sa, ss 0 sa, ss (-1 * ss) sa, (2* ss) 0 sa
th.sorting_desc
.sort
&:hover .sort
background sa
transform translate((.5 * sw - ss))
transform translate3d((.5 * sw - ss), 0)
box-shadow (-2 * ss) 0 sa, (-1 * ss) 0 sa, (-1 * ss) ss sa, 0 ss sa, 0 (2 * ss) sa, ss 0 sa, ss ss sa, (2* ss) 0 sa
td
padding 0 10px
border-right 1px solid bc
border-bottom 1px solid bc
line-height 25px
&:last-child
border-right none
tr
&:nth-child(odd)
background od
&:nth-child(even)
background ev
body
html
width 100%
height 100%
margin 0
padding 0
body
font-weight 300
font-family "Helvetica Neue", Helvetica, Arial, sans-serif
background-image url('http://allpicts.in/download/7919/Maroon_and_Purple_Gradient_CSS_Background_Image.jpg/')
background-size cover
color fc
.container
position relative
width 600px
margin calc(50vh - 150px) auto 0 auto
$("table").dataTable({
$("table").dataTable({
processing: true,
serverSide: true,
ajax: {
url: "http://www.datatables.net/examples/server_side/scripts/jsonp.php",
dataType: "jsonp",
},
});