Skip to content

Instantly share code, notes, and snippets.

@zaki-yama
Created April 4, 2015 15:36
Show Gist options
  • Select an option

  • Save zaki-yama/bf54656db7d944d71337 to your computer and use it in GitHub Desktop.

Select an option

Save zaki-yama/bf54656db7d944d71337 to your computer and use it in GitHub Desktop.
"Fork me on GitHub" Ribbon with Polymer
<link rel="import" href="/bower_components/polymer/polymer.html">
<polymer-element name="github-ribbon" attributes="user repo">
<template>
<style>
a {
background:#000;
color:#fff;
text-decoration:none;
font-family:arial,sans-serif;
text-align:center;
font-weight:bold;
padding:5px 40px;
font-size:0.7rem;
line-height:1.7rem;
position:relative;
transition:0.5s;
}
a:hover {
background:#c11;
color:#fff;
}
a::before, a::after {
content:"";
width:100%;
display:block;
position:absolute;
top:1px;
left:0;
height:1px;
background:#fff;
}
a::after {
bottom:1px;
top:auto;
}
@media screen and (min-width:800px) {
{
position:fixed;
display:block;
top:0;
right:0;
width:140px;
overflow:hidden;
height:140px;
z-index:9999;
}
a {
width:200px;
position:absolute;
top:30px;
right:-90px;
transform:rotate(45deg);
-webkit-transform:rotate(45deg);
-ms-transform:rotate(45deg);
-moz-transform:rotate(45deg);
-o-transform:rotate(45deg);
box-shadow:4px 4px 10px rgba(0,0,0,0.8);
}
}
</style>
<div layout horizontal center>
<a href="https://github.com/{{user}}/{{repo}}">
Fork me on GitHub
</a>
</div>
</template>
<script>
Polymer({});
</script>
</polymer-element>
<!doctype html>
<!-- sample html that imports "github-ribbon" element -->
<html>
<head>
<link rel="import" href="static/html/github-ribbon.html">
</head>
<body>
<github-ribbon user="zaki-yama" repo="gae-polymer"></github-ribbon>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment