+ ^{lipsum}
diff --git a/templates/widgets/modal.hamlet b/templates/widgets/modal.hamlet
new file mode 100644
index 000000000..6906448e7
--- /dev/null
+++ b/templates/widgets/modal.hamlet
@@ -0,0 +1,4 @@
+
+ $# #{modalContent}
+ ^{lipsum}
+ ^{lipsum}
diff --git a/templates/widgets/modal.julius b/templates/widgets/modal.julius
new file mode 100644
index 000000000..53b118672
--- /dev/null
+++ b/templates/widgets/modal.julius
@@ -0,0 +1,56 @@
+document.addEventListener('DOMContentLoaded', function() {
+ 'use strict';
+
+ window.utils = window.utils || {};
+
+ if (!window.utils.modal) {
+ window.utils.modal = function(modal) {
+ var overlay = document.createElement('div');
+ var closer = document.createElement('div');
+ var trigger = document.querySelector(modal.dataset.trigger);
+ var closeBound;
+
+ this.open = function openFn() {
+ modal.classList.add('modal--open');
+ overlay.classList.add('modal__overlay');
+ modal.parentNode.insertBefore(overlay, modal);
+ overlay.classList.add('modal__overlay--open');
+ toggleScroll(false);
+
+ if (modal.dataset.closeable === 'true') {
+ closer.classList.add('modal__closer');
+ modal.insertBefore(closer, null);
+ closer.addEventListener('click', closeBound, false);
+ overlay.addEventListener('click', closeBound, false);
+ }
+ };
+
+ this.openOnEvent = function openOnEventFn(event) {
+ if (event.detail.for === modal.getAttribute('id')) {
+ this.open();
+ }
+ };
+ this.close = function closeFn(event) {
+ if (typeof event === 'undefined' || event.target === closer || event.target === overlay) {
+ modal.classList.remove('modal--open');
+ overlay.classList.remove('modal__overlay--open');
+ toggleScroll(true);
+ closer.removeEventListener('click', closeBound, false);
+ }
+ };
+
+ document.addEventListener('modal-open', this.openOnEvent.bind(this), false);
+ closeBound = this.close.bind(this);
+ if (trigger) {
+ trigger.addEventListener('click', this.open.bind(this), false);
+ }
+ }
+ }
+
+ function toggleScroll(scrollable) {
+ document.body.classList.toggle('no-scroll', !scrollable);
+ }
+
+ new utils.modal(document.querySelector('#modal-13')); // hashtag{modalId} scope-variable
+
+}, false);
diff --git a/templates/widgets/modal.lucius b/templates/widgets/modal.lucius
new file mode 100644
index 000000000..8c49cb4cd
--- /dev/null
+++ b/templates/widgets/modal.lucius
@@ -0,0 +1,66 @@
+.modal {
+ position: fixed;
+ left: 50%;
+ top: 50%;
+ transform: translate(-50%, -50%);
+ display: block;
+ background-color: rgba(130, 130, 130, 0.9);
+ min-width: 60vw;
+ min-height: 100px;
+ max-height: calc(100vh - 30px);
+ border-radius: 20px;
+ z-index: -1;
+ color: white;
+ padding: 20px;
+ overflow: scroll;
+
+ &.modal--open {
+ z-index: 200;
+ }
+}
+
+@media (max-width: 999px) {
+ .modal {
+ min-width: 80vw;
+ }
+}
+@media (max-width: 666px) {
+ .modal {
+ min-width: 90vw;
+ }
+}
+@media (max-width: 444px) {
+ .modal {
+ min-width: calc(100vw - 20px);
+ }
+}
+
+.modal__overlay {
+ position: fixed;
+ left: 0;
+ top: 0;
+ height: 100%;
+ width: 100%;
+ background-color: transparent;
+ z-index: -1;
+ transition: background-color .2s ease;
+
+ &.modal__overlay--open {
+ z-index: 199;
+ background-color: rgba(0, 0, 0, 0.4);
+ }
+}
+
+.modal__closer {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ display: block;
+ width: 20px;
+ height: 50px;
+ background-color: blue;
+}
+
+.no-scroll {
+ overflow: hidden;
+}