diff --git a/css/app.css b/css/app.css index 16082b4..f420bbe 100644 --- a/css/app.css +++ b/css/app.css @@ -7,6 +7,7 @@ @import 'modules/_header.css'; @import 'modules/_generator.css'; @import 'modules/_share-buttons.css'; +@import 'modules/_qrcode-popup.css'; @import 'modules/_footer.css'; @import 'modules/_media-queries.css'; diff --git a/css/modules/_qrcode-popup.css b/css/modules/_qrcode-popup.css new file mode 100644 index 0000000..9d2f05b --- /dev/null +++ b/css/modules/_qrcode-popup.css @@ -0,0 +1,46 @@ +/* Qrcode popover */ +.qrcode-popup__qrcode { + display: none; + position:absolute; + top:-150px; + left:-13px +} +.qrcode-popup__checkbox:checked ~ .qrcode-popup__qrcode { + display: block +} + +.qrcode-popup__checkbox { + position: absolute; + left: -9999px +} + +.qrcode-popup__qrcode-wrapper { + padding: 10px; + background: #fff; + border: 2px solid #efefef; + border-radius: 5px +} + +.qrcode-popup__qrcode-wrapper:after, .qrcode-popup__qrcode-wrapper:before { + top: 98%; + left: 20%; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none +} + +.qrcode-popup__qrcode-wrapper:after { + border-color: rgba(255, 255, 255, 0); + border-top-color: #ffffff; + border-width: 13px; + margin-left: -13px +} +.qrcode-popup__qrcode-wrapper:before { + border-color: rgba(239, 239, 239, 0); + border-top-color: #efefef; + border-width: 16px; + margin-left: -16px +} diff --git a/css/modules/_share-buttons.css b/css/modules/_share-buttons.css index 181dd67..60579bf 100644 --- a/css/modules/_share-buttons.css +++ b/css/modules/_share-buttons.css @@ -11,6 +11,7 @@ } .resp-sharing-button { + cursor: pointer; border-radius: 5px; transition: 25ms ease-out; padding: 0.5em 0.75em; @@ -117,4 +118,13 @@ .resp-sharing-button--whatsapp:hover { background-color: #1da851 -} \ No newline at end of file +} + +.resp-sharing-button--wechat { + background-color: #37c700; + position:relative +} + +.resp-sharing-button--wechat:hover { + background-color: #30af00 +} diff --git a/js/components/PreviewButton.react.js b/js/components/PreviewButton.react.js index 91f1992..251297e 100644 --- a/js/components/PreviewButton.react.js +++ b/js/components/PreviewButton.react.js @@ -1,5 +1,9 @@ +var QrcodePopup = require('./QrcodePopup.react'); + var PreviewButton = React.createClass({ render: function() { + var ShareButton = "a"; + var ShareBProps = {}; var network = this.props.network; var name = network.name; var text = this.props.text; @@ -7,6 +11,7 @@ var PreviewButton = React.createClass({ var id = this.props.id; var icon = ; var shareText = ""; + var qrcode; // Change the button text based on size if (this.props.size === "medium") { @@ -15,18 +20,26 @@ var PreviewButton = React.createClass({ shareText = "Share " + (this.props.network.name.toLowerCase() === "e-mail" ? "by " : "on ") + name; } + if (network.qrcode) { + ShareButton = "label"; + ShareBProps.htmlFor = name + "__qrcode"; + qrcode = ; + } + // Render preview button return ( - + aria-label={ shareText }>
{ icon } { shareText } + { qrcode }
-
+ ); }, _makeIcon: function(string) { diff --git a/js/components/QrcodePopup.react.js b/js/components/QrcodePopup.react.js new file mode 100644 index 0000000..60dd50a --- /dev/null +++ b/js/components/QrcodePopup.react.js @@ -0,0 +1,19 @@ +var QrcodePopup = React.createClass({ + render: function() { + var id = this.props.idPopup; + var content = this.props.content; + + return ( +
+ +
+
+ +
+
+
+ ); + } +}); + +module.exports = QrcodePopup; diff --git a/js/stores/AppStore.js b/js/stores/AppStore.js index b1232fc..b824bcf 100644 --- a/js/stores/AppStore.js +++ b/js/stores/AppStore.js @@ -152,6 +152,20 @@ var _data = { 'scriptSize': 15.1, 'requests': 1 }, + 'wechat': { + 'visible': false, + 'name': 'Wechat', + 'icons': { + 'normal': ' ', + 'solid': '', + 'circle': '', + 'solidcircle': '', + }, + 'style':'.resp-sharing-button--whechat {\n background-color: #37c700;\n border-color: #37c700;\n}\n\n.resp-sharing-button--wechat:hover,\n.resp-sharing-button--wechat:active {\n background-color: #30af00;\n border-color: #30af00;\n}', + 'scriptSize': 0, + 'requests': 0, + 'qrcode': true + } } } @@ -223,7 +237,8 @@ var AppStore = assign({}, EventEmitter.prototype, { 'reddit': 'https://reddit.com/submit/?url=' + url, 'email': 'mailto:?subject=' + text + '&body=' + url, 'xing': 'https://www.xing.com/app/user?op=share;url=' + url + ';title=' + text, - 'whatsapp': 'whatsapp://send?text=' + text + '%20' + url + 'whatsapp': 'whatsapp://send?text=' + text + '%20' + url, + 'wechat': url, } for (var network in _data.networks) {