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.
<body ng-app="BlankApp" ng-cloak>
<md-toolbar class="header">
<img src="https://checkout.paystand.co/v4/demo/ps-hood-white.png" class="logo" /> PayStand Pacific Condos
</md-toolbar>
<md-content class="md-padding">
<p>Welcome to PayStand Pacific Condominiums. Please enter your lease contract details below to pay your application fee, submit your security deposit and setup your monthly rent.</p>
<form name="condoLeaseForm" ng-controller="leaseController" novalidate layout-margin>
<div layout="row">
<div flex layout="column">
<md-input-container flex-offset="50">
<label>Lease Agreement Number</label>
<input name="leaseNumber" ng-model="leaseNumber" required md-maxlength="6" minlength="6">
<div ng-messages="condoLeaseForm.leaseNumber.$error" ng-show="condoLeaseForm.leaseNumber.$dirty">
<div ng-message="required">Lease number is required!</div>
<div ng-message="md-maxlength">Lease number should be exactly 6 characters!</div>
<div ng-message="minlength">Lease number should be exactly 6 characters!</div>
</div>
</md-input-container>
<md-input-container>
<label>Tentant(s) Full Name</label>
<input name="fullName" ng-model="fullName" required md-maxlength="40" md-minlength="4">
<div ng-messages="condoLeaseForm.fullName.$error" ng-show="condoLeaseForm.fullName.$dirty">
<div ng-message="required">Full name is required!</div>
<div ng-message="maxlength">Not more than the first 40 characters!</div>
<div ng-message="minlength">Full name should be at least 4 characters!</div>
</div>
</md-input-container>
<md-input-container>
<label>Property Address</label>
<input name="address" ng-model="address" required md-maxlength="125">
<div ng-messages="condoLeaseForm.address.$error" ng-show="condoLeaseForm.address.$dirty">
<div ng-message="required">Lease number is required!</div>
<div ng-message="md-maxlength">Address cannot be longer than 125 characters!</div>
</div>
</md-input-container>
<md-datepicker name="startDate" ng-model="startDate" md-placeholder="Start date" required md-min-date="now();" md-max-date="maxDate"></md-datepicker>
<div class="validation-messages" ng-messages="condoLeaseForm.startDate.$error" ng-show="condoLeaseForm.startDate.$dirty">
<div ng-message="valid">The entered value is not a valid date!</div>
<div ng-message="required">The start date is required!</div>
<div ng-message="mindate">The start date cannot be in the past!</div>
<div ng-message="maxdate">Date is too late!</div>
</div>
<div layout="row" layout-align="space-between">
<md-input-container>
<label>Monthly Rent</label>
<input name="rent" ng-model="rent" required type="number" text-align="right" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/" step="0.01">
<div ng-messages="condoLeaseForm.rent.$error" ng-show="condoLeaseForm.rent.$dirty">
<div ng-message="required">Rent is required!</div>
</div>
</md-input-container>
<md-input-container>
<label>Term in months</label>
<input name="term" ng-model="term" required type="number" step="any" min="3" max="36" ng-pattern="/[0-9]{1,2}/">
<div ng-messages="condoLeaseForm.term.$error" ng-show="condoLeaseForm.term.$dirty">
<div ng-message="required">Term is required!</div>
<div ng-message="min">Minimum 3 months!</div>
<div ng-message="max">Maximum 36 months!</div>
</div>
</md-input-container>
</div>
<md-input-container>
<label>Notes</label>
<textarea name="notes" ng-model="notes" md-maxlength="150" placeholder="Any additional notes as needed"></textarea>
<div ng-messages="condoLeaseForm.notes.$error" ng-show="condoLeaseForm.notes.$dirty">
<div ng-message="md-maxlength">That's too long!</div>
</div>
</md-input-container>
</div>
<div flex flex-gt-xs="50" layout-padding layout-margin>
<div class="md-whiteframe-2dp" layout="column">
<md-subheader class="md-primary">
<h1>Summary</h1></md-subheader>
<md-list>
<md-list-item>
<p>Lease</p>{{leaseNumber}}
</md-list-item>
<md-list-item>
<p>Tenant</p>{{fullName}}
</md-list-item>
<md-list-item>
<p>Property</p>{{address}}
</md-list-item>
<md-list-item>
<p>Application Fee</p>$50.00
</md-list-item>
<md-list-item>
<p>Security Deposit</p>{{3 * rent | currency}}
</md-list-item>
<md-list-item>
<p>Monthly Rent</p>{{1 * rent | currency}}
</md-list-item>
<md-list-item>
<p>Start</p>{{startDate | date}}
</md-list-item>
<md-list-item>
<p>Lease Term</p>{{1 * term}}
</md-list-item>
<md-divider></md-divider>
<md-list-item>
<md-button class="md-primary md-raised" aria-label="Enter payment method" id="dialogWayPoint" type="submit" layout-fill ng-click="schedulePayment();" ng-disabled="condoLeaseForm.$invalid">
Enter payment method
</md-button>
</md-list-item>
</md-list>
</div>
</div>
</div>
</form>
</md-content>
<md-divider></md-divider>
<div class="footer">
<md-button class="md-accent md-raised md-hue-2">This is a demo system</md-button>
<p>Copyright 2016 PayStand Inc</p>
</div>
<script type="text/javascript" id="paystand_checkout" src="https://checkout.paystand.co/v4/js/paystand.checkout.js" ps-env="sandbox" ps-publishable-key="1noqhele1yjgieoi8aqe4n8i" ps-width="400px" ps-height="750px" ps-preset-name="scheduledPayment" ps-includes="disableCards,showReceipt"></script>
</body>
.logo {
max-width: 108px;
height: auto;
padding-bottom: 20px;
}
.header {
padding: 20px;
align-items: center;
font-size: xx-large;
}
.footer {
padding: 10px;
text-align: center;
width: 100%;
}
input[type=number] {
text-align: right;
}
.co-dialog {
width: 400px;
margin: 30px 30px 30px 30px;
}
.md-dialog-container {
display: flex;
justify-content: flex-end;
position: absolute;
align-items: flex-start;
left: 0;
top: 0;
width: 100%;
height: 1000px !important;
}
/**
* You must include the dependency on 'ngMaterial'
*/
angular.module('BlankApp', ['ngMaterial', 'ngMessages'])
.controller('leaseController', function($scope, $mdDialog) {
angular.extend($scope, {
"fullName": null,
"address": null,
"leaseNumber": null,
"rent": null,
"term": null,
"startDate": null,
"notes": null
});
$scope.schedulePayment = function() {
PayStandCheckout.reset({
"resources": {
"payer": {
"name": $scope.fullName
},
"meta": {
"fullName": $scope.fullName,
"address": $scope.address,
"leaseNumber": $scope.leaseNumber,
"rent": $scope.rent,
"term": $scope.term,
"startDate": $scope.startDate,
"notes": $scope.notes
},
"scheduledPayment": {
"name": "Lease number: " + $scope.leaseNumber,
"description": $scope.address,
"currency": "USD",
"scheduledItems": [{
"name": "Application Fee",
"description": "One time application fee of $50.00",
"schedule": {
"name": "Application Fee",
"description": "Pay a one time non-refundable application fee"
},
"amount": "50.00"
}, {
"name": "Security Deposit",
"description": "Refundable security deposit of 3 times the monthly rent",
"schedule": {
"name": "Security Deposit",
"dateStart": $scope.startDate,
},
"amount": 3 * $scope.rent
}, {
"name": "Monthly Rent",
"description": "Rent of $1200 is due on the first of every month",
"schedule": {
"name": "Rent",
"description": "Pay rent on the 1st of the month",
"interval": "month",
"intervalCount": "1",
"anchor": "start",
"dateStart": $scope.startDate,
"timesToRun": $scope.term
},
"amount": $scope.rent
}]
}
}
})
.showCheckout();
};
});
Also see: Tab Triggers