feat(example): use custom-made font

This commit is contained in:
Nico Rehwaldt 2014-04-05 11:25:34 +02:00
parent 008015b227
commit 18e7e21959
11 changed files with 251 additions and 285 deletions

View File

@ -1,115 +0,0 @@
* {
box-sizing: border-box;
}
body, html {
font-family: 'Open Sans', sans-serif;
font-size: 12px;
height: 100%;
padding: 0;
margin: 0;
}
a:link {
text-decoration: none;
}
.content,
.content > div {
width: 100%;
height: 100%;
}
.content > .message {
text-align: center;
display: table;
font-size: 16px;
color: #111;
}
.content > .message .note {
vertical-align: middle;
text-align: center;
display: table-cell;
}
.content .error .details {
max-width: 500px;
font-size: 12px;
margin: 20px auto;
text-align: left;
}
.content .error pre {
border: solid 1px #CCC;
background: #EEE;
padding: 10px;
}
.content:not(.with-error) .error,
.content .canvas,
.content.with-error .canvas,
.content.with-error .intro,
.content.with-diagram .intro {
display: none;
}
.content.with-diagram .canvas {
display: block;
}
.buttons {
position: fixed;
bottom: 20px;
left: 20px;
padding: 0;
margin: 0;
list-style: none;
}
.buttons > li {
display: inline-block;
padding: 5px 10px;
}
.buttons a {
opacity: 0.3;
}
.buttons a.active {
opacity: 1.0;
}
.buttons a .fa {
font-size: 2em;
}
@font-face {
font-family: 'FontAwesome';
src: url('fontawesome.woff') format('woff');
font-weight: normal;
font-style: normal;
}
.fa {
display: inline-block;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.fa-download:before {
content: "\f019";
}
.fa-picture-o:before {
content: "\f03e";
}

135
example/css/app.css Normal file
View File

@ -0,0 +1,135 @@
* {
box-sizing: border-box;
}
body, html {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 12px;
height: 100%;
padding: 0;
margin: 0;
}
a:link {
text-decoration: none;
}
.content,
.content > div {
width: 100%;
height: 100%;
}
.content > .message {
text-align: center;
display: table;
font-size: 16px;
color: #111;
}
.content > .message .note {
vertical-align: middle;
text-align: center;
display: table-cell;
}
.content .error .details {
max-width: 500px;
font-size: 12px;
margin: 20px auto;
text-align: left;
}
.content .error pre {
border: solid 1px #CCC;
background: #EEE;
padding: 10px;
}
.content:not(.with-error) .error,
.content .canvas,
.content.with-error .canvas,
.content.with-error .intro,
.content.with-diagram .intro {
display: none;
}
.content.with-diagram .canvas {
display: block;
}
.buttons {
position: fixed;
bottom: 20px;
left: 20px;
padding: 0;
margin: 0;
list-style: none;
font-size: 2em;
}
.buttons > li {
display: inline-block;
padding: 5px;
}
.buttons a {
opacity: 0.3;
}
.buttons a.active {
opacity: 1.0;
}
/* icon integration */
@font-face {
font-family: 'bpmnio-embedded';
src: url('../font/bpmnio-embedded.eot?52356950');
src: url('../font/bpmnio-embedded.eot?52356950#iefix') format('embedded-opentype'),
url('../font/bpmnio-embedded.woff?52356950') format('woff'),
url('../font/bpmnio-embedded.ttf?52356950') format('truetype'),
url('../font/bpmnio-embedded.svg?52356950#bpmnio-embedded') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="icon-"]:before,
[class*=" icon-"]:before {
font-family: "bpmnio-embedded";
font-style: normal;
font-weight: normal;
speak: none;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
font-variant: normal;
text-transform: none;
line-height: 1em;
margin-left: .2em;
}
.icon-bpmn-io:before { content: '\e807'; }
.icon-save:before { content: '\e806'; }
.icon-info:before { content: '\e80b'; }
.icon-download:before { content: '\e80a'; }
.icon-link:before { content: '\e808'; }
.icon-source:before { content: '\e802'; }
.icon-picture:before { content: '\e809'; }
.icon-comments:before { content: '\e801'; }
.icon-resize-full:before { content: '\e800'; }
.icon-resize-small:before { content: '\e805'; }
.icon-diagram:before { content: '\e803'; }
.icon-edit:before { content: '\e804'; }

View File

@ -0,0 +1,78 @@
/**
* outline styles
*/
.djs-outline {
fill: none;
visibility: hidden;
}
.djs-group.hover .djs-outline,
.djs-group.selected .djs-outline {
visibility: visible;
stroke-dasharray: 2,4;
}
.djs-group.selected .djs-outline {
stroke: blue;
stroke-width: 1px;
}
.djs-group.hover .djs-outline {
stroke: red;
stroke-width: 1px;
}
.djs-group.drop-ok .djs-visual {
fill: green;
}
.djs-group.drop-not-ok .djs-visual {
fill: red;
}
/**
* drag styles
*/
.djs-dragger {
fill: white;
opacity: 0.3;
stroke: #333;
stroke-dasharray: 2,1;
}
.djs-shape.djs-dragging {
visibility: hidden;
}
/**
* hit shape styles
*/
.djs-hit {
stroke-opacity: 0.0;
stroke-width: 10px;
fill: none;
}
/**
* shape / connection basic styles
*/
.djs-shape .djs-visual { }
.djs-connection .djs-visual {
stroke-width: 2px;
fill: none;
}
.djs-connection .djs-bendpoint {
visibility: hidden;
}
.djs-connection:hover .djs-bendpoint {
visibility: visible;
}
.djs-connection .djs-bendpoint:hover {
stroke: #CCC;
stroke-width: 1px;
fill: yellow;
}

View File

@ -1,154 +0,0 @@
/**
* outline styles
*/
.djs-outline {
fill: none;
visibility: hidden;
}
.djs-group.hover .djs-outline,
.djs-group.selected .djs-outline {
visibility: visible;
stroke-dasharray: 2,4;
}
.djs-group.selected .djs-outline {
stroke: blue;
stroke-width: 1px;
}
.djs-group.hover .djs-outline {
stroke: red;
stroke-width: 1px;
}
.djs-group.drop-ok .djs-visual {
fill: green;
}
.djs-group.drop-not-ok .djs-visual {
fill: red;
}
/**
* drag styles
*/
.djs-dragger {
fill: white;
opacity: 0.3;
stroke: #333;
stroke-dasharray: 2,1;
}
.djs-shape.djs-dragging {
visibility: hidden;
}
/**
* hit shape styles
*/
.djs-hit {
stroke-opacity: 0.0;
stroke-width: 10px;
fill: none;
}
/**
* shape / connection basic styles
*/
.djs-shape .djs-visual { }
.djs-connection .djs-visual {
stroke-width: 2px;
fill: none;
}
.djs-connection .djs-bendpoint {
visibility: hidden;
}
.djs-connection:hover .djs-bendpoint {
visibility: visible;
}
.djs-connection .djs-bendpoint:hover {
stroke: #CCC;
stroke-width: 1px;
fill: yellow;
}
.djs-connection-marker {
fill: black;
stroke: none;
}
.djs-menu-vertical, .djs-menu-horizontal {
height: 35px;
background-color: #52B415;
padding-left: 10px;
}
.djs-menu-vertical > button {
display:inline-block;
margin-bottom:0;
font-weight:400;
text-align:center;
vertical-align:middle;
cursor:pointer;
background: #52B415 none;
color: white;
border: 0px #ffffff;
border-right-width: 1px;
border-bottom-style: solid;
border-left-width: 1px;
white-space:nowrap;
padding:5px 12px;
font-size:15px;
line-height:1.428571429;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
.djs-menu-vertical > .button:focus{
outline:thin dotted #333;
outline:5px auto -webkit-focus-ring-color;
outline-offset:-2px;
}
.djs-menu-vertical > .btn:hover,.btn:focus {
color:#707070;text-decoration:none;
}
.djs-menu-brand {
background: url("logo.png") scroll no-repeat transparent;
background-size: 35px 35px;
width: 35px;
height: 35px;
float: right;
}
/* Button icons*/
.djs-undo-button > i:before {
font-family: awesomesymbols;
content: "\f0e2";
font-style: normal;
}
.djs-redo-button > i:before {
font-family: awesomesymbols;
content: "\f01e";
font-style: normal;
}
.djs-rect-button > i {
width: 10px;
height: 10px;
border: 1px solid;
display: block;
}
/* Fonts */
@font-face {
font-family: "awesomesymbols";
src: url("../fonts/fontawesome-webfont.woff") format('woff');
font-weight: normal;
}

Binary file not shown.

View File

@ -0,0 +1,23 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
<defs>
<font id="bpmnio-embedded" horiz-adv-x="1000" >
<font-face font-family="bpmnio-embedded" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
<missing-glyph horiz-adv-x="1000" />
<glyph glyph-name="bpmn-io" unicode="&#xe807;" d="m977 549c-45-109-171-161-280-116c-109 45-161 171-116 280c46 109 171 161 281 116c109-45 161-170 115-280z m-27-164l1 0l23-88l-98-41l-47 79l4 1c-35-6-71-7-106 0l-47-79l-98 40l23 89l2-1c-29 21-54 46-74 74l0 0l-88-23l-41 98l79 47l1-4c-6 35-7 71 0 106l-79 47l41 97l88-22l-1-3c12 18 26 34 42 48h-510c-36 0-65-29-65-65v-427l60-44l-2-2c30 20 62 34 96 41l-1 0l12 89l104 2l14-88l-3-1c33-6 66-19 97-37l71 54l74-72l-53-73l-2 2c20-29 33-61 41-95v1l89-12l2-103l-89-15l0 4c-7-34-19-67-38-97l48-62h415c36 0 65 29 65 65v513c-15-16-32-31-50-43z m-578-465c-82-83-215-85-299-4c-83 81-85 214-3 297c81 84 215 86 298 5c84-81 85-214 4-298z" horiz-adv-x="1000" />
<glyph glyph-name="save" unicode="&#xe806;" d="m658 750l142-156l0-544q0-40-29-70t-71-30l-600 0q-40 0-70 30t-30 70l0 600q0 42 30 71t70 29l558 0z m-58-300l0 250l-400 0l0-250q0-20 15-35t35-15l300 0q20 0 35 15t15 35z m-50 200l0-200l-100 0l0 200l100 0z" horiz-adv-x="800" />
<glyph glyph-name="info" unicode="&#xe80b;" d="m357 100v-71q0-15-10-25t-26-11h-285q-15 0-25 11t-11 25v71q0 15 11 25t25 11h35v214h-35q-15 0-25 11t-11 25v71q0 15 11 25t25 11h214q15 0 25-11t11-25v-321h35q15 0 26-11t10-25z m-71 643v-107q0-15-11-25t-25-11h-143q-14 0-25 11t-11 25v107q0 14 11 25t25 11h143q15 0 25-11t11-25z" horiz-adv-x="357.1" />
<glyph glyph-name="download" unicode="&#xe80a;" d="m714 100q0 15-10 25t-25 11t-26-11t-10-25t10-25t26-11t25 11t10 25z m143 0q0 15-10 25t-26 11t-25-11t-10-25t10-25t25-11t26 11t10 25z m72 125v-179q0-22-16-37t-38-16h-821q-23 0-38 16t-16 37v179q0 22 16 38t38 16h259l75-76q33-32 76-32t76 32l76 76h259q22 0 38-16t16-38z m-182 318q10-23-8-40l-250-250q-10-10-25-10t-25 10l-250 250q-17 17-8 40q10 21 33 21h143v250q0 15 11 25t25 11h143q14 0 25-11t10-25v-250h143q24 0 33-21z" horiz-adv-x="928.6" />
<glyph glyph-name="link" unicode="&#xe808;" d="m294 116q14 14 34 14t36-14q32-34 0-70l-42-40q-56-56-132-56q-78 0-134 56t-56 132q0 78 56 134l148 148q70 68 144 77t128-43q16-16 16-36t-16-36q-36-32-70 0q-50 48-132-34l-148-146q-26-26-26-64t26-62q26-26 63-26t63 26z m450 574q56-56 56-132q0-78-56-134l-158-158q-74-72-150-72q-62 0-112 50q-14 14-14 34t14 36q14 14 35 14t35-14q50-48 122 24l158 156q28 28 28 64q0 38-28 62q-24 26-56 31t-60-21l-50-50q-16-14-36-14t-34 14q-34 34 0 70l50 50q54 54 127 51t129-61z" horiz-adv-x="800" />
<glyph glyph-name="source" unicode="&#xe802;" d="m380 636q16-14 16-32t-16-30l-246-224l246-226q16-12 16-30t-16-32q-30-30-60 0l-320 288l320 286q30 30 60 0z m302 0l318-286l-318-288q-32-30-62 0q-32 32 0 62l248 226l-248 224q-32 30 0 62q30 30 62 0z" horiz-adv-x="1000" />
<glyph glyph-name="picture" unicode="&#xe809;" d="m357 529q0-45-31-76t-76-32t-76 32t-31 76t31 75t76 32t76-32t31-75z m572-215v-250h-786v107l178 179l90-89l285 285z m53 393h-893q-7 0-12-5t-6-13v-678q0-8 6-13t12-5h893q7 0 13 5t5 13v678q0 7-5 13t-13 5z m89-18v-678q0-37-26-63t-63-27h-893q-36 0-63 27t-26 63v678q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1071.4" />
<glyph glyph-name="comments" unicode="&#xe801;" d="m290 240l350 0q2 0 6 2l4 0l0-92q0-40-29-70t-71-30l-250 0l-150-150l0 150l-50 0q-40 0-70 30t-30 70l0 300q0 42 30 71t70 29l190 0l0-310z m610 560q42 0 71-29t29-71l0-300q0-40-29-70t-71-30l-50 0l0-150l-150 150l-350 0l0 400q0 42 30 71t70 29l450 0z" horiz-adv-x="1000" />
<glyph glyph-name="resize-full" unicode="&#xe800;" d="m476 746l316 0l0-316l-100 124l-146-152l-100 100l152 146z m-230-444l100-100l-152-146l122-100l-316 0l0 316l100-122z" horiz-adv-x="792" />
<glyph glyph-name="resize-small" unicode="&#xe805;" d="m156 146l-106 100l296 0l0-296l-100 106l-146-156l-100 100z m744 554l-154-144l104-100l-294 0l0 294l100-104l144 154z" horiz-adv-x="900" />
<glyph glyph-name="diagram" unicode="&#xe803;" d="m900 750q42 0 71-30t29-70l0-600q0-42-29-71t-71-29l-800 0q-40 0-70 29t-30 71l0 600q0 40 30 70t70 30l800 0z m-670-94q-16 0-27-11t-11-25q0-16 11-27t27-11q38 0 38 38q0 16-11 26t-27 10z m-138-36q0-16 11-27t27-11q38 0 38 38q0 16-11 26t-27 10t-27-11t-11-25z m810-570l0 460l-802 0l0-460l802 0z m0 540l0 60l-602 0l0-60l602 0z" horiz-adv-x="1000" />
<glyph glyph-name="edit" unicode="&#xe804;" d="m718 680q32-32 47-64t15-48l0-16l-252-252l-290-288l-238-52l50 240l290 288l252 252q54 12 126-60z m-494-640l24 24q-2 44-52 94q-22 22-45 35t-35 13l-14 2l-22-24l-18-80q28-16 46-34q24-24 36-48z" horiz-adv-x="780" />
</font>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -2,10 +2,8 @@
<head>
<title>bpmn-js demo</title>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="app.css" />
<link rel="stylesheet" href="diagram-js.css" />
<link rel="stylesheet" href="css/app.css" />
<link rel="stylesheet" href="css/diagram-js.css" />
</head>
<body>
<div class="content" id="js-drop-zone">
@ -33,12 +31,12 @@
<ul class="buttons">
<li>
<a id="js-download-diagram" href title="download BPMN diagram">
<i class="fa fa-download fa-3x"></i>
<span class="icon-download"></span>
</a>
</li>
<li>
<a id="js-download-svg" href title="download as SVG image">
<i class="fa fa-picture-o fa-3x"></i>
<span class="icon-picture"></span>
</a>
</li>
</ul>

View File

@ -2,10 +2,8 @@
<head>
<title>bpmn-js demo</title>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../app.css" />
<link rel="stylesheet" href="../diagram-js.css" />
<link rel="stylesheet" href="../css/app.css" />
<link rel="stylesheet" href="../css/diagram-js.css" />
</head>
<body>
<div class="content" id="js-drop-zone">
@ -32,24 +30,27 @@
<ul class="buttons">
<li>
<a id="js-download-diagram" href title="download">
<i class="fa fa-download fa-3x"></i>
<a id="js-download-diagram" href title="download BPMN diagram">
<span class="icon-download"></span>
</a>
</li>
<li>
<a id="js-download-svg" href title="download as svg">
<i class="fa fa-picture-o fa-3x"></i>
<a id="js-download-svg" href title="download as SVG image">
<span class="icon-picture"></span>
</a>
</li>
</ul>
<script>
var str = window.location.search; var min = !/\?debug=/.test(str);
var str = window.location.search;
var min = !/\?debug=/.test(str);
document.write('<script src="../../bpmn' + (min ? '.min': '') + '.js"></' + 'script>');
</script>
<script>
var BpmnJS = require('bpmn/Viewer');
var BpmnJS = require('bpmn/Modeler');
</script>
<script src="../app.js"></script>
</html>