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.
// The outermost container div to maintain aspect ratio
#outer.flex-col
// Each section will appear as a 'row' in the main container, but
// the sections themselves will
section#header.flex-row
.accent-tri--outer.accent-tri
.accent-tri--inner.accent-tri
.accent-tri--inner-2.accent-tri
.copy
span.upper.oxide Alpha
section#content.flex-row
.flex-col
.copy
header
h1.tk-ambroise-francois-std.upper Paid to Play
span.subtle.tk-acumin-pro-extra-condensed Videogames are the Grim Future of Work
span.byline.upper.tk-acumin-pro-semi-condensed By Clive Thompson
p
span.lead.upper.oxide Look at economic data
.
closely and the trends aren’t pretty: People with elite backgrounds are hoovering up an increasing share of new income and wealth. Automation is obviating more and more jobs. In the years to come, we’ll need new forms of employment. Let’s crystal-ball this: Will there be a new way for the working class of the future to earn a paycheck? Sure. Playing videogames.
span.pilcrow
.
That’s the bold prediction of Edward Castronova, an academic at Indiana University who studies the economics of online games. In a white paper released last fall, he argues that within 20 years, “playing games for money will come to be seen as a legitimate occupational choice for those whose skills are not valued by brick-and-mortar labor markets.”
span.pilcrow
.
Sounds nuts, right? But Castronova lays out the trend lines. First, consider how online games have evolved. Fifteen years ago you typically paid about $15 a month to play. But in the past decade, game companies have devised the free-to-play model: It costs nothing to join the action, but if you want something cool—specialty armor, a “mount” for traveling faster—you have to buy it. This model has been wildly profitable. A top-rated free-to-play title, like Clash Royale, now brings in about $2.1 million a day from such purchases.
span.pilcrow
.
Here’s the thing, though: As with casinos, most of the revenue comes from “whales,” a tiny percentage of players who spend thousands annually. A study last spring by Swrve (a firm
img(src='https://assets.wired.com/photos/w_582/wp-content/uploads/2017/02/thompson-videogames-1.png')
.flex-col
.copy
p
.
that helps companies market their in-game items) discovered that just 0.2 percent of players are responsible for 48 percent of all revenue. In effect, a small population of high-spending players is subsidizing the masses.
p.
Castronova predicts that economic trends will force those subsidies to grow. Think about it: Automation will create huge masses of unemployed would-be factory workers. The superrich will number fewer and fewer and get richer and richer. Which means game companies will drift toward a virtual-world New Deal. They’ll have to soak their whales more and more to stay in business, but keeping them happy will require making sure their worlds are vibrant communities. So the game companies need those low-spending, poorer folks to show up. Rich players don’t want to play with bots; they crave the social fellowship of real humans. And they also enjoy the thrill of lording their socioeconomic status over others. (It’s casino psychology again: “The big shots want to walk into a crowded casino and go into the high rollers’ room,” Castronova says, “walking past a guy like me playing craps.”)
p.
That means the game companies will have to underwrite poor players. In the next 10 years, the companies might issue reward cards, spendable in the real world. But eventually, 20 years on, the companies might find they need to pay to keep the proles alive and in the game.
p.
Let’s be clear. This would not be, as Castronova himself acknowledges, utopia. This would be game design via Marx’s immiseration theory. “It’s not a good life,” Castronova says—not merely because of the likely-skimpy wages, but because of the isolation. Now, low-skill gamers with few other work options might be happy enough at this work; as economist Erik Hurst has found, when today’s non-college-educated men drop out of the workforce, they mostly play games anyway. “This feels like something that is going to happen,” says Mike Sellers, a veteran of free-to-play firms and a professor at Indiana University.
p.
And I have a sinking feeling that Castronova is onto something. Political leaders are doing little to prepare the US for automation-propelled job loss. In that absence, the market will chart its own path, and that makes schemes like this all too plausible. When it comes to the game of real-world economics, people have no choice but to play.
section#footer.flex-row.upper.oxide
.reg-col
span Mar 2017
.reg-col
span 🎨 Zohar Lazar
.reg-col
span clive@clivethompson.net
* {
box-sizing: border-box;
}
// Some reuseable components
@mixin triangle($height, $base) {
$heightVh: $height * 0.25vh;
$baseVh: $base * 0.25vh;
width: 0;
height: 0;
border-left: $heightVh solid transparent;
border-right: $heightVh solid transparent;
border-bottom: ($baseVh) solid #000;
&::after {
content: '';
position: absolute;
top: 0.25vh;
left: -($heightVh - 0.27vh);
width: 0;
height: 0;
border-left: ($heightVh - 0.22vh) solid transparent;
border-right: ($heightVh - 0.22vh) solid transparent;
border-bottom: ($baseVh - 0.4vh) solid white;
}
}
// Don't let body and html interfere with our _style_!
html, body {
height: 100%;
width: 100%;
display: block;
position: relative;
margin: 0;
padding: 0;
background: #000;
}
// Use relative properties for responsiveness and maintaining AR
#outer {
// General positioning:
position: relative;
height: 98vh;
width: 75.73vh;
margin: 1vh auto;
padding: 8.91vh 4.455vh 1vh 4.455vh;
background: #fff;
// For debugging:
//background: #e3c;
}
/* INDIVIDUAL SECTION STYLES */
// Header
#header {
font-size: 0.8vh;
letter-spacing: .08em;
font-weight: 600;
.copy {
border-bottom: 1px solid #000;
width: 50%;
padding-bottom: 5px;
margin-left: 10%;
}
.accent-tri {
content: '';
position: absolute;
bottom: -0.9vh;
left: 1.5vh;
@include triangle(9, 12);
z-index: 1;
}
.accent-tri--inner {
@include triangle(6, 7.5);
left: 3.2vh;
z-index: 5;
}
.accent-tri--inner-2 {
@include triangle(2.5, 4);
left: 3.95vh;
bottom: 0.05vh;
z-index: 10;
}
// For debugging:
//background: #a84;
}
// Main textual content
#content {
.flex-col {
width: 30%;
padding-bottom: 10px;
border-bottom: 20px solid #000;
p {
text-indent: 7px;
&:first-child {
text-indent: 0;
}
}
}
.copy {
display: block;
position: relative;
}
.flex-col:first-child {
width: 70%;
border: none;
align-self: stretch;
position: relative;
.pilcrow {
&::before {
content: '¶';
padding: 0 2px;
display: inline;
}
}
p {
text-indent: 0;
}
.copy {
max-width: 70%;
margin: 0 auto;
background: #fff;
margin-top: 30px;
z-index: 5;
header {
padding-bottom: 30px;
border-bottom: 20px solid #000;
margin-bottom: 10px;
h1 {
margin: 0 0 5px 0;
font-size: 5vh;
line-height: 0.8;
}
.byline {
display: block;
margin-top: 10px;
font-size: 1vh;
color: rgba(0, 0, 0, 0.54);
font-weight: 700;
}
}
}
}
img {
max-width: 100%;
position: absolute;
bottom: 0;
left: 0;
z-index: 1;
}
}
// Footer
#footer {
font-size: 0.8vh;
font-weight: 700;
letter-spacing: 0.08em;
padding: 20px 0 10px 0;
.reg-col {
display: inline-block;
width: 33.33%;
text-align: center;
}
.reg-col:first-child {
text-align: left;
}
.reg-col:last-child {
text-align: right;
}
span {
display: inline;
padding-bottom: 5px;
border-bottom: 1px solid #000;
}
}
/* GENERAL LAYOUT AND POSITIONING */
section {
position: relative;
}
/* FLEXBOX GRID CLASSES */
// Any block-level element considered a 'row' of our flex container
.flex-row {
// We will be using flexbox for the layout - it makes
// laying out text so much easier!
display: flex;
flex-direction: row;
}
.flex-col {
display: flex;
// Make sure the 'main' axis of these flexbox containers is vertical
flex-direction: column;
}
/* TYPOGRAPHY */
.oxide {
font-family: ff-oxide-solid-web,OxideSolidOT,oxidesolidot-webfont,HelveticaNeue-Bold,'Helvetica Neue Bold','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;
}
.upper {
text-transform: uppercase;
}
.subtle {
display: block;
color: rgba(0, 0, 0, 0.54);
font-size: 0.9em;
}
p {
margin: 0;
text-align: justify;
font-family: 'mrs-eaves-xl-serif-narrow';
//font-size: 0.62em;
font-size: 1.1vh;
display: block;
position: relative;
line-height: 1.4vh;
}
.lead {
font-weight: 900;
font-size: 0.7em;
}
Also see: Tab Triggers