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 URL's added here will be added as <link>
s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.
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.
If the stylesheet 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 CSS 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.
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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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.
<html lang="en" >
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Angular Material style sheet -->
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.12/angular-material.min.css">
<link href="https://fonts.googleapis.com/css?family=Cute+Font" rel="stylesheet">
</head>
<body ng-app="MyApp" ng-controller="AppCtrl">
<!-- Your HTML content here -->
<!-------- Today's theme --------->
<div layout="row" class="theme" layout-align="center center">62.Workout of the day, 63.Best of 2015, 64.Select User Type, 65.Notes Widget, 66.Statistics</div>
<!-------- Working area --------->
<div class="working-area">
<md-toolbar>
<div class="md-toolbar-tools">
<h3 >
Workout Of the day
</h3>
</div>
</md-toolbar>
<div layout="row" layout-align="center center">
<img src="https://media1.popsugar-assets.com/files/thumbor/XJJEB1cIhAyU5K9tzgJidhvzxVM/fit-in/2048xorig/filters:format_auto-!!-:strip_icc-!!-/2017/04/13/738/n/1922729/87033ecd04363271_standingab.gif">
</div>
<md-toolbar style="margin-top: 12px;">
<div class="md-toolbar-tools">
<h3 >
Best workout of 2015
</h3>
</div>
</md-toolbar>
<div layout="row" layout-align="center center"><img src="https://ne-kurim.ru/forum/attachments/42e6a7cd223913a1_betterkneething-gif.764325/"></div>
<div ng-if="status" id="status">
<b layout="row" layout-align="center center" class="md-padding">
{{status}}
</b>
</div>
<div layout="row" layout-align="space-between center">
<span ng-click="showPrompt($event)"><img class="icons" src="https://cdn2.iconfinder.com/data/icons/picol-vector/32/notes_add-256.png"></span>
<span ng-click="showAdvanced($event)"><img class="icons" src="https://cdn2.iconfinder.com/data/icons/picol-vector/32/statistics-256.png"></span>
<span ng-click="showOptions($event)"><img class="icons" src="https://cdn4.iconfinder.com/data/icons/app-custom-ui-1/48/Account-256.png"></span>
</div>
</div>
<!-------- Footer --------->
<div id="footer_container">
<div layout="row" layout-align="center center"><h3>Youtube tutorial <a href="https://youtu.be/2ihKU2E5Mcc" target="_blank"> here!</a></h3></div><br>
<div layout="row" layout-align="center center">Created by Eleftheria</div>
<div layout="row" layout-align="center center" class="footer">
<!-- Linkedin -->
<a href="https://www.linkedin.com/in/eleftheriabatsou/" target="_blank"><img src="https://image.flaticon.com/icons/svg/39/39714.svg" class="footer_image" alt="linkedin" title="linkedin"></a> ~
<!-- Codepen -->
<a href="https://codepen.io/EleftheriaBatsou" target="_blank"><img src="https://image.flaticon.com/icons/svg/51/51767.svg" class="footer_image" alt="codepen" title="codepen"></a> ~
<!-- Youtube -->
<a href="https://www.youtube.com/c/EleftheriaBatsou" target="_blank"><img src="https://image.flaticon.com/icons/svg/733/733646.svg" class="footer_image" alt="youtube" title="youtube"></a> ~
<!-- Twitter -->
<a href="https://twitter.com/BatsouElef" target="_blank"><img src="https://image.flaticon.com/icons/svg/8/8800.svg" class="footer_image" alt="twitter" title="twitter"></a> ~
<!-- Github -->
<a href="https://github.com/EleftheriaBatsou" target="_blank"><img src="https://image.flaticon.com/icons/svg/25/25231.svg" class="footer_image" alt="github" title="github"></a> ~
<!-- Instagram -->
<a href="https://www.instagram.com/eleftheriabatsou/" target="_blank"><img src="https://image.flaticon.com/icons/svg/69/69366.svg" class="footer_image" alt="instagram" title="instagram"></a> ~
<!-- Website -->
<a href="http://www.eleftheriabatsou.com" target="_blank"><img src="https://image.flaticon.com/icons/svg/484/484101.svg" class="footer_image" alt="website" title="website"></a>
</div>
</div>
<script type="text/ng-template" id="dialog1.tmpl.html">
<md-dialog>
<form>
<md-toolbar>
<div class="md-toolbar-tools">
<h2>Statistics</h2>
<md-button class="md-icon-button" ng-click="cancel()">
<md-icon md-svg-src="img/icons/ic_close_24px.svg" aria-label="Close dialog"></md-icon>
</md-button>
</div>
</md-toolbar>
<md-dialog-content>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Eu feugiat pretium nibh ipsum. Ipsum suspendisse ultrices gravida dictum fusce. Tristique magna sit amet purus gravida quis blandit turpis cursus. Magna etiam tempor orci eu lobortis elementum nibh tellus. Fermentum et sollicitudin ac orci phasellus egestas tellus. Mi in nulla posuere sollicitudin aliquam ultrices sagittis orci. Pellentesque dignissim enim sit amet venenatis urna cursus eget nunc. Fermentum odio eu feugiat pretium. Tellus molestie nunc non blandit massa enim nec dui. Cras sed felis eget velit aliquet sagittis id. Elit scelerisque mauris pellentesque pulvinar pellentesque. Nisi lacus sed viverra tellus in hac habitasse. Ornare lectus sit amet est placerat in egestas erat imperdiet. Sem et tortor consequat id. Tellus molestie nunc non blandit massa enim nec. Turpis tincidunt id aliquet risus feugiat in ante. Mi bibendum neque egestas congue quisque egestas. Massa ultricies mi quis hendrerit.
</p><p>
Diam quis enim lobortis scelerisque fermentum. Ac tortor dignissim convallis aenean et tortor. Purus faucibus ornare suspendisse sed nisi lacus. Aliquam ut porttitor leo a diam sollicitudin tempor id. Leo duis ut diam quam nulla porttitor massa id. Eu ultrices vitae auctor eu augue ut lectus. Id cursus metus aliquam eleifend mi in. Cursus metus aliquam eleifend mi in nulla posuere sollicitudin. At consectetur lorem donec massa sapien faucibus et molestie. At volutpat diam ut venenatis tellus. Dignissim diam quis enim lobortis scelerisque. Quisque non tellus orci ac auctor augue mauris augue. Tincidunt dui ut ornare lectus sit. Nisi porta lorem mollis aliquam ut porttitor leo a diam. Pretium viverra suspendisse potenti nullam. Accumsan in nisl nisi scelerisque eu ultrices vitae auctor eu. Aliquet risus feugiat in ante metus dictum at tempor commodo. Facilisis sed odio morbi quis commodo odio. Enim lobortis scelerisque fermentum dui faucibus in ornare quam viverra. Gravida neque convallis a cras semper.</p>
<div ng-controller="SelectAsyncController" layout="column" layout-align="center center" style="padding:40px" ng-cloak>
<p>Select can call an arbitrary function on show. If this function returns a promise, it will display a loading indicator while it is being resolved:</p>
<div layout="column" layout-align="center center">
<md-select placeholder="Assign to user" ng-model="user" md-on-open="loadUsers()" style="min-width: 200px;">
<md-option ng-value="user" ng-repeat="user in users">{{user.name}}</md-option>
</md-select>
<p class="md-caption">You have assigned the task to: {{ user ? user.name : 'No one yet' }}</p>
</div>
</div>
</md-dialog-content>
</form>
</md-dialog>
</script>
<script type="text/ng-template" id="dialog2.tmpl.html">
<md-dialog>
<form>
<md-toolbar>
<div class="md-toolbar-tools">
<h2>Choose your category</h2>
<md-button class="md-icon-button" ng-click="cancel()">
<md-icon md-svg-src="img/icons/ic_close_24px.svg" aria-label="Close dialog"></md-icon>
</md-button>
</div>
</md-toolbar>
<md-dialog-content>
<div layout="column" layout-align="center center">
<md-select placeholder="Please select" ng-model="user" md-on-open="loadUsers()" style="min-width: 200px;">
<md-option ng-value="user" ng-repeat="user in users">{{user.name}}</md-option>
</md-select>
<p class="md-caption">You have choose: {{ user ? user.name : 'Nothing yet' }}</p>
</div>
</md-dialog-content>
</form>
</md-dialog>
</script>
</body>
</html>
body {
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAATklEQVQoU2O0O3X+PwMDA8MhM0NGEI0LMBKtEJsJD27YgW1R0DgEtwWrdUQrxGYLY8V5iDUdhghrKFOITfenmXFgW/jSF+H3DNEKsdkCAO99IAvXcD3VAAAAAElFTkSuQmCC') repeat;
}
.theme {
padding: 32px 0;
font-family: 'Pacifico', cursive;
}
.working-area {
width: 320px;
height: 630px;
margin: 0 auto;
background-color: white;
border: yellow 8px solid;
}
.icons {
width: auto;
height: 42px;
}
#footer_container {
font-family: 'Pacifico', cursive;
}
.footer .footer_image {
height: 24px;
width:24px;
text-align: center;
padding: 4px;
}
.footer .footer_image:hover,
#footer_container a:hover {
background-color: lightblue;
}
#footer_container a:link,
#footer_container a:active{
color: #dc1767;
}
angular.module('MyApp', ['ngMaterial', 'ngMessages', 'material.svgAssetsCache'])
.controller('AppCtrl', function($scope, $mdDialog) {
$scope.showPrompt = function(ev) {
// Appending dialog to document.body to cover sidenav in docs app
var confirm = $mdDialog.prompt()
.title('Note s Widget')
.textContent('Enter your note below')
.placeholder('I am a note!!')
.ariaLabel('note here')
.initialValue('I am a note!!')
.targetEvent(ev)
.required(true)
.ok('Okay!')
.cancel('No, I will not a dd a note');
$mdDialog.show(confirm).then(function(result) {
$scope.status = 'Your note is: ' + result + '.';
}, function() {
$scope.status = 'You didn\'t add a note';
});
};
$scope.showAdvanced = function(ev) {
$mdDialog.show({
controller: DialogController,
templateUrl: 'dialog1.tmpl.html',
parent: angular.element(document.body),
targetEvent: ev,
clickOutsideToClose:true,
fullscreen: $scope.customFullscreen
})
.then(function(answer) {
}, function() {
});
}
$scope.showOptions = function(ev) {
$mdDialog.show({
controller: DialogController,
templateUrl: 'dialog2.tmpl.html',
parent: angular.element(document.body),
targetEvent: ev,
clickOutsideToClose:true,
fullscreen: $scope.customFullscreen
})
.then(function(answer) {
}, function() {
});
}
function DialogController($scope, $mdDialog) {
$scope.user = null;
$scope.users = null;
$scope.users = $scope.users || [
{ id: 1, name: 'Newbie' },
{ id: 2, name: 'Senior' },
{ id: 3, name: 'Super-Advanced' }
];
$scope.hide = function() {
$mdDialog.hide();
};
$scope.cancel = function() {
$mdDialog.cancel();
};
$scope.answer = function(answer) {
$mdDialog.hide(answer);
};
}
});
Also see: Tab Triggers