cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <div class="linkinator">
<h1>Google Drive Asset Link Converter</h1>
<p>You can use Google Drive to host web assets &mdash; icons, font files, stylesheets, .js files, etc. But the share link needs a little tweak to turn it into a direct link to your asset. This converter does it for you. </p>
  <p>Paste in the "Link to Share" link for your <strong>PUBLIC ON THE WEB FILE</strong> and press the "Create Direct URL" button to get the direct link to your web asset.</p>
  <p><strong>Note:</strong> you can only link individual public files as assets, not folders. If your file is inside a folder, that folder must be public.</p>
<form>
<input type="text" length="150" class="link"></input>
<button>Create Direct URL</button>
</form>
<p class="results"></p>
</div>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Titillium+Web|Abril+Fatface);

body { 
  background-color: rgba(177, 99, 163, .3);
  font-family: 'Titillium Web', sans-serif;
}

.linkinator { 
  width: 65%;
  margin: 0 auto;
}

h1 { 
  font-family: 'Abril Fatface', serif;
  font-size: 2.5em;
  color: rgba(177, 99, 163, .8);
  text-shadow: 0px 1px 1px white;
}

p { 
  font-size: 1.2em;
  width: 85%;
} 

input[type='text'] { 
  width: 75%;
  height: 2.5em;
}

button {
  	border: none;
  font-size: inherit;
	  color: inherit;
	  background: none;
  	cursor: pointer;
  padding: 15px;
	  font-weight: 700;
  	outline: none;
  	-webkit-transition: all 0.3s;
	  -moz-transition: all 0.3s;
  	transition: all 0.3s;
  	background: rgb(126, 70, 116);
	  color: #fff;
  	box-shadow: 0 6px rgb(94, 53, 87);
	  -webkit-transition: none;
	  -moz-transition: none;
	  transition: none;
	  border-radius: 0 0 5px 5px;
}

button:hover {
	  box-shadow: 0 4px rgb(94, 53, 87);
	  top: 2px;
}

button:active {
  	box-shadow: 0 0 rgb(94, 53, 87);
	  top: 6px;
}

.results {
  display: none;
  width: 85%;
  background-color: white;
  color: rgb(177, 99, 163);
  padding: 1em;
  text-align: center;
}
            
          
!
            
              $( document ).ready(function() {
  $('form').on('submit', function (e) {
    e.preventDefault();
     var yourlink = $('input[type="text"]').val();
     var link = yourlink.trim();
     
    if (link.indexOf('drive.google.com') == -1 || link.indexOf('file') == -1) {
     $('.results').show().text('Sorry, this only works on the public sharing link of Google Drive files');
      return false;
    }

     var pattern = /[0-9]/;
     var place = link.search(pattern);
     var urlkey = link.substr(place);
     var finalkey = urlkey.split('/')[0];
     $('.results').show().text('https://googledrive.com/host/' + finalkey);
  });
});
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console