mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-27 10:16:16 -04:00
Lots of minor fixes
This commit is contained in:
parent
bb81b6f2e4
commit
d8dcbfcb0f
21 changed files with 332 additions and 60 deletions
95
app/elements/donate-dialog/donate-dialog.html
Normal file
95
app/elements/donate-dialog/donate-dialog.html
Normal file
|
@ -0,0 +1,95 @@
|
|||
<link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html">
|
||||
<dom-module id="donate-dialog-impl">
|
||||
<template>
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
|
||||
paper-dialog {
|
||||
max-width: 324px;
|
||||
}
|
||||
|
||||
iron-icon {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 4px;
|
||||
color: #4285f4;
|
||||
}
|
||||
|
||||
p {
|
||||
padding: 0 48px;
|
||||
margin: 4px;
|
||||
@apply(--paper-font-subhead);
|
||||
}
|
||||
|
||||
paper-dialog > a {
|
||||
text-decoration: none;
|
||||
color: #52524F;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 500px) {
|
||||
paper-dialog {
|
||||
margin: 24px
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<paper-dialog id="dialog" with-backdrop entry-animation="scale-up-animation" exit-animation="fade-out-animation" modal>
|
||||
<h2>Do you like Snapdrop?</h2>
|
||||
<a href="https://www.paypal.com/cgi-bin/webscr?business=robin@capira.de&cmd=_xclick¤cy_code=USD&item_name=Snapdrop&shipping=0" target="_blank" dialog-confirm>
|
||||
<p>
|
||||
<iron-icon icon="chat:local-cafe"></iron-icon>
|
||||
<span>Donate a cup of Coffee <br>to the Developers!</span>
|
||||
</p>
|
||||
</a>
|
||||
<div class="buttons">
|
||||
<paper-button dialog-dismiss>No, thanks.</paper-button>
|
||||
<a href="https://www.paypal.com/cgi-bin/webscr?business=robin@capira.de&cmd=_xclick¤cy_code=USD&item_name=Snapdrop&shipping=0" target="_blank">
|
||||
<paper-button dialog-confirm>Donate</paper-button>
|
||||
</a>
|
||||
</div>
|
||||
</paper-dialog>
|
||||
</template>
|
||||
<script>
|
||||
'use strict';
|
||||
Polymer({
|
||||
is: 'donate-dialog-impl',
|
||||
open: function() {
|
||||
this.$.dialog.open();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
||||
<dom-module id="donate-dialog">
|
||||
<script>
|
||||
'use strict';
|
||||
Polymer({
|
||||
is: 'donate-dialog',
|
||||
properties: {
|
||||
chance: {
|
||||
value: 1 / 6
|
||||
}
|
||||
},
|
||||
attached: function() {
|
||||
window.donateDialog = this;
|
||||
},
|
||||
get dialog() {
|
||||
var dialog = document.querySelector('donate-dialog-impl');
|
||||
if (!dialog) {
|
||||
dialog = Polymer.Base.create('donate-dialog-impl');
|
||||
document.body.appendChild(dialog);
|
||||
}
|
||||
return dialog;
|
||||
},
|
||||
open: function() {
|
||||
var chance = Math.random() <= this.chance;
|
||||
if (chance) {
|
||||
this.dialog.open();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
Loading…
Add table
Add a link
Reference in a new issue