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.
- var cssGrid= [{ time: "December 26, 2018", name: "Bullet Journal", link: 'aPwaXm', image: "bujo.jpg", desc: "When you can't afford to buy a Moleskine and nice stationery for bullet journaling, so you code it up instead." },{ time: "February 1, 2019", name: "Excel Spreadsheet", link: 'rPjgmB', image: 'excel.jpg', desc: 'A recreation of Microsoft Excel, that is all.'}, { time: "March 16, 2019", name: "A Floor Plan", link: 'moLrBq', image: "floorplan.jpg", desc: "My ideal floor plan, with lots of space for the dogs and cats to run around."},{ time: "May 24, 2019", name: "Grocery Coupons", link: 'wbyVWr', image: "coupons.jpg", desc: "Inspired by junk mail, here are coupons made for a fictional grocery store, featuring snacks when I pull my all-nighters."},{ time: "September 7, 2019", name: "Marvel Magazine", link: 'GRKQoKM', image: "marvel.gif", desc: "Wanted to do some magazine layouts, so I decided to create a Marvel Magazine. I regret everything."}];
- var UIDesign = [{ time: "January 10, 2019", name: "Recipe Layout", link: 'GPXozx', image: "recipe.jpg", desc: "My annual pen inspired by the Waitress musical 🥧" }, { time: "April 11, 2019", name: "A Style Guide", link: 'mgWjpq', image: 'style.jpg', desc: 'What could go wrong if I were to do a style guide with 5 color palettes without any planning? Narrator: A lot of things could go wrong.'}, { time: "June 17, 2019", name: "Media Cards", link: 'WqwOzv', image: "media-cards.jpg", desc: "Cards have the same HTML structure, altered with CSS Grid."}, { time: "November 10, 2019", name: "Restaurant Menu", link: 'LYYrKMV', image: "menu.jpg", desc: "Restaurant websites with useful information seem like a rarity these days..."},{ time: "Friday, January 31", name: "Toggles", link: 'xxboXzo', image: 'toggle.gif', desc: 'Do you want your toggle fancy or functional? Yes.'},{ time: "Friday, March 27", name: "To-Do Terrarium", link: 'oNXJgEM', image: "terrarium.jpg", desc: "Not just a to-do list, it's a covid quarantine to-do list. Made with GSAP."},{ time: "Thursday, April 23", name: "A Workout Schedule", link: 'RwWKybY', image: 'workout.jpg', desc: "It's a 30-day challenge, so why do I need 50 days?"}];
- var cssAnim = [{ time: "April 28, 2018", name: "Pies from the Waitress Musical", link: 'WJoqNZ', image: "slideshow.gif", desc: "Even more pies. Showcasing slider animations." },{ time: "August 27, 2018", name: "Feature Showcase", link: 'xaVXgw', image: "feature.jpg", desc: '"We\'ll use screenshots for this." "How about we make an animation instead?" Actually something done for work.'}, { time: "January 27, 2019", name: "Marauder's Map", link: 'ZwWbNg', image: "marauder.gif", desc: 'Say "I solemnly swear up to no good" and watch the map unfold.'},{ time: "February 26, 2019", name: "Hover Effects for Headers", link: 'YgzNzK', image: "header.jpg", desc: "8 hover effects, featuring the most amazing things you can find on earth."},{ time: "March 23, 2019", name: "Obvious CTA Buttons", link: 'vPvvyr', image: "button.jpg", desc: "Terrible ways to make sure your users click that CTA button!"}, { time: "Friday, April 17", name: "Nerf Gun Radio Button", link: 'RwWaBdN', image: "nerfgun.gif", desc: "An 'interesting' way for users to select a radio button. Never try in production."}, ];
- var jsThings = [{ time: "May 25, 2019", name: "Feed The Picky Eater", link: 'earYeG', image: "eater.jpg", desc: 'A birthday gift for the pickiest eater I know.'},{ time: "Sunday, April 12", name: "Pasta Menu", link: 'zYvxXWw', image:'pasta.jpg', desc: 'Changing pasta menu icons and sections with GSAP.'},{ time: "Tuesday, April 14", name: "Social Distancing", link: 'QWjjrZX', image: "social.gif", desc: 'A friendly reminder during these tough times #StayTheFuckHome'}];
- var cssIllu = [{ time: "August 18, 2017", name: "Sugar, Butter, Flour", link: "GvQrxj", image: "sugar.gif", desc: "Sugar, Butter, Flour - the catchphrase in the musical 'Waitress'."},{ time: "December 19, 2018", name: "A Shelf!", link: 'PXGgMG', image: "shelf.jpg", desc: "A CSS shelf, featuring things that I've never owned in my life."},{ time: "January 7, 2019", name: "An Emoji Factory", link: 'qLYNbE', image: "emoji.jpg", desc: "I've always wanted an emoji with fire eyes... decided to build this little factory so I can make whatever emoji I want." },{ time: "January 13, 2019", name: "Hogwarts Express Tickets", link: 'MZZYyO', image: "hogwarts.jpg", desc: "Reimagining a modern version of Hogwarts Express train tickets."},{ time: "July 29, 2019", name: "PacMan", link: 'MNJwBM', image: "pacman.jpg", desc: "A CSS take on the PacMan layout, with a twist inspired by Ingrid Michaelson's lyric video of the song, Missing You."},{ time: "November 23, 2019", name: "The Weasley Clock", link: 'KKKYJZm', image: "weasley.jpg", desc: "A recreation of the Weasley Clock with moving clock hands. Annnndd... Ron is lost again."}, ];
- var collections = [{ name: "Factories", link: 'ANgNEw', desc:"Generators to help you create achievement medals or your very own emoji.", image: 'factories.jpg'}, { name: "Musicals", link: 'XPWkdW', desc:"Pens inspired by Broadway musicals 🎵", image: 'musical.jpg'}, { name: "A Harry Potter Collection", link: 'DjwqvK', desc: "Yerr in a collection, 'arry!", image: 'hp.jpg'}, { name: "CSS Animations", link: 'XJNKLz', desc: "Much animating, such swoosh", image: 'anim.jpg'}, { name: "A Style Guide", link: 'XJyNPm', desc:"A style guide with 5 different color palettes and various UI solutions. An experiment inspired by Brad Frost's Atomic Design methodology.", image: 'style.jpg'},{ name: "CSS Grid Experiments", link: 'DQvYpQ', desc:"32 pens of CSS Grid - mostly things that shouldn't be using Grid.", image: 'grid.jpg'}];
main
nav.sidebar
.sidebar__head
h1 My Codepen Showcase
.sidebar__head__name
i.circle
span.op--80 Olivia Ng
.sections.op--80
.sections__title
i.icon-arrow-down
|Channels
a.sections__item(data-switch="css-anim")
span #
span css-animations
a.sections__item(data-switch="css-grid")
span #
span css-grid
a.sections__item(data-switch="css-illu")
span #
span css-illustrations
a.sections__item(data-switch="js-things")
span #
span js-things
a.sections__item(data-switch="collections")
span #
span just-collections
a.sections__item(data-switch="ui-design").active
span #
span ui-design
.sections.op--80
.sections__title
i.icon-arrow-down
| Direct Messages
a.sections__item.no
i.circle
| Slackbot
a.sections__item(data-switch="self")
i.circle
| meowlivia (you)
section.main-content
.channel.active#ui-design
.channel__header
h2 #ui-design
.channel__header__info
i.icon-rocket
span 7 pens
span.explanation 1 hour coding, 5 hours choosing a color palette.
.channel__body
each val, index in UIDesign
if index == UIDesign.length-1
.channel__body__grouped#ui-design-last
.channel__body__day
.channel__body__date
span=val.time
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time.js-time
.message__text
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")
| https://codepen.io/oliviale/full/
=val.link
.message__link
.message__link__site
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-icon-codepen.png" alt="Codepen Icon")
span CodePen
.message__link__text
strong
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")= val.name
p= val.desc
.message__image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-"+val.image alt="Showcase Image")
else
.channel__body__grouped
.channel__body__day
.channel__body__date
span=val.time
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time.js-time
.message__text
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")
| https://codepen.io/oliviale/full/
=val.link
.message__link
.message__link__site
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-icon-codepen.png" alt="Codepen Icon")
span CodePen
.message__link__text
strong
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")= val.name
p= val.desc
.message__image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-"+val.image alt="Showcase Image")
.channel__input
input(type="text" placeholder="Jot something down")
button.js-emoji
i.icon-emotsmile
.channel#js-things
.channel__header
h2 #js-things
.channel__header__info
i.icon-rocket
span 3 pens
span.explanation I don't do much JS, but when I do, it's jQuery.
.channel__body
each val, index in jsThings
if index == jsThings.length-1
.channel__body__grouped#js-things-last
.channel__body__day
.channel__body__date
span=val.time
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time.js-time
.message__text
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")
| https://codepen.io/oliviale/full/
=val.link
.message__link
.message__link__site
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-icon-codepen.png" alt="Codepen Icon")
span CodePen
.message__link__text
strong
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")= val.name
p= val.desc
.message__image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-"+val.image alt="Showcase Image")
else
.channel__body__grouped
.channel__body__day
.channel__body__date
span=val.time
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time.js-time
.message__text
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")
| https://codepen.io/oliviale/full/
=val.link
.message__link
.message__link__site
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-icon-codepen.png" alt="Codepen Icon")
span CodePen
.message__link__text
strong
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")= val.name
p= val.desc
.message__image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-"+val.image alt="Showcase Image")
.channel__input
input(type="text" placeholder="Jot something down")
button.js-emoji
i.icon-emotsmile
.channel#css-grid
.channel__header
h2 #css-grid
.channel__header__info
i.icon-rocket
span 5 pens
span.explanation Is it easier to use Flex? Maybe. But CSS Grid tho.
.channel__body
each val, index in cssGrid
if index == cssGrid.length-1
.channel__body__grouped#css-grid-last
.channel__body__day
.channel__body__date
span=val.time
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time.js-time
.message__text
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")
| https://codepen.io/oliviale/full/
=val.link
.message__link
.message__link__site
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-icon-codepen.png" alt="Codepen Icon")
span CodePen
.message__link__text
strong
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")= val.name
p= val.desc
.message__image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-"+val.image alt="Showcase Image")
else
.channel__body__grouped
.channel__body__day
.channel__body__date
span=val.time
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time.js-time
.message__text
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")
| https://codepen.io/oliviale/full/
=val.link
.message__link
.message__link__site
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-icon-codepen.png" alt="Codepen Icon")
span CodePen
.message__link__text
strong
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")= val.name
p= val.desc
.message__image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-"+val.image alt="Showcase Image")
.channel__input
input(type="text" placeholder="Jot something down")
button.js-emoji
i.icon-emotsmile
.channel#css-illu
.channel__header
h2 #css-illustrations
.channel__header__info
i.icon-rocket
span 6 pens
span.explanation Why use SVG when you can use 32 divs?
.channel__body
each val, index in cssIllu
if index == cssIllu.length-1
.channel__body__grouped#css-illu-last
.channel__body__day
.channel__body__date
span=val.time
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time.js-time
.message__text
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")
| https://codepen.io/oliviale/full/
=val.link
.message__link
.message__link__site
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-icon-codepen.png" alt="Codepen Icon")
span CodePen
.message__link__text
strong
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")= val.name
p= val.desc
.message__image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-"+val.image alt="Showcase Image")
else
.channel__body__grouped
.channel__body__day
.channel__body__date
span=val.time
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time.js-time
.message__text
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")
| https://codepen.io/oliviale/full/
=val.link
.message__link
.message__link__site
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-icon-codepen.png" alt="Codepen Icon")
span CodePen
.message__link__text
strong
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")= val.name
p= val.desc
.message__image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-"+val.image alt="Showcase Image")
.channel__input
input(type="text" placeholder="Jot something down")
button.js-emoji
i.icon-emotsmile
.channel#css-anim
.channel__header
h2 #css-animations
.channel__header__info
i.icon-rocket
span 7 pens
span.explanation Making things move with code.
.channel__body
each val, index in cssAnim
if index == cssAnim.length-1
.channel__body__grouped#css-anim-last
.channel__body__day
.channel__body__date
span=val.time
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time.js-time
.message__text
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")
| https://codepen.io/oliviale/full/
=val.link
.message__link
.message__link__site
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-icon-codepen.png" alt="Codepen Icon")
span CodePen
.message__link__text
strong
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")= val.name
p= val.desc
.message__image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-"+val.image alt="Showcase Image")
else
.channel__body__grouped
.channel__body__day
.channel__body__date
span=val.time
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time.js-time
.message__text
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")
| https://codepen.io/oliviale/full/
=val.link
.message__link
.message__link__site
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-icon-codepen.png" alt="Codepen Icon")
span CodePen
.message__link__text
strong
a.link(href="https://codepen.io/oliviale/full/"+val.link target="_blank" rel="noopener")= val.name
p= val.desc
.message__image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-"+val.image alt="Showcase Image")
.channel__input
input(type="text" placeholder="Jot something down")
button.js-emoji
i.icon-emotsmile
.channel#collections
.channel__header
h2 #just-collections
.channel__header__info
i.icon-grid
span 6 collections
span.explanation Collections with a specific theme.
.channel__body
.channel__body__grouped
.channel__body__day
.channel__body__date
span Today
each val, index in collections
if index == collections.length-1
.message#collections-last
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time 1:05AM
.message__text
a.link(href="https://codepen.io/collection/"+val.link target="_blank" rel="noopener")
| https://codepen.io/collection/
=val.link
.message__link
.message__link__site
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-icon-codepen.png" alt="Codepen Icon")
span CodePen
.message__link__text
strong
a.link(href="https://codepen.io/collection/"+val.link target="_blank" rel="noopener")= val.name
p= val.desc
.message__image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-co-"+val.image alt="Showcase Image")
else
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time 12:45AM
.message__text
a.link(href="https://codepen.io/collection/"+val.link target="_blank" rel="noopener")
| https://codepen.io/collection/
=val.link
.message__link
.message__link__site
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-icon-codepen.png" alt="Codepen Icon")
span CodePen
.message__link__text
strong
a.link(href="https://codepen.io/collection/"+val.link target="_blank" rel="noopener")= val.name
p= val.desc
.message__image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-co-"+val.image alt="Showcase Image")
.channel__input
input(type="text" placeholder="Jot something down")
button.js-emoji
i.icon-emotsmile
.channel#self
.channel__header
h2
i.circle
| meowlivia
.channel__body
.channel__body__grouped
.channel__body__day
.channel__body__date
span Wednesday, April 1
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time 2:34 PM
.message__text
| It's
code box-sizing: border-box
| , not
code border-box: box-sizing
| ... 🙄
.channel__body__grouped
.channel__body__day
.channel__body__date
span Saturday, April 4
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time 5:10 PM
.message__text
| Can we replicate this in CSS?
.message__image
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-noface.jpg" alt="Showcase Image")
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time 5:11 PM
.message__text Lol good joke
.channel__body__grouped
.channel__body__day
.channel__body__date
span Wednesday, April 15
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time 12:55 PM
.message__text
p Friendly self reminder that you haven't done anything Harry Potter-related in a while and that is unacceptable.
.channel__body__grouped
.channel__body__day
.channel__body__date
span Monday, April 20
.message
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time 9:16 PM
.message__text
strong Codepen To-do:
p.list
| ✅ Sketch out idea
br
| ✅ Code framework
br
| ⬜
strike Make pen responsive
span nvm, not enough time
br
| ✅ Make pen public
br
| ✅ Post it on Twitter
.channel__body__grouped
.channel__body__day
.channel__body__date
span Yesterday
.message#self-last
.message__profile
img(src="https://pbs.twimg.com/profile_images/930723320210767872/dL1TBczy_400x400.jpg" alt="Profile Picture")
.message__content
.message__sender
a.name(href="https://twitter.com/meowlivia_" target="_blank" rel="noopener") meowlivia
span.time 3:55 AM
.message__text This pen 🙃😭🙃😭
.message__image
img(src="https://media.giphy.com/media/15ddqrBmBRwsg/giphy.gif" alt="My feelings in GIF")
.channel__input
input(type="text" placeholder="Jot something down")
button
i.icon-emotsmile
.emoji-roll 😃
:root {
--sidebar-bg: rgb(63, 14, 64);
--sidebar-divider: rgba(255, 255, 255, 0.3);
--font: rgb(28, 29, 28);
--font-gray: rgb(97, 96, 97);
--gray-lightest: rgb(246,246,246);
--gray-outline: rgb(221, 221, 221);
--gray-accent: #ddd;
--gray-input: rgb(142, 141, 142);
--gray-input-dark: rgb(96, 96, 96);
--green: rgb(43, 172, 118);
--blue: rgb(17, 100, 163);
--pink: rgb(224, 30, 90);
}
* {
box-sizing: border-box;
}
body {
font-size: 1.1rem;
}
code {
display: inline-block;
border: 1px solid var(--gray-outline);
background: var(--gray-lightest);
color: var(--pink);
font-family: monospace;
padding: 4px 6px 3px;
border-radius: 5px;
margin: 0 4px;
}
input {
font-family: 'Lato';
}
h2 {
font-weight: 800;
}
strong {
font-weight: 700;
}
main {
min-width: 600px;
max-height: 100vh;
}
i.circle {
display: inline-block;
width: 10px;
height: 10px;
background: var(--green);
border-radius: 50%;
margin-right: 7px;
}
.op {
&--80 {
color: rgba(255, 255, 255, 0.65);
}
}
a.link {
color: var(--blue);
text-decoration: none;
cursor: pointer;
&:hover {
text-decoration: underline;
}
}
body {
background: var(--preview-bg);
font-family: "Lato", sans-serif;
overflow-y: hidden;
}
main {
height: 100vh;
display: grid;
grid-template-columns: minmax(250px, 18%) 1fr;
width: 100%;
}
.sidebar {
background: var(--sidebar-bg);
color: #fff;
&__head {
padding: 20px;
border-bottom: 0.5px solid var(--sidebar-divider);
h1 {
font-weight: 900;
}
&__name {
margin-top: 5px;
font-size: 90%;
}
}
.sections {
&__title {
padding: 25px 16px 12px;
i {
font-size: 10px;
vertical-align: middle;
display: inline-block;
margin: -3px 10px 0 -4px;
}
}
&__item {
padding: 8px 16px;
display: block;
cursor: pointer;
span:nth-child(1) {
margin-right: 4px;
}
&.active {
color: #fff;
background: var(--blue);
}
&.no {
pointer-events: none;
}
}
}
}
.channel {
position: relative;
&:not(.active) {
display: none;
}
&__header {
padding: 20px;
border-bottom: 0.5px solid var(--gray-outline);
&__info {
color: var(--font-gray);
margin-top: 5px;
font-size: 90%;
white-space: nowrap;
}
i {
color: var(--font-gray);
font-size: 13px;
vertical-align: middle;
margin-right: 6px;
}
.icon-clock, .explanation {
position: relative;
display: inline-block;
margin-left: 9px;
padding-left: 9px;
&:after {
content: "";
width: 1.5px;
height: 94%;
top: 3%;
position: absolute;
left: 0;
background: var(--gray-outline);
}
}
}
&__body {
position: relative;
max-height: calc(100vh - 160px);
overflow-y: auto;
&__grouped {
margin: 25px 0;
position: relative;
&:last-child {
margin: 25px 0 0;
}
background-image: linear-gradient(
to bottom,
transparent 18px,
var(--gray-outline) 18px,
var(--gray-outline) 19px,
transparent 19px
);
}
&__day {
position: sticky;
top: 10px;
z-index: 10;
}
&__date {
text-align: center;
margin: 15px 0;
span {
background: #fff;
font-weight: 700;
padding: 10px 18px;
border: 1px solid var(--gray-outline);
display: inline-block;
border-radius: 30px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
}
}
&__input {
margin: 15px auto;
border: 1px solid var(--gray-input-dark);
width: calc(100% - 30px);
border-radius: 4px;
padding: 5px;
display: flex;
input {
border: none;
padding: 8px 10px;
flex: 1;
font-size: 105%;
outline: none;
}
button {
flex: 0 0 auto;
background: none;
border: 0;
font-size: 1.2rem;
cursor: pointer;
padding: 12px 12px 5px;
border-radius: 5px;
&:hover {
background: var(--gray-lightest);
}
}
}
}
.message {
display: flex;
padding: 10px 20px;
cursor: default;
&:hover {
background: var(--gray-lightest);
}
&__profile {
flex: 0 0 60px;
img {
width: 48px;
height: 48px;
border-radius: 6px;
}
}
&__content {
flex: 1;
}
&__sender {
margin-top: 2px;
.name {
font-weight: 900;
margin-right: 8px;
color: var(--font);
text-decoration: none;
&:hover {
text-decoration: underline;
text-decoration-thickness: 1em;
}
}
.time {
font-size: 75%;
color: var(--gray-font);
}
}
&__text {
margin: 8px 0 12px;
p {
line-height: 1.2;
&.list {
line-height: 1.5;
}
}
}
&__link {
padding-left: 18px;
position: relative;
&:before {
content: '';
position: absolute;
left: 0;
top: 0;
height: calc(100% - 3px);
width: 5px;
background: var(--gray-outline);
border-radius: 30px;
}
&__site {
margin: 8px 0;
img {
width: 20px;
height: 20px;
border-radius: 2px;
margin-right: 8px;
vertical-align: middle;
}
span {
font-weight: 900;
vertical-align: middle;
}
}
&__text {
line-height: 1.35;
p {
margin-top: 4px;
}
}
}
&__image {
margin-top: 10px;
img {
width: 100%;
max-width: 380px;
height: 250px;
object-fit: cover;
object-position: top;
border-radius: 4px;
border: 1px solid var(--gray-outline);
}
}
}
::-webkit-scrollbar {
width: 7px;
height: 7px;
}
::-webkit-scrollbar-track {
background: #fff;
border-radius: 30px;
}
::-webkit-scrollbar-thumb {
background: var(--gray-input);
border-radius: 30px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--gray-input);
}
#self {
h2 {
margin: 10px 0;
}
}
.emoji-roll {
position: fixed;
z-index: 20;
font-size: 10rem;
top: 40%;
left: -15rem;
&.active {
animation: 2.4s roll forwards;
}
}
@keyframes roll {
0% {transform: translateX(0) rotate(0turn);}
100% {transform: translateX(150vw) rotate(2.0turn);}
}
function scrollBottom(el) {
var div = el + '-last';
document.getElementById(div).scrollIntoView(true);
}
$(document).ready(function(){
scrollBottom('ui-design');
randomizeTime();
});
$('a.sections__item').on('click', function(){
var sectionToShow = $(this).data('switch');
$('.sections__item, .channel').removeClass('active');
$(this).addClass('active');
$('#'+sectionToShow).addClass('active');
scrollBottom(sectionToShow);
});
function randomizeTime() {
$( ".js-time" ).each(function() {
var time = (Math.floor(Math.random() * 12) + 1) + ':' +(Math.floor(Math.random() * 50) + 10) + ' AM' ;
$(this).text(time);
});
}
$('.js-emoji').on('click', function(){
$('.emoji-roll').toggleClass('active');
setTimeout(function(){
$('.emoji-roll').removeClass('active')
}, 2500);
});
Also see: Tab Triggers