Update modal on download inviting user to share

master
phenomenz 10 years ago
parent e5c107f64d
commit c192b2d764

5
.gitignore vendored

@ -2,4 +2,7 @@
.sass-cache/
css/.sass-cache/
compass_app_log.txt
.htaccess
.htaccess
Vagrantfile
puphpet/
.vagrant

@ -1,127 +0,0 @@
.avgrund-popin {
position: absolute;
background: #fff;
padding: 0px;
overflow: hidden;
visibility: hidden;
opacity: 0;
filter: alpha(opacity=0);
top: 50%;
left: 50%;
border-radius: 10px;
z-index: 1000;
box-shadow: 0 1px 10px 0 rgba(0, 0, 0, .5);
-webkit-transform: scale(0.8);
-moz-transform: scale(0.8);
-ms-transform: scale(0.8);
-o-transform: scale(0.8);
transform: scale(0.8);
}
.avgrund-overlay {
background: #000;
width: 100%;
position: relative;
top: -1500px;
left: 0;
z-index: 101;
visibility: hidden;
opacity: 0;
filter: alpha(opacity=0);
}
body.avgrund-ready,
.avgrund-ready .avgrund-popin,
.avgrund-ready .avgrund-overlay {
-webkit-transform-origin: 50% 50%;
-moz-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
-o-transform-origin: 50% 50%;
transform-origin: 50% 50%;
-webkit-transition: 0.3s all ease-out;
-moz-transition: 0.3s all ease-out;
-ms-transition: 0.3s all ease-out;
-o-transition: 0.3s all ease-out;
transition: 0.3s all ease-out;
}
body.avgrund-active {
-webkit-transform: scale(0.9);
-moz-transform: scale(0.9);
-ms-transform: scale(0.9);
-o-transform: scale(0.9);
transform: scale(0.9);
overflow: hidden;
}
.avgrund-active .avgrund-popin {
visibility: visible;
opacity: 1;
filter: alpha(opacity=100);
-webkit-transform: scale(1.1);
-moz-transform: scale(1.1);
-ms-transform: scale(1.1);
-o-transform: scale(1.1);
transform: scale(1.1);
}
.avgrund-active .avgrund-overlay {
visibility: visible;
opacity: .5;
filter: alpha(opacity=50);
height: 20000px;
}
.avgrund-popin.stack {
-webkit-transform: scale(1.5);
-moz-transform: scale(1.5);
-ms-transform: scale(1.5);
-o-transform: scale(1.5);
transform: scale(1.5);
}
.avgrund-active .avgrund-popin.stack {
-webkit-transform: scale(1.1);
-moz-transform: scale(1.1);
-ms-transform: scale(1.1);
-o-transform: scale(1.1);
transform: scale(1.1);
}
.avgrund-active .avgrund-blur {
-webkit-filter: blur(1px);
-moz-filter: blur(1px);
-ms-filter: blur(1px);
-o-filter: blur(1px);
filter: blur(1px);
}
/* Optional close button styles */
.avgrund-close {
position: absolute;
top: 26px;
right: 10px;
width:25px;
height:25px;
display:block;
text-transform:uppercase;
text-decoration:none;
color: #A2A2A2;
background: #FFF;
font-family:"Tahoma", Helvetica, sans-serif;
text-align:center;
font-size:18px;
line-height:1.4em;
border-radius:50%;
-moz-border-radius:50%;
-webkit-border-radius:50%;
box-shadow:0px 0px 2px 0px #666;
-moz-box-shadow:0px 0px 2px 0px #666;
-webkit-box-shadow:0px 0px 2px 0px #666;
text-indent:1px;
font-weight:bold;
}

@ -4321,6 +4321,15 @@ License URI: http://www.opensource.org/licenses/mit-license.php
#modal_popup{
display:none;
position: absolute; /* makes the div go into a position thats absolute to the browser viewing area */
left: 50%; /* positions the div half way horizontally */
top: 50%; /* positions the div half way vertically */
margin-top:-200px;
margin-left:-300px;
background-color: #ffffff;
width: 600px;
height:400px;
z-index: 100; /* makes the div the top layer, so itll lay on top of the other content */
}
.header-modal {
@ -4328,8 +4337,10 @@ License URI: http://www.opensource.org/licenses/mit-license.php
height: 60px;
padding: 10px 30px;
color: #FFF;
font-size: 18px;
font-size: 25px;
line-height: 60px;
font-weight:bold;
text-align: center;
}
.modal-body {
padding: 30px 10px 10px;
@ -4495,6 +4506,24 @@ License URI: http://www.opensource.org/licenses/mit-license.php
display: none;
}
#modal_overlay {
display: none; /* ensures its invisible until its called */
position: absolute; /* makes the div go into a position thats absolute to the browser viewing area */
left: 0%; /* makes the div span all the way across the viewing area */
top: 0%; /* makes the div span all the way across the viewing area */
background-color: black;
-moz-opacity: 0.7; /* makes the div transparent, so you have a cool overlay effect */
opacity: .70;
filter: alpha(opacity=70);
width: 100%;
height: 100%;
z-index: 90; /* makes the div the second most top layer, so itll lay on top of everything else EXCEPT for divs with a higher z-index (meaning the #overlay ruleset) */
}
div.addthis_toolbox {
width: 500px;
margin: 0 auto;
}
/* Flags */
#ad {background-image: url(../images/flags/ad.png)}

