Skip to content

Commit

Permalink
Clean up quick demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Rodriguez committed Sep 5, 2019
1 parent 80a4571 commit 45c70d8
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 71 deletions.
1 change: 1 addition & 0 deletions demo/demo-min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/demo-min.js

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions demo/demo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Proceed only if the DOM is loaded and ready.
*
* @param {Function} fn The function to be executed when DOM is ready.
*/
function domReady(fn) {
Expand All @@ -16,21 +17,24 @@ function domReady(fn) {
*/
domReady(function() {
const Vue = require('../node_modules/vue/dist/vue.min.js');
const MailtoUI = require('../src/js/mailtoui.js');
// const MailtoUI = require('../dist/mailtoui-min.js');
// const MailtoUI = require('../src/js/mailtoui.js');
const MailtoUI = require('../dist/mailtoui-min.js');

var app = new Vue({
el: '#app',

data: {
emailSyntax: '{{ email }}',
email: '[email protected]',
emailDisplay: 'With cc'
emailDisplay: 'Mailto link with cc'
},

computed: {
mailtoHref: function() {
return 'mailto:' + this.email + '[email protected]';
}
},

mounted() {
MailtoUI.run({
buttonTextCopy: 'Copia',
Expand Down
55 changes: 55 additions & 0 deletions demo/demo.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* Dark Theme: Sample CSS to overrie the look of MailtoUI */

.mailtoui-modal {
background-color: #cbd5e0;
background-color: rgba(250, 250, 250, 0.5);
color: #fff;
}

.mailtoui-modal-head {
background-color: #21262c;
}

.mailtoui-modal-title {
color: #fff;
}

.mailtoui-modal-close:focus,
.mailtoui-modal-close:hover {
color: #fff;
}

.mailtoui-modal-body {
background-color: #373b41;
}

.mailtoui-button:focus .mailtoui-button-content {
background-color: #d8dcdf;
color: #333;
}

.mailtoui-button-content,
.mailtoui-button-copy {
background-color: #63676b;
color: #fff;
}

.mailtoui-button-content:hover,
.mailtoui-button-content:focus,
.mailtoui-button-copy:hover,
.mailtoui-button-copy:focus {
background-color: #d8dcdf;
color: #333;
}

.mailtoui-button-copy-clicked,
.mailtoui-button-copy-clicked:hover,
.mailtoui-button-copy-clicked:focus {
background-color: #1f9d55;
color: #fff;
}

.mailtoui-email-address {
background-color: #909295;
color: #21262c;
}
86 changes: 21 additions & 65 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,80 +6,36 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Quick Demo</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss/dist/tailwind.min.css">
<style type="text/css">
.smooth-scroll {
scroll-behavior: smooth;
}

/* .mailtoui-modal {
background-color: rgba(250,250,250,0.5);
color: #fff;
}
.mailtoui-modal-head {
background-color: #21262C;
}
.mailtoui-modal-title {
color: #fff;
}
.mailtoui-modal-close:focus,
.mailtoui-modal-close:hover {
color: #fff;
}
.mailtoui-modal-body {
background-color: #373b41;
}
.mailtoui-button:focus .mailtoui-button-content {
background-color: #D8DCDF;
color: #333;
}
.mailtoui-button-content,
.mailtoui-button-copy {
background-color: #63676b;
color: #fff;
}
.mailtoui-button-content:hover,
.mailtoui-button-content:focus,
.mailtoui-button-copy:hover,
.mailtoui-button-copy:focus {
background-color: #D8DCDF;
color: #333;
}
.mailtoui-button-copy-clicked,
.mailtoui-button-copy-clicked:hover,
.mailtoui-button-copy-clicked:focus {
background-color: #1F9D55;
color: #fff;
}
.mailtoui-email-address {
background-color: #909295;
color: #21262c;
} */
</style>
<style type="text/css">.smooth-scroll {scroll-behavior: smooth;}</style>
<link rel="stylesheet" href="./demo-min.css">
</head>
<body>
<div id="app" class="max-w-sm mx-auto py-32">
<h1 class="mb-12">MailtoUI Quick Demo</h1>
<h1 class="text-3xl mb-12">MailtoUI.js Quick Demo</h1>

<p class="mb-8"><a class="mailtoui" href="mailto:[email protected],[email protected]?subject=Hello!">With subject</a></p>
<p class="mb-8">
<a class="mailtoui text-blue-600 underline" href="mailto:[email protected],[email protected]?subject=Hello!">
Mailto link with subject
</a>
</p>

<p class="mb-8"><a class="mailtoui" href="mailto:[email protected]?body=Hello World!">With body</a></p>
<p class="mb-8">
<a class="mailtoui text-blue-600 underline" href="mailto:[email protected]?body=Hello World!">
Mailto link with body
</a>
</p>

<p>
<a class="mailtoui text-blue" :href="mailtoHref">{{ emailDisplay }}</a>
<span class="text-grey-dark"> - Link created with Vue.js</span>
<p class="mb-8">
<a class="mailtoui text-blue-600 underline" :href="mailtoHref">
{{ emailDisplay }}
</a>
<span class="text-gray-600"> - Created in Vue</span>
</p>
</div>

<!-- <script src="../src/js/mailtoui.js" data-options='{ "buttonTextCopy": "Copia", "buttonTextCopyAction": "Copiado!", "autoClose": true, "disableOnMobile": true }'></script> -->
<!-- Toggle commenting the next two lines to load MailtoUI.js via script tag or Vue -->

<!-- <script src="../src/js/mailtoui.js" data-options='{ "buttonText1": "Gmail", "autoClose": true, "disableOnMobile": true }'></script> -->
<script src="./demo-min.js"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions dist/mailtoui-min.js

Large diffs are not rendered by default.

0 comments on commit 45c70d8

Please sign in to comment.