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.
Go to <a href="https://soapstone.retzudo.com" target="_blank">soapstone.retzudo.com</a> for a live version.
<hr>
<div ng-app="SoapstoneApp">
<div ng-controller="SoapstoneController">
<table>
<tbody>
<tr>
<th>Templates</th>
<td>
<select ng-options="index as template for (index, template) in templates" ng-model="templateIndexOne"></select>
</td>
</tr>
<tr>
<th>Words</th>
<td>
<select ng-options="v as k for (k, v) in categories" ng-model="categoryOne" ng-disabled="!templateIndexOne"></select>
<select ng-options="word as word for word in categoryOne" ng-model="wordOne" ng-disabled="!categoryOne" ng-change="updateCode()"></select>
</td>
</tr>
<tr class="conjunctions">
<th>Conjunctions</th>
<td>
<select ng-options="index as conjunction for (index, conjunction) in conjunctions" ng-model="conjunctionIndex" ng-disabled="!wordOne" ng-change="updateCode()"></select>
</td>
</tr>
<tr ng-hide="conjunctionIndex === '0' || conjunctionIndex === undefined">
<th>Templates (2nd Line)</th>
<td>
<select ng-options="index as template for (index, template) in templates" ng-model="templateIndexTwo"></select>
</td>
</tr>
<tr ng-hide="conjunctionIndex === '0' || conjunctionIndex === undefined">
<th>Words (2nd Line)</th>
<td>
<select ng-options="v as k for (k, v) in categories" ng-model="categoryTwo" ng-disabled="!templateIndexTwo"></select>
<select ng-options="word as word for word in categoryTwo" ng-model="wordTwo" ng-disabled="!categoryTwo" ng-change="updateCode()"></select>
</td>
</tr>
</tbody>
</table>
<a class="code" ng-href="https://soapstone.retzudo.com/{{ code }}" ng-show="code" target="_blank">https://soapstone.retzudo.com/{{ code }}</a>
</div>
</div>
body
background black
color white
font-family 'Lora', serif;
font-size 24px
th
font-weight normal
text-align right
border-bottom 2px solid rgba(255, 255, 255, 0.7)
.code
display block
text-align center
font-size 2rem
(function () {
'use strict';
const TEMPLATES = [
'**** ahead',
'No **** ahead',
'**** required ahead',
'be wary of ****',
'try ****',
'Could this be a ****?',
'If only I had a ****...',
'visions of ****...',
'Time for ****',
'****',
'****!',
'****?',
'****...',
'Huh. It\'s a ****...',
'praise the ****!',
'Let there be ****',
'Ahh, ****...'
];
const CONJUNCTIONS = [
'',
'and then',
'therefore',
'in short',
'or',
'only',
'by the way',
'so to speak',
'all the more',
','
];
const CATEGORIES = {
'Creatures': [
'enemy',
'monster',
'mob enemy',
'tough enemy',
'critical foe',
'Hollow',
'pilgrim',
'prisoner',
'monstrosity',
'skeleton',
'ghost',
'beast',
'lizard',
'bug',
'grub',
'crab',
'dwarf',
'giant',
'demon',
'dragon',
'knight',
'sellword',
'warrior',
'herald',
'bandit',
'assassin',
'sorcerer',
'pyromancer',
'cleric',
'deprived',
'sniper',
'duo',
'trio',
'you',
'you bastard',
'good fellow',
'saint',
'wretch',
'charmer',
'poor soul',
'oddball',
'nimble one',
'laggard',
'moneybags',
'beggar',
'miscreant',
'liar',
'fatty',
'beanpole',
'youth',
'elder',
'old codger',
'old dear',
'merchant',
'artisan',
'master',
'sage',
'champion',
'Lord of Cinder',
'king',
'queen',
'prince',
'princess',
'angel',
'god',
'friend',
'ally',
'spouse',
'covenantor',
'Phantom',
'Dark Spirit'
],
'Objects': [
'bonfire',
'ember',
'fog wall',
'lever',
'contraption',
'key',
'trap',
'torch',
'door',
'treasure',
'chest',
'something',
'quite something',
'rubbish',
'filth',
'weapon',
'shield',
'projectile',
'armor',
'item',
'ring',
'ore',
'coal',
'transposing kiln',
'scroll',
'umbral ash',
'throne',
'rite',
'coffin',
'cinder',
'ash',
'moon',
'eye',
'brew',
'soup',
'message',
'bloodstain',
'illusion'
],
'Techniques': [
'close-ranged battle',
'ranged battle',
'eliminating one at a Time',
'luring it out',
'beating to a pulp',
'ambush',
'pincer attack',
'hitting them in one swoop',
'duel-wielding',
'stealth',
'mimicry',
'fleeing',
'charging',
'jumping off',
'dashing through',
'circling around',
'trapping inside',
'rescue',
'Skill',
'sorcery',
'pyromancy',
'miracles',
'pure luck',
'prudence',
'brief respite',
'play dead'
],
'Actions': [
'jog',
'dash',
'rolling',
'backstepping',
'jumping',
'attacking',
'jump attack',
'dash attack',
'counter attack',
'stabbing in the back',
'guard stun & stab',
'plunging attack',
'shield breaking',
'blocking',
'parrying',
'locking-on',
'no lock-on',
'two-handing',
'gesture',
'control',
'destroy'
],
'Geography': [
'boulder',
'lava',
'poison gas',
'enemy horde',
'forest',
'swamp',
'cave',
'shortcut',
'detour',
'hidden path',
'secret passage',
'dead end',
'labyrinth',
'hole',
'bright spot',
'dark spot',
'open area',
'tight spot',
'safe zone',
'danger zone',
'sniper spot',
'hiding place',
'illusory wall',
'ladder',
'lift',
'gorgeous view',
'looking away',
'overconfidence',
'slip-up',
'oversight',
'fatigue',
'bad luck',
'inattention',
'loss of stamina',
'chance encounter',
'planned encounter'
],
'Orientation': [
'front',
'back',
'left',
'right',
'up',
'down',
'below',
'above',
'behind'
],
'Body parts': [
'head',
'neck',
'stomach',
'back',
'armor',
'finger',
'leg',
'rear',
'tail',
'wings',
'anywhere',
'tongue',
'right arm',
'left arm',
'thumb',
'indexfinger',
'longfinger',
'ringfinger',
'smallfinger',
'right leg',
'left leg',
'right side',
'left side',
'pincer',
'wheel',
'core',
'mount'
],
'Attribute': [
'regular',
'strike',
'thrust',
'slash',
'magic',
'crystal',
'fire',
'chaos',
'lightning',
'blessing',
'dark',
'critical hits',
'bleeding',
'poison',
'toxic',
'frost',
'curse',
'equipment breakage'
],
'Concepts': [
'chance',
'quagmire',
'hint',
'secret',
'sleeptalk',
'happiness',
'misfortune',
'life',
'death',
'demise',
'joy',
'fury',
'agony',
'sadness',
'tears',
'loyalty',
'betrayal',
'hope',
'despair',
'fear',
'losing sanity',
'victory',
'defeat',
'sacrifice',
'light',
'dark',
'bravery',
'confidence',
'vigor',
'revenge',
'resignation',
'overwhelming',
'regret',
'pointless',
'man',
'woman',
'friendship',
'love',
'recklessness',
'composure',
'guts',
'comfort',
'silence',
'deep',
'dregs',
],
'Musings': [
'good luck',
'fine work',
'I did it!',
'I\'ve failed...',
'here!',
'not here!',
'I can\'t take this...',
'lonely...',
'don\'t you dare!',
'do it!',
'look carefully',
'listen carefully',
'think carefully',
'this place again?',
'now the real fight begins',
'you don\'t deserve this',
'keep moving',
'pull back',
'give it up',
'don\'t give up',
'help me...',
'impossible...',
'bloody expensive...',
'let me out of here...',
'stay calm',
'like a dream...',
'seems familiar...',
'are you ready?',
'it\'ll happen to you too',
'praise the Sun!',
'may the flames guide thee',
]
};
angular.module('SoapstoneApp', []).controller('SoapstoneController', $scope => {
$scope.templates = TEMPLATES;
$scope.categories = CATEGORIES;
$scope.conjunctions = CONJUNCTIONS;
$scope.code = '';
$scope.updateCode = () => {
var words = _.chain(CATEGORIES).values().flatten().value();
var templateOneCode = parseInt($scope.templateIndexOne).toString(17);
var wordOneCode = _.indexOf(words, $scope.wordOne).toString(36);
if (wordOneCode.length === 1) {
wordOneCode = '0' + wordOneCode;
}
$scope.code = templateOneCode + wordOneCode;
var conjunctionIndex = parseInt($scope.conjunctionIndex);
if (conjunctionIndex && conjunctionIndex !== 0 && $scope.wordTwo) {
var conjunctionCode = (conjunctionIndex - 1).toString(10);
var templateTwoCode = parseInt($scope.templateIndexTwo).toString(17);
var wordTwoCode = _.indexOf(words, $scope.wordTwo).toString(36);
if (wordTwoCode.length === 1) {
wordTwoCode = '0' + wordTwoCode;
}
$scope.code = $scope.code + conjunctionCode + templateTwoCode + wordTwoCode;
}
};
});
}());
Also see: Tab Triggers