-
Notifications
You must be signed in to change notification settings - Fork 70
/
config.json
94 lines (94 loc) · 6.31 KB
/
config.json
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
{
"plugin_type": "widget",
"name": "Exit Intent Popup",
"edit_page_url": "http://www.atticandbutton.us",
"form_schema": [
{
"default_value": "Don't go yet!",
"field_type": "text",
"name": "headline",
"label": "Headline",
"options": null
},
{
"default_value": "Stick around and buy some stuff!",
"field_type": "text",
"name": "secondary",
"label": "Secondary Text",
"options": null
},
{
"default_value": "http://www.google.com",
"field_type": "text",
"name": "link",
"label": "Link URL",
"options": null
},
{
"default_value": "RSVP YES",
"field_type": "text",
"name": "link_text",
"label": "Link Text",
"options": null
},
{
"default_value": "rgba(229, 27, 233, 0)",
"field_type": "color",
"name": "overlay_color",
"label": "Modal Overlay Color",
"options": {
"mode": "rgba"
}
},
{
"default_value": "rgba(255, 255, 255, 1)",
"field_type": "color",
"name": "modal_color",
"label": "Modal Color",
"options": {
"mode": "rgba"
}
},
{
"default_value": "rgba(0, 0, 0, 1)",
"field_type": "color",
"name": "headline_color",
"label": "Headline Color",
"options": {
"mode": "rgba"
}
},
{
"default_value": "rgba(255, 255, 255, 1)",
"field_type": "color",
"name": "secondary_color",
"label": "Secondary Text Color",
"options": {
"mode": "rgba"
}
},
{
"default_value": "rgba(0, 0, 0, 1)",
"field_type": "color",
"name": "button_color",
"label": "Button Color",
"options": {
"mode": "rgba"
}
},
{
"default_value": "Graphik, Lato, Helvetica, Verdana, sans-serif",
"field_type": "text",
"name": "modal_font",
"label": "Font Family",
"options": null
}
],
"description": "If the user tries to leave the window, a popup will show asking them not to leave. ",
"options": {
"html": "<div class=\"exit-intent-modal\" style=\"background-color: {{extension.overlay_color}}; font-family: {{extension.modal_font}}\">\n <div id=\"exit-popup-overlay\"></div>\n <div id=\"exit-popup-wrapper\">\n <div id=\"exit-popup\" style=\"background-color: {{extension.modal_color}}\">\n <div id=\"exit-popup-close\" class=\"exit-popup-close\">x</div>\n <h2 style=\"color: {{extension.headline_color}}; font-family: {{extension.modal_font}}\">{{widget.headline}}</h2>\n <p style=\"color: {{extension.secondary_color}; font-family: {{extension.modal_font}}}\">{{widget.secondary}}</p>\n <a href=\"{{widget.link}}\" class=\"btn exit-popup-close\" style=\"background-color: {{extension.button_color}}; font-family: {{extension.modal_font}}\">{{widget.link_text}}</a>\n </div>\n </div>\n</div>",
"css": ".exit-intent-modal{\n\topacity: 0;\n position: fixed;\n z-index: 3001;\n width: 100%;\n text-align: center;\n\theight: 100% !important;\n}\n\nbody {\n height: 100%;\n float: left;\n position: relative;\n}\n\n#exit-popup-overlay {\n height: 100vh !important;\n z-index: 3000;\n position: fixed;\n width: 100%;\n background: #000;\n opacity: 0.5;\n}\n#exit-popup-wrapper {\n margin: 50px 0;\n position: fixed;\n z-index: 3001;\n width: 100%;\n height: 100vh;\n text-align: center;\n}\n\n#exit-popup {\n width: 500px;\n display: inline-block;\n background: #fff;\n padding: 50px 20px;\n position: relative;\n}\n\n#exit-popup h2 {\n margin-top: 20px;\n}\n\n#exit-popup p {\n \n}\n#exit-popup-close {\n top: 10px;\n right: 20px;\n font-size: 20px;\n position: absolute;\n font-weight: bold;\n cursor: pointer;\n}\n#exit-popup-close:hover {\n color: #999;\n}\n\n.fade-in {\n -webkit-animation: fadein .5s; /* Safari, Chrome and Opera > 12.1 */\n -moz-animation: fadein .5s; /* Firefox < 16 */\n -ms-animation: fadein .5s; /* Internet Explorer */\n -o-animation: fadein .5s; /* Opera < 12.1 */\n animation: fadein .5s;\n opacity: 1 !important;\n}\n\n.fade-out {\n -webkit-animation: fadeout 1s; /* Safari, Chrome and Opera > 12.1 */\n -moz-animation: fadeout 1s; /* Firefox < 16 */\n -ms-animation: fadeout 1s; /* Internet Explorer */\n -o-animation: fadeout 1s; /* Opera < 12.1 */\n animation: fadeout 1s;\n opacity: 0 !important;\n}\n\n@keyframes fadein {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n/* Firefox < 16 */\n@-moz-keyframes fadein {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n/* Safari, Chrome and Opera > 12.1 */\n@-webkit-keyframes fadein {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n/* Internet Explorer */\n@-ms-keyframes fadein {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n/* Opera < 12.1 */\n@-o-keyframes fadein {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@keyframes fadeout {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n\n/* Firefox < 16 */\n@-moz-keyframes fadeout {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n\n/* Safari, Chrome and Opera > 12.1*/\n@-webkit-keyframes fadeout {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n\n/* Internet Explorer*/\n@-ms-keyframes fadeout {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n\n/* Opera < 12.1*/\n@-o-keyframes fadeout {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n",
"apply_js": "var utils = window.optimizely.get('utils');\n\nutils.waitForElement('body').then(function(element){\n var html = widget.$html;\n element.insertAdjacentHTML('afterbegin', html);\n element.addEventListener('mouseleave', function(){\n showPopup();\n bindCloseBtn();\n });\n});\n\nfunction showPopup() {\n if (document.querySelector('.fade-out')) {\n document.querySelector('.fade-out').classList.remove('fade-out');\n }\n document.querySelector('.exit-intent-modal').classList += ' fade-in';\n}\n\nfunction closePopup() {\n var modal = document.querySelector('.exit-intent-modal');\n modal.parentNode.removeChild(modal);\n}\n\nfunction bindCloseBtn() {\n document.querySelector('.exit-popup-close').addEventListener('click', function(e) {\n closePopup();\n });\n}\n",
"undo_js": "var extensionHTML = document.querySelector('.exit-intent-modal');\nif (extensionHTML) extensionHTML.remove();"
}
}