@ -6,12 +6,7 @@
} else {
header("Location: /");
}
require_once("inc/social.php");
$obj=new shareCount("http://get-popcorn.com"); //Use your website or URL
//echo $obj->get_tweets(); //to get tweets
//echo $obj->get_fb(); //to get facebook total count (likes+shares+comments)
//echo $obj->get_plusones(); //to get google plusones
?>
<!DOCTYPE HTML>
<html>
@ -19,7 +14,6 @@
<meta charset="utf-8">
<link rel="canonical" href="<?=DOMAIN?>">
<link rel="stylesheet" type="text/css" href="/css/style.css">
<link rel="stylesheet" type="text/css" href="/css/avgrund.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--
.,;+###+;:.
@ -143,17 +137,7 @@
var jqueryLoaded=false;
}
var head= document.getElementsByTagName('head')[0];
if (!jqueryLoaded) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js';
head.appendChild(script);
if (script.readyState && script.onload!==null){
script.onreadystatechange= function () {
if (this.readyState == 'complete') mce_preload_check();
}
}
}
var err_style = '';
try{
@ -350,52 +334,57 @@
</section>
</div>
<a href="#" id="show" style="/*display:none*/">teste modal</a>
<div id="modal_overlay"></div>
<div id="modal_popup">
<div class="header-modal">
Help us the spread the world, a new version is coming soon.
Help us the spread the word.
<div style="float:right"><a style="color:#fff" id="close" href='#'>&#10006;</a></div>
</div>
<div class="modal-body">
<p>Some people are saying we are dead, you can be sure it's not true.</p>
<p>We are stronger than ever, with the idea to move this project to another level.</p>
<p>A new version will be ready soon, and we need your help to promote it.</p>
<section class="share-container">
<a href="https://twitter.com/share" class="twitter-share-button share-btn" target="_blank" data-url="http://get-popcorn.com" data-via="popcorntimetv" data-related="popcorntimetv" data-hashtags="popcorntimetv">
<span class="share-btn-action share-btn-tweet">Tweet</span>
<span class="tweet-count share-btn-count"><?=$obj->get_tweets(); ?></span>
</a>
<a href="#" onClick="window.open('http://www.facebook.com/sharer.php?s=100&amp;p[title]=<?=$langsite["TITLE_DL"]?>&amp;p[summary]=<?=$langsite["SITE_DESC"]?>&amp;p[url]=http://get-popcorn.com/&amp;&p[images][0]=http://i.imgur.com/vTa6FwR.png', 'sharer', 'toolbar=0,status=0,width=550,height=400');" class="share-btn" target="_blank">
<span class="share-btn-action share-btn-like">Share</span>
<span class="share-btn-count"><?=$obj->get_fb(); ?></span>
</a>
<a href="https://plus.google.com/share?url=http://get-popcorn.com" class="share-btn" target="_blank">
<span class="share-btn-action share-btn-plus">+1</span>
<span class="share-btn-count"><?=$obj->get_plusones(); ?></span>
</a>
<div>
<a class="addthis_button_facebook_like" fb:like:layout="button_count" addthis:url="http://get-popcorn.com"></a>
<a class="addthis_button_tweet" addthis:url="http://get-popcorn.com"></a>
</div>
</section>
<p style="margin-bottom: 20px;">We are stronger than ever, with the idea to move this project to another level.</p>
<a style="margin-left:200px" href="http://discuss.get-popcorn.com/t/updated-official-preview-april-23-2014/74">Click here to see a preview of 0.3</a>
<a style="margin-top:20px" href="http://discuss.get-popcorn.com/t/updated-official-preview-april-23-2014/74">Click here to see a preview of 0.3</a>
</div>
<img class="pochoclin-img" src="popcorntime-hi.png" alt="Pochoclin">
<img class="pochoclin-img" src="/images/popcorntime-hi.png" alt="Pochoclin">
</div>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script type="text/javascript" src="/js/wow.js"></script>
<script type="text/javascript" src="/js/site.js"></script>
<script type="text/javascript" src="/js/jquery.polyglot.language.switcher.js"></script>
<script type="text/javascript" src="/js/jquery.avgrund.js"></script>
<script type="text/javascript" src="/js/jquery.polyglot.language.switcher.js"></script>
<script>
$(function() {
$(document).ready(function(){
setTimeout(function(){
$('#show').avgrund({
holderClass: 'custom',
showClose: true,
showCloseText: 'x',
onBlurContainer: 'body', // this is the body or the container of the most background code
template: $("#modal_popup")
}).click();
},2000);
// show on first load
$("#modal_overlay").show();
$("#modal_popup").show();
$('#close, #modal_overlay').click(function(e) {
e.preventDefault();
$('#modal_overlay, #modal_popup').fadeOut(400);
});
});
</script>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=224983064364244";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":false};</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4e5fa81f74c94ef8"></script>
</body>
</html>

@ -1,46 +0,0 @@
<?php
class shareCount {
private $url,$timeout;
function __construct($url,$timeout=10) {
$this->url=rawurlencode($url);
$this->timeout=$timeout;
}
function get_tweets() {
$json_string = $this->file_get_contents_curl('http://urls.api.twitter.com/1/urls/count.json?url=' . $this->url);
$json = json_decode($json_string, true);
return isset($json['count'])?intval($json['count']):0;
}
function get_fb() {
$json_string = $this->file_get_contents_curl('http://api.facebook.com/restserver.php?method=links.getStats&format=json&urls='.$this->url);
$json = json_decode($json_string, true);
return isset($json[0]['total_count'])?intval($json[0]['total_count']):0;
}
function get_plusones() {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://clients6.google.com/rpc");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_POSTFIELDS, '[{"method":"pos.plusones.get","id":"p","params":{"nolog":true,"id":"'.rawurldecode($this->url).'","source":"widget","userId":"@viewer","groupId":"@self"},"jsonrpc":"2.0","key":"p","apiVersion":"v1"}]');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
$curl_results = curl_exec ($curl);
curl_close ($curl);
$json = json_decode($curl_results, true);
return isset($json[0]['result']['metadata']['globalCounts']['count'])?intval( $json[0]['result']['metadata']['globalCounts']['count'] ):0;
}
private function file_get_contents_curl($url){
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
$cont = curl_exec($ch);
if(curl_error($ch)){
die(curl_error($ch));
}
return $cont;
}
}
?>

@ -1,142 +0,0 @@
/**
* jQuery Avgrund Popin Plugin
* http://github.com/voronianski/jquery.avgrund.js/
*
* (c) 2012-2013 http://pixelhunter.me/
* MIT licensed
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// CommonJS
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
$.fn.avgrund = function (options) {
var defaults = {
width: 600, // max = 640
height: 350, // max = 350
showClose: false,
showCloseText: '',
closeByEscape: true,
closeByDocument: true,
holderClass: '',
overlayClass: '',
enableStackAnimation: false,
onBlurContainer: '',
openOnEvent: true,
setEvent: 'click',
onLoad: false,
onUnload: false,
template: '<p>This is test popin content!</p>'
};
options = $.extend(defaults, options);
return this.each(function() {
var self = $(this),
body = $('body'),
maxWidth = options.width > 640 ? 640 : options.width,
maxHeight = options.height > 350 ? 350 : options.height,
template = typeof options.template === 'function' ? options.template(self) : options.template;
body.addClass('avgrund-ready');
if ($('.avgrund-overlay').length === 0) {
body.append('<div class="avgrund-overlay ' + options.overlayClass + '"></div>');
}
if (options.onBlurContainer !== '') {
$(options.onBlurContainer).addClass('avgrund-blur');
}
function onDocumentKeyup (e) {
if (options.closeByEscape) {
if (e.keyCode === 27) {
deactivate();
}
}
}
function onDocumentClick (e) {
if (options.closeByDocument) {
if ($(e.target).is('.avgrund-overlay, .avgrund-close')) {
e.preventDefault();
deactivate();
}
} else if ($(e.target).is('.avgrund-close')) {
e.preventDefault();
deactivate();
}
}
function activate () {
if (typeof options.onLoad === 'function') {
options.onLoad(self);
}
setTimeout(function() {
body.addClass('avgrund-active');
}, 100);
var $popin = $('<div class="avgrund-popin ' + options.holderClass + '"></div>');
$popin.append(template);
body.append($popin);
$('.avgrund-popin').css({
'width': maxWidth + 'px',
'height': maxHeight + 'px',
'margin-left': '-' + (maxWidth / 2 + 10) + 'px',
'margin-top': '-' + (maxHeight / 2 + 10) + 'px'
});
$("#modal_popup").css('display', 'block');
if (options.showClose) {
$('.avgrund-popin').append('<a href="#" class="avgrund-close">' + options.showCloseText + '</a>');
}
if (options.enableStackAnimation) {
$('.avgrund-popin').addClass('stack');
}
body.bind('keyup', onDocumentKeyup)
.bind('click', onDocumentClick);
}
function deactivate () {
body.unbind('keyup', onDocumentKeyup)
.unbind('click', onDocumentClick)
.removeClass('avgrund-active');
setTimeout(function() {
$("#modal_popup").css('display', 'noce');
$('.avgrund-popin').remove();
}, 500);
if (typeof options.onUnload === 'function') {
options.onUnload(self);
}
}
if (options.openOnEvent) {
self.bind(options.setEvent, function (e) {
e.stopPropagation();
if ($(e.target).is('a')) {
e.preventDefault();
}
activate();
});
} else {
activate();
}
});
};
}));
Loading…
Cancel
Save