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>
<div style:"text-align: center;">
<textarea id="code" style="width: 100%;display:none;" rows="11">
renter_0=>operation: 没住过
renter_1=>operation: 面试申请者啦
renter_2=>parallel: 面试通过
暂时搬不过来的话
需要先交定金
renter_3=>operation: 已支付定金
保留床位
renter_4=>operation: 现住客
renter_6=>operation: 曾住客
action_0=>subroutine: 申请面试
action_1=>subroutine: 定金支付|clickable:>http://lifelab-space.mikecrm.com/q7vetg2
action_2=>subroutine: 退宿
享有400元送别资金|clickable:>http://lifelab-space.mikecrm.com/Sp7bZiA
action_3=>subroutine: 延期
action_4=>subroutine: 房租及租金缴纳完毕|clickable:>http://lifelab-space.mikecrm.com/xperQLK
action_5=>subroutine: 面试
action_6=>condition: 投票
renter_0->action_0
action_0->renter_1
renter_1->action_5
action_5->renter_2
renter_2(path1,right)->action_1
renter_2(path2,bottom)->action_4
action_1->renter_3
renter_3(left)->action_4
action_4->renter_4
renter_4->action_3
action_3->renter_4
renter_4->action_2
action_2->renter_6
renter_6(right)->action_6
action_6(yes,top)->renter_2
action_6(no,right)->action_5
</textarea></div>
<div style="display:none;"><button id="run" type="button">Run</button></div>
<div style="text-align: center;">
<h2>我是谁,我在哪,我需要作什么</h2>
<div id="canvas" ></div>
</div>
</body>
window.onload = function() {
var btn = document.getElementById("run"),
cd = document.getElementById("code"),
chart;
(btn.onclick = function() {
var code = cd.value;
if (chart) {
chart.clean();
}
chart = flowchart.parse(code);
chart.drawSVG('canvas', {
// 'x': 30,
// 'y': 50,
'line-width': 3,
'maxWidth': 3, //ensures the flowcharts fits within a certian width
'line-length': 50,
'text-margin': 10,
'font-size': 14,
'font': 'normal',
'font-family': 'Helvetica',
'font-weight': 'normal',
'font-color': 'black',
'line-color': 'black',
'element-color': 'black',
'fill': 'white',
'yes-text': 'yes',
'no-text': 'no',
'arrow-end': 'block',
'scale': 1,
'symbols': {
'start': {
'font-color': 'red',
'element-color': 'green',
},
'end': {
'class': 'end-element'
}
},
'flowstate': {
'clickable':{ 'fill' : '#52bffa'},'delay' : {'arrow-text' : '暂时无法搬过来,先面试了' }
,'now' : {'arrow-text' : '我现在就能住进来' }
}
});
$('[id^=sub1]').click(function() {
alert('info here');
});
})();
};
function myFunction(event, node) {
console.log("You just clicked this node:", node);
}
Also see: Tab Triggers