HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<div id="app">
<v-app id="inspire">
<v-system-bar window>
<v-img src="https://s.mxmcdn.net/site/images/logo_icon.svg" max-height="20" max-width="20"></v-img>
<div class="subheading pl-2">{{ windowTitle }}</div>
<v-spacer></v-spacer>
<v-icon>remove</v-icon>
<v-icon>check_box_outline_blank</v-icon>
<v-icon>close</v-icon>
</v-system-bar>
<!-- tabs -->
<v-tabs fixed-tabs class="mt-3 mb-5" color="transparent" slider-color="primary" icons-and-text v-model="currentTab">
<v-tab href="#home">
Home
<v-icon>home</v-icon>
</v-tab>
<v-tab href="#music">
Music
<v-icon>music_note</v-icon>
</v-tab>
<v-tab href="#contribute">
Contribute
<v-icon>scatter_plot</v-icon>
</v-tab>
<v-tab href="#identify">
Identify
<v-icon>trip_origin</v-icon>
</v-tab>
<v-tab href="#search">
Search
<v-icon>search</v-icon>
</v-tab>
<!-- tabs content -->
<v-tab-item value="home" class="pa-3">
<!-- content title -->
<h1 class="primary--text mb-3 pl-1">Home</h1>
<!-- first card -->
<v-layout align-center justify-space-around row fill-height>
<v-flex xs4 pa-1>
<v-card flat>
<v-subheader class="primary--text">Start</v-subheader>
<v-card-title primary class="title">FloatingLyrics™</v-card-title>
<v-card-text>
Obtain instantly for free lyrics on YouTube, Play Musique and more.
</v-card-text>
<v-img></v-img>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn flat color="primary">Open FloatingLyrics</v-btn>
</v-card-actions>
</v-card>
</v-flex>
<!-- second card -->
<v-flex xs4 pa-1>
<v-card flat>
<v-subheader style="color: #9013FE">NEW</v-subheader>
<v-card-title primary class="title">Let the party begin!</v-card-title>
<v-card-text>
A new and wonderful expérience to sing
</v-card-text>
<v-img></v-img>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn flat color="#9013FE">Read more</v-btn>
</v-card-actions>
</v-card>
</v-flex>
<!-- third card -->
<v-flex xs4 pa-1>
<v-card flat>
<v-subheader style="color: #FFC208">Translated Lyrics</v-subheader>
<v-card-title primary class="title">Translated lyrics in more than 60 languages</v-card-title>
<v-img></v-img>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn flat color="#FFC208">SEE EVERYTHING</v-btn>
</v-card-actions>
</v-card>
</v-flex>
</v-layout>
</v-tab-item>
<!-- music tab content -->
<v-tab-item value="music" class="pa-3">
<!-- content title -->
<h1 class="primary--text mb-3 pl-1">Music</h1>
<!-- layout -->
<v-layout row xs12 align-start>
<v-flex xs2>
<v-list style="background: transparent" id="musiclist">
<v-list-tile>
<v-list-tile-title class="title primary--text">ALBUMS</v-list-tile-title>
</v-list-tile>
<v-list-tile>
<v-list-tile-title class="title">ARTISTS</v-list-tile-title>
</v-list-tile>
<v-list-tile>
<v-list-tile-title class="title">SONGS</v-list-tile-title>
</v-list-tile>
<v-list-tile>
<v-list-tile-title class="title">GENRES</v-list-tile-title>
</v-list-tile>
<v-list-tile>
<v-list-tile-title class="title">FOLDERS</v-list-tile-title>
</v-list-tile>
</v-list>
</v-flex>
<v-flex xs10>
<v-layout row wrap>
<v-flex v-for="(album, i) in albums" :key="i" xs3 lg2>
<v-card flat class="pa-3 album" style="background: transparent">
<v-img class="radius" :src="album.coverUrl"></v-img>
</v-list>
<v-layout row wrap align-center>
<v-flex xs11>
<v-list two-line>
<v-list-tile avatar>
<v-list-tile-content>
<v-list-tile-title>{{ album.albumName }}</v-list-tile-title>
<v-list-tile-sub-title>{{ album.albumAuthor }}</v-list-tile-sub-title>
</v-list-tile-content>
</v-list-tile>
</v-flex>
<v-flex xs1>
<v-btn right icon>
<v-icon>more_vert</v-icon>
</v-btn>
</v-flex>
</v-layout>
</v-card>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-tab-item>
<v-tab-item value="contribute" class="pa-3">contribute</v-tab-item>
<v-tab-item value="identify" class="pa-3">identify</v-tab-item>
<v-tab-item value="search" class="pa-3">search</v-tab-item>
</v-tabs>
<!-- footer -->
<v-footer height="auto" fixed color="transparent" style="padding: 10px">
<v-flex d-flex>
<v-card>
<v-flex d-flex xs12 align-center justify-center row>
<v-flex xs2>
<v-layout align-center d-flex>
<v-flex shrink>
<v-img aspect-ratio="1" src="https://upload.wikimedia.org/wikipedia/en/e/e5/Avicii_-_True_%28Album%29.png" height="60" width="60" style="margin: 0 auto"></v-img>
</v-flex>
<v-flex grow>
<v-card-text :style="{padding: pad}">
<h3 class="title mb-1 text-truncate">Addicted to you</h3>
<div> Avicii </div>
</v-card-text>
</v-flex>
</v-layout>
</v-flex>
<v-flex d-flex xs8 align-center justify-center row>
<v-flex xs1>
<v-card-text xs1 style="text-align: right">{{ songCurrentTime }}</v-card-text>
</v-flex>
<v-flex xs8>
<v-slider v-model="val" :min="0" :max="maxStep"></v-slider>
</v-flex>
<v-flex xs1 align-center>
<v-card-text style="text-align: left">{{ songDuration }}</v-card-text>
</v-flex>
</v-flex>
<v-flex xs2 align-center justify-center row>
<v-layout row d-flex align-center>
<v-flex grow>
<v-btn flat icon>
<v-icon>skip_previous</v-icon>
</v-btn>
<v-btn flat icon>
<v-icon>pause</v-icon>
</v-btn>
<v-btn flat icon>
<v-icon>skip_next</v-icon>
</v-btn>
</v-flex>
<v-flex shrink style="text-align: right" class="pr-3">
<v-btn flat icon>
<v-icon>keyboard_arrow_up</v-icon>
</v-btn>
</v-flex>
</v-layout>
</v-flex>
</v-flex>
</v-card>
</v-flex>
</v-footer>
</v-app>
</div>
#musiclist .v-list__tile {
padding-left: 0;
padding-right: 0;
}
.radius {
border-radius: 1.2em !important;
overflow: hidden;
}
.album .v-list {
background: transparent;
}
Vue.config.devtools = true;
let mm = new Vue({
el : '#app',
data : () => ({
pad: 10,
links: [
'Home',
'About Us',
'Team',
'Services',
'Blog',
'Contact Us'
],
currentTab: "music",
songDurationSec: 28,
songDurationMin: 2,
maxStep: 500,
val: 250,
additionalWindowTitle: "",
albums: [
{
coverUrl: "https://upload.wikimedia.org/wikipedia/en/3/3f/Ed_Sheeran_%2B_cover.png",
albumName: "+",
albumAuthor: "Ed Sheraan"
},
{
coverUrl: "https://upload.wikimedia.org/wikipedia/en/4/45/Divide_cover.png",
albumName: "÷ (Deluxe)",
albumAuthor: "Ed Sheraan"
},
{
coverUrl: "https://upload.wikimedia.org/wikipedia/commons/a/a3/Charlie_Puth_-_Attention_%28Official_Single_Cover%29.png",
albumName: "Attention",
albumAuthor: "Charlie Puth"
},
{
coverUrl: "https://upload.wikimedia.org/wikipedia/en/6/6a/The_Beginning_%28The_Black_Eyed_Peas_album%29.jpg",
albumName: "The Beginning",
albumAuthor: "The Black Eyed Peas"
},
{
coverUrl: "https://upload.wikimedia.org/wikipedia/en/0/08/Zedd_-_Candyman.png",
albumName: "Candymann",
albumAuthor: "ZEDD, Aloe Blacc"
},
{
coverUrl: "https://i1.sndcdn.com/artworks-bWo6LAOZbqIZ-0-t500x500.jpg",
albumName: "Chemical",
albumAuthor: "Jack Garratt"
},
{
coverUrl: "https://upload.wikimedia.org/wikipedia/en/6/66/Dan_powter_album.jpg",
albumName: "Daniel Powter",
albumAuthor: "Daniel Powter"
},
{
coverUrl: "https://upload.wikimedia.org/wikipedia/en/e/eb/Bruno_Mars_-_Doo-Wops_%26_Hooligans.png",
albumName: "Doo-Wops & Hooligans",
albumAuthor: "Bruno Mars"
},
{
coverUrl: "https://upload.wikimedia.org/wikipedia/en/6/63/Encore_album_cover.jpeg",
albumName: "Encore",
albumAuthor: "DJ Snake"
},
{
coverUrl: "https://upload.wikimedia.org/wikipedia/en/1/10/Careless_Whisper_UK_single.jpg",
albumName: "Careless Whisper",
albumAuthor: "George Michael"
},
{
coverUrl: "https://e-cdns-images.dzcdn.net/images/cover/8f06af28ee28a2729a46389f35b60ba1/264x264-000000-80-0-0.jpg",
albumName: "Can Be Late",
albumAuthor: "Skip the use"
},
{
coverUrl: "https://upload.wikimedia.org/wikipedia/en/7/79/TheLatenessoftheHour.jpg",
albumName: "The Lateness Of The Hour",
albumAuthor: "Alex Clare"
}
]
}),
computed: {
windowTitle: function() {
return "Musixmatch" + ((this.additionalWindowTitle !== "") ? " - " + this.additionalWindowTitle : "");
},
songDuration: function() {
return ((this.songDurationMin < 10) ? "0" : "") + this.songDurationMin + ":" + ((this.songDurationSec < 10) ? "0" : "") + this.songDurationSec;
},
maxTime: function() {
return this.songDurationMin + this.songDurationSec/60;
},
songCurrentTime : function() {
const currentValue = this.val / this.maxStep * this.maxTime;
const min = Math.floor(currentValue);
const sec = Math.floor((currentValue - Math.floor(currentValue))*60);
return ((min < 10) ? "0" : "") + min + ":" + ((sec < 10) ? "0" : "") + sec;
}
},
mounted: function() {
setAppSize("app")
this.$vuetify.theme = {
primary: '#FF6050',
secondary: '#D54262',
accent: '#FF0E83',
error: '#66336E'
}
}
})
function setAppSize(id) {
const height = window.innerWidth*9/16;
//document.getElementById(id).style.height = height + "px";
}
Also see: Tab Triggers