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.
<script type="text/javascript" src="https://snxd.akamaized.net/js/stamp-1.0.14.js"></script>
<div ng-app="multi-repo-app" ng-controller="multi-repo-cart" id="multi-repo-app">
<table>
<tr>
<th><h4>Mission</h4></th>
<th><h4>Sample</h4></th>
<th><h4>Description</h4></th>
<th><h4>Size</h4></th>
<th><h4>Download</h4></th>
</tr>
<tr ng-repeat="item in items">
<td>
<b>{{ item.name }}</b>
<br>
<br>
<img ng-src="{{item.icon}}" />
</td>
<td>
<div ng-repeat="image in item.images">
<img ng-src="{{image}}" width="150" align="left" />
</div>
</td>
<td ng-bind-html="item.description"></td>
<td>{{ item.size }}</td>
<td>
<center>
<div class="item-in-cart">
<input class="download-item" id="checkbox-{{$index}}" type="checkbox" ng-model="item.checked" ng-change="checkItem()" value="None">
<label for="checkbox-{{$index}}"></label>
</div>
</center>
</td>
</tr>
</table>
<button class="alignright" disabled="disabled" ng-click="downloadItems()">
<i class="fa fa-download"></i> Download Selected Items</button>
</div>
#multi-repo-app .download-popup {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
#multi-repo-app table {
border-collapse: collapse;
background-color: white;
}
#multi-repo-app td,
#multi-repo-app th {
font-family: Open Sans;
font-size: 15px;
color: #535353;
vertical-align: top;
line-height: 1.6;
border: 0px solid lightgray;
}
#multi-repo-app td {
padding: 10px;
}
#multi-repo-app td:nth-child(1) {
width: 100px;
text-align: center;
}
#multi-repo-app td:nth-child(2) {
width: 170px;
text-align: center;
}
#multi-repo-app td:nth-child(5) {
width: 170px;
text-align: center;
}
#multi-repo-app td img {
padding-right: 6px;
padding-bottom: 6px;
}
#multi-repo-app th {
background-color: #e7e2e2;
}
#multi-repo-app th h4 {
font-weight: 700;
text-align: center;
text-transform: uppercase;
margin: 6px;
}
#multi-repo-app button {
font-family: Raleway, Open Sans;
font-weight: 600;
text-transform: uppercase;
border-width: 0px;
border-bottom: 3px;
border-color: #73353f;
border-style: solid;
border-radius: 4px;
padding: 8px;
padding-left: 16px;
padding-right: 16px;
background-color: #a24d4f;
color: white;
}
#multi-repo-app button:hover {
color: #f8f1d1;
cursor: pointer;
}
#multi-repo-app button:disabled {
background-color: #e0e0e0 !important;
border-color: lightgray !important;
color: #909090 !important;
}
#multi-repo-app button.alignright {
float: right;
}
#multi-repo-app .item-in-cart {
width: 20px;
position: relative;
}
#multi-repo-app .item-in-cart label {
width: 20px;
height: 20px;
cursor: pointer;
position: absolute;
top: 0;
left: 0;
background: #ffffff;
background: linear-gradient(to bottom, #ffffff 0%, #f1f1f1 40%, #cecece 100%);
border-radius: 4px;
border: 1px solid #c0c0c0;
}
#multi-repo-app .item-in-cart label:after {
content: '';
width: 9px;
height: 5px;
position: absolute;
top: 5px;
left: 4px;
border: 3px solid #333;
border-top: none;
border-right: none;
background: transparent;
opacity: 0;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
}
#multi-repo-app .item-in-cart label:hover::after {
opacity: 0.5;
}
#multi-repo-app .item-in-cart input[type=checkbox] {
visibility: hidden;
}
#multi-repo-app .item-in-cart input[type=checkbox]:checked+label:after {
opacity: 1;
}
#multi-repo-app td:nth-child(1) {
width: 80px;
text-align: center;
}
#multi-repo-app td:nth-child(2) {
width: 320px;
text-align: center;
}
#multi-repo-app td img {
padding-right: 6px;
padding-bottom: 6px;
}
angular.module('multi-repo-app', ['ngSanitize'])
.controller('multi-repo-cart', function ($scope) {
// List of all items available for download
$scope.items = [
{
"name": "Apollo 11",
"icon": "https://snxd.akamaized.net/demoassets/apollo11/apollo11.png",
"images": ["https://snxd.akamaized.net/demoassets/apollo11/apollo11-1.jpg", "https://snxd.akamaized.net/demoassets/apollo11/apollo11-2.jpg"],
"description": "Apollo 11 was the spaceflight that landed the first two humans on the Moon. Mission commander Neil Armstrong and pilot Buzz Aldrin, both American, landed the lunar module Eagle on July 20, 1969.<br><br><b>This set includes 143 high-resolution images of the Apollo 11 mission.</b>",
"size": "2.01GB",
"data":
{
"name": "Apollo 11",
"image": "https://snxd.akamaized.net/demoassets/apollo11/apollo11.png",
"repository": "apollo11"
}
},
{
"name": "Apollo 15",
"icon": "https://snxd.akamaized.net/demoassets/apollo15/apollo15.png",
"images": ["https://snxd.akamaized.net/demoassets/apollo15/apollo15-1.jpg", "https://snxd.akamaized.net/demoassets/apollo15/apollo15-2.jpg"],
"description": "Apollo 15 was the ninth manned mission in the United States' Apollo program, the fourth to land on the Moon. It was the first mission on which the Lunar Roving Vehicle was used. <br><br><b>This set includes 319 high-resolution images of the Apollo 15 mission.</b>",
"size": "1.06GB",
"data":
{
"name": "Apollo 15",
"image": "https://snxd.akamaized.net/demoassets/apollo15/apollo15.png",
"repository": "apollo15"
}
},
{
"name": "Apollo 17",
"icon": "https://snxd.akamaized.net/demoassets/apollo17/apollo17.png",
"images": ["https://snxd.akamaized.net/demoassets/apollo17/apollo17-1.jpg", "https://snxd.akamaized.net/demoassets/apollo17/apollo17-2.jpg"],
"description": "Apollo 17 was the final mission of NASA's Apollo program. The mission broke several records: the longest moon landing, longest total moonwalk, largest lunar sample, and longest time in lunar orbit. <br><br><b>This set includes 16 high-resolution images of the Apollo 17 mission.</b>",
"size": "118MB",
"data":
{
"name": "Apollo 17",
"image": "https://snxd.akamaized.net/demoassets/apollo17/apollo17.png",
"repository": "apollo17"
}
}
];
$scope.getCartItems = function() {
// Get the items to send to the stamping service
var items = [];
for (var i = 0; i < $scope.items.length; i += 1) {
if ($scope.items[i].checked === true) {
items.push($scope.items[i].data);
}
}
return items;
};
$scope.checkItem = function() {
// Assign disabled css class to download button based on if items selected
var button = angular.element("#multi-repo-app button");
if ($scope.getCartItems().length == 0) {
button.prop('disabled', true);
} else {
button.prop('disabled', false);
}
};
$scope.downloadItems = function () {
var directDlm = createDirectDlm();
directDlm.setIdWin("ba055d09-dfca-4ef3-91f5-fbbb6a199804");
directDlm.setIdMac("9db26d11-5064-4421-a0c9-2113e5a79df1");
directDlm.setFilename("MultiRepoDLM");
directDlm.addItems($scope.getCartItems());
directDlm.download();
};
});
Also see: Tab Triggers