|
4 | 4 | "edit_page_url": "http://www.atticandbutton.us",
|
5 | 5 | "form_schema": [
|
6 | 6 | {
|
7 |
| - "default_value": "Don't go!", |
| 7 | + "default_value": "Don't go yet!", |
8 | 8 | "field_type": "text",
|
9 | 9 | "name": "headline",
|
10 | 10 | "label": "Headline",
|
11 | 11 | "options": null
|
12 | 12 | },
|
13 | 13 | {
|
14 |
| - "default_value": "Stick around and buy some stuff", |
| 14 | + "default_value": "Stick around and buy some stuff!", |
15 | 15 | "field_type": "text",
|
16 | 16 | "name": "secondary",
|
17 | 17 | "label": "Secondary Text",
|
|
25 | 25 | "options": null
|
26 | 26 | },
|
27 | 27 | {
|
28 |
| - "default_value": "Please stay!", |
| 28 | + "default_value": "RSVP YES", |
29 | 29 | "field_type": "text",
|
30 | 30 | "name": "link_text",
|
31 | 31 | "label": "Link Text",
|
32 | 32 | "options": null
|
| 33 | + }, |
| 34 | + { |
| 35 | + "default_value": "rgba(229, 27, 233, 0)", |
| 36 | + "field_type": "color", |
| 37 | + "name": "overlay_color", |
| 38 | + "label": "Modal Overlay Color", |
| 39 | + "options": { |
| 40 | + "mode": "rgba" |
| 41 | + } |
| 42 | + }, |
| 43 | + { |
| 44 | + "default_value": "rgba(255, 255, 255, 1)", |
| 45 | + "field_type": "color", |
| 46 | + "name": "modal_color", |
| 47 | + "label": "Modal Color", |
| 48 | + "options": { |
| 49 | + "mode": "rgba" |
| 50 | + } |
| 51 | + }, |
| 52 | + { |
| 53 | + "default_value": "rgba(0, 0, 0, 1)", |
| 54 | + "field_type": "color", |
| 55 | + "name": "headline_color", |
| 56 | + "label": "Headline Color", |
| 57 | + "options": { |
| 58 | + "mode": "rgba" |
| 59 | + } |
| 60 | + }, |
| 61 | + { |
| 62 | + "default_value": "rgba(255, 255, 255, 1)", |
| 63 | + "field_type": "color", |
| 64 | + "name": "secondary_color", |
| 65 | + "label": "Secondary Text Color", |
| 66 | + "options": { |
| 67 | + "mode": "rgba" |
| 68 | + } |
| 69 | + }, |
| 70 | + { |
| 71 | + "default_value": "rgba(0, 0, 0, 1)", |
| 72 | + "field_type": "color", |
| 73 | + "name": "button_color", |
| 74 | + "label": "Button Color", |
| 75 | + "options": { |
| 76 | + "mode": "rgba" |
| 77 | + } |
| 78 | + }, |
| 79 | + { |
| 80 | + "default_value": "Graphik, Lato, Helvetica, Verdana, sans-serif", |
| 81 | + "field_type": "text", |
| 82 | + "name": "modal_font", |
| 83 | + "label": "Font Family", |
| 84 | + "options": null |
33 | 85 | }
|
34 | 86 | ],
|
35 |
| - "description": "If the user tries to leave the window, a popup will show begging them not to leave. ", |
| 87 | + "description": "If the user tries to leave the window, a popup will show asking them not to leave. ", |
36 | 88 | "options": {
|
37 |
| - "html": "<div class=\"exit-intent-modal\">\n <div id=\"exit-popup-overlay\"></div>\n <div id=\"exit-popup-wrapper\">\n <div id=\"exit-popup\">\n <div id=\"exit-popup-close\" class=\"exit-popup-close\">x</div>\n <h2>{{widget.headline}}</h2>\n <p>{{widget.secondary}}</p>\n <a href=\"{{widget.link}}\" class=\"btn exit-popup-close\">{{widget.link_text}}</a>\n </div>\n </div>\n</div>", |
38 |
| - "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 font-family: \"helvetica\", \"arial\", \"sans-serif\";\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", |
39 | 89 | "apply_js": "var utils = window.optimizely.get('utils');\n\nutils.waitForElement('body').then(function(element){\n\tvar html = widget.$html;\n element.insertAdjacentHTML('afterbegin', html);\n element.addEventListener('mouseleave', function(){\n showPopup();\n\t\tbindCloseBtn();\n });\n});\n\nfunction showPopup() {\n if(document.querySelector('.fade-out')){\n\t document.querySelector('.fade-out').classList.remove('fade-out');\n }\n document.querySelector('.exit-intent-modal').classList += ' fade-in';\n}\n\nfunction hidePopup() {\n document.querySelector('.exit-intent-modal').classList += ' fade-out';\n}\n\nfunction bindCloseBtn() {\n\tdocument.querySelector('.exit-popup-close').addEventListener('click', function(e){\n hidePopup();\n });\n}",
|
| 90 | + "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>", |
| 91 | + "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", |
40 | 92 | "undo_js": "var extensionHTML = document.querySelector('.exit-intent-modal');\nif (extensionHTML) extensionHTML.remove();"
|
41 | 93 | }
|
42 | 94 | }
|
0 commit comments