Update builder.html
Browse files- builder.html +134 -82
builder.html
CHANGED
|
@@ -4,14 +4,22 @@
|
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<title>GrapesJS</title>
|
| 6 |
<link rel="stylesheet" href="https://unpkg.com/grapesjs/dist/css/grapes.min.css">
|
|
|
|
| 7 |
<script src="https://unpkg.com/grapesjs"></script>
|
| 8 |
-
|
|
|
|
|
|
|
| 9 |
<style>
|
| 10 |
-
body,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
</style>
|
| 12 |
</head>
|
|
|
|
| 13 |
<body>
|
| 14 |
-
<div id="gjs" style="height:
|
| 15 |
<div class="panel">
|
| 16 |
<h1 class="welcome">Welcome to</h1>
|
| 17 |
<div class="big-title">
|
|
@@ -21,88 +29,132 @@
|
|
| 21 |
<span>GrapesJS</span>
|
| 22 |
</div>
|
| 23 |
<div class="description">
|
| 24 |
-
This is a demo content from index.html. For the development, you shouldn't edit this file, instead you can
|
|
|
|
| 25 |
</div>
|
| 26 |
<button class="add-button">Зарегистрироваться</button>
|
| 27 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
</div>
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
label: 'Description',
|
| 99 |
-
content: `<div class="description">This is a demo content from index.html. For the development, you shouldn't edit this file, instead you can copy and rename it to _index.html, on next server start the new file will be served, and it will be ignored by git.</div>`
|
| 100 |
-
});
|
| 101 |
-
|
| 102 |
-
editor.BlockManager.add('button-block', {
|
| 103 |
-
label: 'Add Button',
|
| 104 |
-
content: `<button class="add-button">Ещё добавь</button>`
|
| 105 |
-
});
|
| 106 |
-
</script>
|
| 107 |
</body>
|
| 108 |
-
</html>
|
|
|
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<title>GrapesJS</title>
|
| 6 |
<link rel="stylesheet" href="https://unpkg.com/grapesjs/dist/css/grapes.min.css">
|
| 7 |
+
|
| 8 |
<script src="https://unpkg.com/grapesjs"></script>
|
| 9 |
+
|
| 10 |
+
<script src="path/to/grapesjs-custom-code.min.js"></script>
|
| 11 |
+
|
| 12 |
<style>
|
| 13 |
+
body,
|
| 14 |
+
html {
|
| 15 |
+
height: 100%;
|
| 16 |
+
margin: 0;
|
| 17 |
+
}
|
| 18 |
</style>
|
| 19 |
</head>
|
| 20 |
+
|
| 21 |
<body>
|
| 22 |
+
<div id="gjs" style="height:0px; overflow:hidden;">
|
| 23 |
<div class="panel">
|
| 24 |
<h1 class="welcome">Welcome to</h1>
|
| 25 |
<div class="big-title">
|
|
|
|
| 29 |
<span>GrapesJS</span>
|
| 30 |
</div>
|
| 31 |
<div class="description">
|
| 32 |
+
This is a demo content from index.html. For the development, you shouldn't edit this file, instead you can
|
| 33 |
+
copy and rename it to _index.html, on next server start the new file will be served, and it will be ignored by git.
|
| 34 |
</div>
|
| 35 |
<button class="add-button">Зарегистрироваться</button>
|
| 36 |
</div>
|
| 37 |
+
<style>
|
| 38 |
+
.panel {
|
| 39 |
+
width: 90%;
|
| 40 |
+
max-width: 700px;
|
| 41 |
+
border-radius: 3px;
|
| 42 |
+
padding: 30px 20px;
|
| 43 |
+
margin: 150px auto 0px;
|
| 44 |
+
background-color: #ffe478;
|
| 45 |
+
box-shadow: 0px 3px 10px 0px rgba(0,0,0,0.25);
|
| 46 |
+
color:rgba(0, 0, 0, 0.75);
|
| 47 |
+
font: caption;
|
| 48 |
+
font-weight: 100;
|
| 49 |
+
}
|
| 50 |
+
.welcome {
|
| 51 |
+
text-align: center;
|
| 52 |
+
font-weight: 100;
|
| 53 |
+
margin: 0px;
|
| 54 |
+
}
|
| 55 |
+
.logo {
|
| 56 |
+
width: 70px;
|
| 57 |
+
height: 70px;
|
| 58 |
+
vertical-align: middle;
|
| 59 |
+
}
|
| 60 |
+
.logo path {
|
| 61 |
+
pointer-events: none;
|
| 62 |
+
fill: none;
|
| 63 |
+
stroke-linecap: round;
|
| 64 |
+
stroke-width: 7;
|
| 65 |
+
stroke: #fff
|
| 66 |
+
}
|
| 67 |
+
.big-title {
|
| 68 |
+
text-align: center;
|
| 69 |
+
font-size: 3.5rem;
|
| 70 |
+
margin: 15px 0;
|
| 71 |
+
}
|
| 72 |
+
.description {
|
| 73 |
+
text-align: justify;
|
| 74 |
+
font-size: 1rem;
|
| 75 |
+
line-height: 1.5rem;
|
| 76 |
+
}
|
| 77 |
+
.add-button {
|
| 78 |
+
display: block;
|
| 79 |
+
margin: 20px auto 0;
|
| 80 |
+
padding: 10px 20px;
|
| 81 |
+
font-size: 1rem;
|
| 82 |
+
color: #fff;
|
| 83 |
+
background-color: #02ba24;
|
| 84 |
+
border: none;
|
| 85 |
+
border-radius: 5px;
|
| 86 |
+
cursor: pointer;
|
| 87 |
+
}
|
| 88 |
+
</style>
|
| 89 |
</div>
|
| 90 |
|
| 91 |
+
<script type="text/javascript">
|
| 92 |
+
var editor = grapesjs.init({
|
| 93 |
+
showOffsets: 1,
|
| 94 |
+
noticeOnUnload: 0,
|
| 95 |
+
container: '#gjs',
|
| 96 |
+
height: '100%',
|
| 97 |
+
fromElement: true,
|
| 98 |
+
storageManager: { autoload: 0 },
|
| 99 |
+
plugins: ['gjs-custom-code'],
|
| 100 |
+
pluginsOpts: {
|
| 101 |
+
'gjs-custom-code': {
|
| 102 |
+
// Опции плагина
|
| 103 |
+
}
|
| 104 |
+
},
|
| 105 |
+
styleManager : {
|
| 106 |
+
sectors: [{
|
| 107 |
+
name: 'General',
|
| 108 |
+
open: false,
|
| 109 |
+
buildProps: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom']
|
| 110 |
+
},{
|
| 111 |
+
name: 'Flex',
|
| 112 |
+
open: false,
|
| 113 |
+
buildProps: ['flex-direction', 'flex-wrap', 'justify-content', 'align-items', 'align-content', 'order', 'flex-basis', 'flex-grow', 'flex-shrink', 'align-self']
|
| 114 |
+
},{
|
| 115 |
+
name: 'Dimension',
|
| 116 |
+
open: false,
|
| 117 |
+
buildProps: ['width', 'height', 'max-width', 'min-height', 'margin', 'padding'],
|
| 118 |
+
},{
|
| 119 |
+
name: 'Typography',
|
| 120 |
+
open: false,
|
| 121 |
+
buildProps: ['font-family', 'font-size', 'font-weight', 'letter-spacing', 'color', 'line-height', 'text-shadow'],
|
| 122 |
+
},{
|
| 123 |
+
name: 'Decorations',
|
| 124 |
+
open: false,
|
| 125 |
+
buildProps: ['border-radius-c', 'background-color', 'border-radius', 'border', 'box-shadow', 'background'],
|
| 126 |
+
},{
|
| 127 |
+
name: 'Extra',
|
| 128 |
+
open: false,
|
| 129 |
+
buildProps: ['transition', 'perspective', 'transform'],
|
| 130 |
+
}
|
| 131 |
+
],
|
| 132 |
+
},
|
| 133 |
+
});
|
| 134 |
+
// Add blocks for each element
|
| 135 |
+
editor.BlockManager.add('welcome-block', {
|
| 136 |
+
label: 'Welcome Title',
|
| 137 |
+
content: <h1 class="welcome">Welcome to</h1>
|
| 138 |
+
});
|
| 139 |
+
editor.BlockManager.add('big-title-block', {
|
| 140 |
+
label: 'Big Title',
|
| 141 |
+
content:
|
| 142 |
+
<div class="big-title">
|
| 143 |
+
<svg class="logo" viewBox="0 0 100 100">
|
| 144 |
+
<path d="M40 5l-12.9 7.4 -12.9 7.4c-1.4 0.8-2.7 2.3-3.7 3.9 -0.9 1.6-1.5 3.5-1.5 5.1v14.9 14.9c0 1.7 0.6 3.5 1.5 5.1 0.9 1.6 2.2 3.1 3.7 3.9l12.9 7.4 12.9 7.4c1.4 0.8 3.3 1.2 5.2 1.2 1.9 0 3.8-0.4 5.2-1.2l12.9-7.4 12.9-7.4c1.4-0.8 2.7-2.2 3.7-3.9 0.9-1.6 1.5-3.5 1.5-5.1v-14.9 -12.7c0-4.6-3.8-6-6.8-4.2l-28 16.2"/>
|
| 145 |
+
</svg>
|
| 146 |
+
<span>GrapesJS</span>
|
| 147 |
+
</div>
|
| 148 |
+
|
| 149 |
+
});
|
| 150 |
+
editor.BlockManager.add('description-block', {
|
| 151 |
+
label: 'Description',
|
| 152 |
+
content: <div class="description">This is a demo content from index.html. For the development, you shouldn't edit this file, instead you can copy and rename it to _index.html, on next server start the new file will be served, and it will be ignored by git.</div>
|
| 153 |
+
});
|
| 154 |
+
editor.BlockManager.add('button-block', {
|
| 155 |
+
label: 'Add Button',
|
| 156 |
+
content: <button class="add-button">Ещё добавь</button>
|
| 157 |
+
});
|
| 158 |
+
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
</body>
|
| 160 |
+
</html>
|