Microinteractions
a { | |
color: #000; | |
display:inline-block; | |
text-decoration: none; | |
position: relative; | |
} | |
a::after { | |
height:2px; | |
position:absolute; | |
width:calc(100% - 11px); | |
content: attr(data-target); | |
text-indent: -9999px; | |
padding-left:11px; | |
line-height: 20px; | |
font-size:11px; | |
color: #fff; | |
background:#000; | |
left:0px; | |
top:100%; | |
transition: height 100ms linear | |
} | |
a:hover::after { | |
height:20px; | |
bottom:-20px; | |
text-indent: 0px; | |
} |
var links = document.getElementsByClassName('flaglink') | |
for (i = 0; i < links.length; ++i) { | |
var url = links[i].getAttribute('href') | |
if (url.indexOf("://") > -1) { | |
hostname = url.split('/')[2]; | |
} | |
else { | |
hostname = url.split('/')[0]; | |
} | |
hostname = hostname.split(':')[0]; | |
links[i].setAttribute('data-target', hostname) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment