-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathindex.html
81 lines (77 loc) · 2.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Grapesjs Style Bg</title>
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<link href="https://unpkg.com/grapick/dist/grapick.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<script src="https://unpkg.com/grapesjs-parser-postcss"></script>
<style>
body,
html {
height: 100%;
margin: 0;
}
</style>
</head>
<body>
<div id="gjs" style="height:0px; overflow:hidden">
<div class="test-bg-props" data-gjs-stylable='["color", "background"]'>
<div style="margin:100px 100px 25px; padding:25px; font:caption">
This is a demo content from _index.html. You can use this template file for
development purpose. It won't be stored in your git repository
</div>
</div>
<style>
.test-bg-props {
padding:25px;
color: white;
text-align: center;
min-height: 500px;
background-repeat:repeat, repeat, no-repeat;
background-position:left top, left top, center center;
background-attachment:scroll, scroll, scroll;
background-size:auto, auto, auto;
background-image:linear-gradient(90deg, #bf4f4f 20%, rgba(142,235,15,0.17) 90%), linear-gradient(rgba(181,61,61,0.2) 0%,rgba(181,61,61,0.2) 100%), url('https://via.placeholder.com/350x250/78c5d6/fff/');
}
</style>
</div>
<script type="text/javascript">
window.onload = () => {
const editor = grapesjs.init({
height: '100%',
container: '#gjs',
showOffsets: true,
fromElement: true,
noticeOnUnload: false,
storageManager: false,
assetManager: {
assets: [
'https://via.placeholder.com/350x250/78c5d6/fff/',
'https://via.placeholder.com/350x250/459ba8/fff/',
'https://via.placeholder.com/350x250/79c267/fff/',
]
},
plugins: ['grapesjs-parser-postcss', 'grapesjs-style-bg'],
pluginsOpts: {
'grapesjs-style-bg': {},
},
});
editor.I18n.addMessages({
en: {
styleManager: {
properties: {
'background-repeat': 'Repeat',
'background-position': 'Position',
'background-attachment': 'Attachment',
'background-size': 'Size',
}
},
}
});
window.editor = editor;
};
</script>
</body>
</html>