cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

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.

            
              <p>Welcome to my site I'm Ben Sheppard, I'm a Frontend Web Developer from Cardiff</p>
<p>You should follow my twitter it's <a href="https://twitter.com/TheFlatking" target="_blank">@TheFlatking</a></p>
<p>I last listened to <span class="songName">MERCY</span> by <span class="artist">Joyryde</span> 3 hours and 52 minutes ago on Spotify</p>
<p>Steal my code at <a href="https://codepen.io/ohlookawebsite/pen/zNJBYa" target="_blank">codepen</a></p>
            
          
!
            
              *{
    font-family: 'Slabo 27px', serif;
}
body{
    background: #f2f2f2;
    padding: 40px;
    margin: 0;
}
p {
    margin: 0;
    margin-bottom: 20px;
    color: blue;
    font-size: 24px;
    letter-spacing: 0.6px;
}
p a:visited {
    color: blue;
}
p a:hover{
    color:red;
}
            
          
!
            
              // Spotify part is from lastfm scrobbling


// <?php
// // Account & API Account Information
// $user = ""; // <---- Your username goes here
// $key = ""; //<-- Your API key goes here

// // The URL of the request to API Service
// $url = "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=$user&api_key=$key&format=json";

// // Enable Shortening
// $short_titles = false;

// // Setup cURL for request
// $ch = curl_init( $url );
// $options = array(
// 	CURLOPT_RETURNTRANSFER => true
// 	);
// curl_setopt_array($ch, $options);

// // Execute cURL
// $json = curl_exec($ch);
// curl_close($ch);
// $data = json_decode($json,true);

// // Get only the latest track information
// $last = $data['recenttracks']['track'][0];

// // Is now playing attribute present?
// if (isset($last['@attr']['nowplaying'])) {

// 	$output = "I am currently listening to <span class='songName highlight'>" . $last['name'] . '</span> by <span class="artist highlight">' . $last['artist']['#text'] . "</span> on Spotify.";

// 	if ($short_titles) {
// 		$output = sTrim($output);
// 	}

// 	echo trim($output);
// } else {
// 	$played = $last['date']['uts']; $now = time();
// 	$diff = abs($now - $played);

// 	// Time formatting
// 	$hours = intval(intval($diff) / 3600); 
// 	$minutes = intval(($diff / 60) % 60);

// 	// String formatting based on time
// 	if (!empty($hours)) {
// 		if ($hours > 24)
// 			$time = "over a day ago";
// 		else
// 			$time = $hours . " hours and " . $minutes . " minutes ago";
// 	} else
// 		$time = $minutes . " minutes ago";

// 	$output = "I last listened to <span class='songName'>" . $last['name'] . '</span> by <span class="artist">' . $last['artist']['#text'] . "</span> $time on Spotify";

// 	if ($short_titles) {
// 		$output = sTrim($output);
// 	}

// 	echo trim($output);
// }

// exit();

// function sTrim($output) {
// 	$output = preg_replace("/- Live/i", "", $output);
// 	$output = preg_replace("/- Album Version Explicit/i", "", $output);
// 	$output = preg_replace("/- Explicit Album Version/i", "", $output);
// 	$output = preg_replace("/- Explicit Version/i", "", $output);
// 	$output = preg_replace("/- Album Version/i", "", $output);
// 	$output = preg_replace("/\\[(.*?)\]/i", "", $output);
// 	$output = preg_replace("/\\((.*?)\)/i", "", $output);
// 	return $output;
// }
// ?>
            
          
!
999px
Loading ..................

Console