Convert Figma logo to code with AI

tholman logogithub-corners

A fresher "Fork me on GitHub" callout.

4,926
195
4,926
13

Top Related Projects

:octocat: Unofficial github:buttons

The unofficial GitHub Cards. Card for your GitHub profile, card for your GitHub repositories.

:scissors: Modern copy to clipboard. No Flash. Just 3kb gzipped :clipboard:

Quick Overview

GitHub Corners is a lightweight, customizable project that adds stylish "Fork me on GitHub" ribbons to websites. It provides a modern, animated alternative to the traditional GitHub ribbons, enhancing the visual appeal of web projects while maintaining a link to their GitHub repositories.

Pros

  • Lightweight and easy to implement
  • Customizable colors and styles
  • Animated SVG design for a modern look
  • Responsive and works well on various screen sizes

Cons

  • Limited to GitHub-specific use cases
  • May not fit all website designs or color schemes
  • Requires SVG support in browsers (though this is widely available now)
  • No built-in accessibility features (e.g., screen reader support)

Code Examples

  1. Basic implementation:
<a href="https://your-github-repository" class="github-corner" aria-label="View source on GitHub">
  <svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
    <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
    <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
    <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>
  </svg>
</a>
  1. Customizing colors:
<a href="https://your-github-repository" class="github-corner" aria-label="View source on GitHub">
  <svg width="80" height="80" viewBox="0 0 250 250" style="fill:#64CEAA; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
    <!-- SVG paths here -->
  </svg>
</a>
  1. Adding

Competitor Comparisons

:octocat: Unofficial github:buttons

Pros of GitHub Buttons

  • Offers a variety of button styles and sizes
  • Provides real-time counters for stars, forks, and followers
  • Easy to customize and integrate with minimal code

Cons of GitHub Buttons

  • Less visually striking compared to the corner design
  • May not blend as seamlessly with some website designs
  • Limited to standard button shapes and styles

Code Comparison

GitHub Buttons:

<a class="github-button" href="https://github.com/buttons/github-buttons" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star buttons/github-buttons on GitHub">Star</a>

GitHub Corners:

<a href="https://your-url" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>

The unofficial GitHub Cards. Card for your GitHub profile, card for your GitHub repositories.

Pros of github-cards

  • Provides more detailed GitHub repository information, including description, stars, and forks
  • Offers a customizable card-style display that can be embedded in various web pages
  • Supports multiple card styles and layouts for different use cases

Cons of github-cards

  • Requires more space on the page compared to the compact corner design
  • May have a higher loading time due to fetching additional repository data
  • Less visually integrated with the page design compared to the corner approach

Code Comparison

github-corners:

<a href="https://your-url" class="github-corner" aria-label="View source on GitHub">
  <svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
    <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
    <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
    <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>
  </svg>
</a>

github-cards:

<div class="github-card" data-github="lepture/github-cards" data-width="400" data-height="" data-theme="default"></div>
<script src="//cdn.jsdelivr.net/github-cards/latest/widget.js"></script>

:scissors: Modern copy to clipboard. No Flash. Just 3kb gzipped :clipboard:

Pros of clipboard.js

  • More functional: Provides copy-to-clipboard functionality for web applications
  • Wider applicability: Useful for various types of projects and websites
  • Active development: Regular updates and improvements

Cons of clipboard.js

  • Larger file size: More complex functionality results in a bigger library
  • Requires more setup: Needs JavaScript implementation and event handling
  • Potential browser compatibility issues: May not work consistently across all browsers

Code Comparison

clipboard.js:

new ClipboardJS('.btn');

document.querySelector('.btn').addEventListener('click', function() {
  alert('Copied!');
});

github-corners:

<a href="https://your-url" class="github-corner" aria-label="View source on GitHub">
  <svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true">
    <!-- SVG path data -->
  </svg>
</a>

Summary

clipboard.js is a JavaScript library for copy-to-clipboard functionality, while github-corners is a collection of SVG-based GitHub corner banners. clipboard.js offers more complex functionality but requires more setup, while github-corners is simpler to implement but has a more specific use case. The choice between the two depends on the project's needs and the desired features.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

GitHub Corners

Phew, GitHub is over ten years old now... and is unquestionably synonymous with open source. After 10 years, those GitHub ribbons are more than overdue for a cleaner, more modern alternative. This is my take.

By using SVG, these corners can be clean and sharp. Any color, and size. As well as have a little character and interactivity!

You can build your own with the SVGs, copy some of the pre-defined code, or just change the fill and color values on the main <svg> element.

Screenshot

You can see the page here... but I really recommend visiting the page to see the small animations that really make them come to life.

Here's the page

License/Acknowledgements

Naturally, these aren't built by GitHub, or endorsed by them.

Copyright (c) 2016 Tim Holman - http://tholman.com

The MIT License