-
Notifications
You must be signed in to change notification settings - Fork 14
/
_index.html
95 lines (88 loc) · 2.33 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test fonts</title>
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<script src="https://unpkg.com/grapesjs-preset-webpage"></script>
<style>
body,
html {
margin: 0;
height: 100%;
}
.grapesjs-fonts select {
background-color: #352d2f;
color: #b9a5a6;
padding: 5px;
border: none;
}
.grapesjs-fonts input,
.grapesjs-fonts button {
background-color: #352d2f;
color: #b9a5a6;
padding: 5px;
border: none;
}
.grapesjs-fonts .silex-bar {
display: flex;
}
.grapesjs-fonts .silex-bar>* {
margin: 5px;
}
.grapesjs-fonts input {}
.grapesjs-fonts button {
padding: 5px;
margin: 5px;
padding-top: 8px;
}
.grapesjs-fonts .silex-list__item__footer {
display: flex;
justify-content: flex-end;
}
</style>
</head>
<body>
<div id='basic-actions' class="panel__basic-actions" style="z-index: 9; left: 120px;"></div>
<div id="gjs"></div>
<script type="text/javascript">
window.addEventListener('load', () => {
var editor = grapesjs.init({
container: '#gjs',
fromElement: true,
height: '100%',
storageManager: { autoload: 0 },
plugins: ['grapesjs-preset-webpage', '@silexlabs/grapesjs-fonts'],
pluginsOpts: {
'gjs-preset-webpage': {
modalImportTitle: 'Import Template',
modalImportButton: 'Import',
modalImportLabel: '',
modalImportContent: '',
importViewerOptions: {},
},
'@silexlabs/grapesjs-fonts': {
api_key: 'AIzaSyAdJTYSLPlKz4w5Iqyy-JAF2o8uQKd1FKc',
},
}
});
editor.on("load", () => {
editor.Panels.addPanel({
id: "basic-actions",
el: ".panel__basic-actions",
buttons: [
{
id: "create-button",
label: "Open font dialog",
command(editor) {
editor.runCommand("open-fonts");
}
}
]
});
})
})
</script>
</body>
</html>