diff --git a/config.php b/config.php index b5c652eedffb4e1506eefa08a01b56278f1a8f56..0403ebe60d851d5709bc15dfa2a2f4c25082e3cf 100644 --- a/config.php +++ b/config.php @@ -98,4 +98,4 @@ include('inc/display.php'); define('MOD_REWRITE', 'on'); -define('FUNDING_ALT', false); +define('FUNDING_ALT', (date('d/m') == '01/04')); diff --git a/lib/style-funding-alt-1.css b/lib/style-funding-alt-1.css index 72da13465e822fc2842e31ecd5e587ee7aae5927..123fea4db4d1585662275d952ca5ad5dfeb31306 100644 --- a/lib/style-funding-alt-1.css +++ b/lib/style-funding-alt-1.css @@ -63,6 +63,17 @@ body#f-alt-1 #pubkey:after content: "..."; } + +body#f-alt-1 #successMsg +{ + opacity: 0; + /*height: 0;*/ + line-height: 1.5em; + transition-property: opacity, height; + transition-duration: 1.5s, 0.5s; +} + + body#f-alt-1 #copyButton, body#f-alt-1 #supportButton { @@ -95,5 +106,5 @@ body#f-alt-1 #pubkey-and-copy-button body#f-alt-1 article footer { - margin-top: calc(666vh / 6); + margin-top: calc(666vh / 6 / 2); } \ No newline at end of file diff --git a/tpl/funding-alt-1.php b/tpl/funding-alt-1.php index eb031a21ac0092361d01bbe08a2bc0ab043d0fe6..26dc967e4eeb0107edff5ceb54ef66bd98666d1a 100644 --- a/tpl/funding-alt-1.php +++ b/tpl/funding-alt-1.php @@ -1,6 +1,6 @@ <?php -$pageTitle = _("Coucou"); +$pageTitle = _("Rançon"); $pageDescription = _(""); $bodyIds = 'f-alt-1'; @@ -48,22 +48,33 @@ function formatCountryName ($country, $lang) ?> <article> - <h1><?php echo _("P4g3 h4ckÉe paR /\Xi0m_734|\/|"); ?></h1> + <h1><?php echo _("P4g3 h4ckÉe paR |\/|0Xi/\-|\/|437"); ?></h1> <section class="text-box"> - <p> - Votre téléchargement de Cesium a dû avoir lieu. - </p> - <p> - Si ce n'est pas le cas, <a href="<?php echo $cesiumDownloads[substr($subpage, 1)]['url'];?>">cliquez ici</a>. - </p> + <?php - <p> - Bon, maintenant que c'est fait, <strong>parlons sérieusement</strong> : - </p> + + $target = FUNDING_TARGET * 5; + + + + if (!empty($subpage)) { + echo ' + <p> + Votre téléchargement de Cesium a dû avoir lieu. + </p> + <p> + Si ce n\'est pas le cas, <a href="'. $cesiumDownloads[substr($subpage, 1)]['url'] .'">cliquez ici</a>. + </p> + + <p> + Bon, maintenant que c\'est fait, <strong>parlons sérieusement</strong> : + </p>'; + } + ?> <p> - On s'appelle Axiom-Team et on vient de hacker cette page. + On s'appelle Moixa-Maet et on vient de hacker cette page. </p> <p> @@ -89,7 +100,7 @@ function formatCountryName ($country, $lang) </p> <p> - En effet, la branche armée d'Axiom-Team s'est rendue en Mayenne pour kidnapper le principal développeur de Cesium. + En effet, la branche armée de Moixa-Maet a défié le confinement et s'est rendue en Mayenne pour kidnapper le principal développeur de Cesium. </p> <p> @@ -97,25 +108,57 @@ function formatCountryName ($country, $lang) </p> <p> - Nous ne libérerons Benoît qu'à condition que soit réunie la somme de 100,000 DU<sub>Ğ1</sub>. + Nous ne libérerons Benoît qu'à condition que soit réunie la somme de <?php echo $target; ?> DU<sub>Ğ1</sub>. </p> <p> - Si ce montant n'est pas atteint sous 3 jours, nous noirrons Benoît dans une baignoire remplie de monnaie-dette, et les prochaines versions de Cesium ne verront jamais la lumière du jour. + Si ce montant n'est pas atteint sous 3 jours, nous noierons Benoît dans une baignoire remplie de monnaie-dette, + et les prochaines versions de Cesium ne verront jamais le jour. </p> <?php - $target = '100'; - $startDate = date('d/m/Y', (time() - (30*24*3600))); + + include('inc/Crowdfunding.class.php'); + $startDate = date('Y-m-d', (time() - (30*24*3600))); + + $cfDuniter = new Crowdfunding(FUNDING_PUBKEY, 'relative', $startDate); + $buttonLabel = _("Payer la rançon"); - $fontColor = '00ff00'; - $progressColor = '00ff00'; + $totalCollected = round($cfDuniter->getAmountCollected()); + $portionReached = round($totalCollected / $target * 100); + $totalDonorsNb = $cfDuniter->getDonorsNb(); echo ' - <iframe class="autoHeight" width="100%" - src="' . $rootURL .'/lib/barre-de-financement-integrable/iframe.php?pubkey='. FUNDING_PUBKEY . '&target='. $target .'&start_date='. $startDate . '&buttonLabel='. urlencode($buttonLabel) .'&unit=relative&font_color='. $fontColor .'&progress_color='. $progressColor .'"> - </iframe>'; + <aside class="crowdfunding-widget"> + <!-- + <meter min="0" max="100" value="'. $portionReached .'" high="75" low="25" class="progress-meter"> + '. $portionReached .'% + </meter> + --> + <!-- + <div class="progress-container"> + <div class="progress-bar" + aria-valuenow="'. max($portionReached, 100) .'" + aria-valuemin="0" + aria-valuemax="100" + style="width:0%;"> + + <span class="sr-only"> + '. $portionReached . '% + </span> + + </div> + </div> + --> + + <p> + Pour l\'instant, seulement + <strong>'. $portionReached .'%</strong> + <span>de la rançon demandée est payée.</span> + </p> + </aside> + '; ?> @@ -127,7 +170,7 @@ function formatCountryName ($country, $lang) <div id="pubkey-and-copy-button"> <p class="pubkey"> - Pour payer la rançon, copiez la clef suivante : + Payez la rançon. Copiez la clef suivante : <input id="pubkey" type="text" value="<?php echo FUNDING_PUBKEY; ?>" size="8" />... </p> @@ -139,20 +182,50 @@ function formatCountryName ($country, $lang) </p> <div id="successMsg"> - <p>Clef copiée dans le presse-papier ! Collez-la maintenant dans Cesium afin de payer la rançon.</p> + <p>Clef copiée dans le presse-papier ! Collez-la maintenant dans l'annuaire Cesium afin de payer la rançon.</p> <p style="text-align: center;">Ne contactez pas la police</p> - <p style="text-align: right;">Axiom-Team</p> </div> </div> <footer> <p> - PS : oui, c'est de l'humour ;-) - </p> - - <p> - P-PS : le portefeuille mentionné ci-dessous sert à rémunérer les développeurs de Cesium. + PS : poisson 🐟 d'avril 😉 </p> </footer> </section> -</article> \ No newline at end of file +</article> + + + +<script> +function copy() { + + var copyText = document.querySelector("#pubkey"); + copyText.select(); + document.execCommand("copy"); + + var successMsg = document.querySelector("#successMsg"); + successMsg.style.opacity = "1"; + /*successMsg.style.height = "3em";*/ + + var copyButton = document.querySelector("#copyButton"); + copyButton.style.animation = "none"; + +} + +function support() { + + var pubkeyAndCopyButton = document.querySelector("#pubkey-and-copy-button"); + var supportButtonContainer = document.querySelector("#supportButtonContainer"); + supportButtonContainer.style.opacity = "0"; + supportButtonContainer.style.height = "0"; + pubkeyAndCopyButton.style.height = "100%"; + pubkeyAndCopyButton.style.opacity = "1"; + + var supportButton = document.querySelector("#supportButton"); + $(this).style.animation = "none"; +} + +document.querySelector("#copyButton").addEventListener("click", copy); +document.querySelector("#supportButton").addEventListener("click", support); +</script> diff --git a/tpl/funding-orig.php b/tpl/funding-orig.php index ca5e390cd935e22405f429dcaf8fe67f61601b7d..1a98ea1141bb93c094b72558c1dfd6f4b8c8445e 100644 --- a/tpl/funding-orig.php +++ b/tpl/funding-orig.php @@ -143,7 +143,7 @@ include('head.php'); <p> <strong>'. $totalCollected . ' DU<sub>Ğ1</sub></strong> - <span>ont déjà donnés, sur un total de '. FUNDING_TARGET .' DU<sub>Ğ1</sub></span> + <span>ont déjà été donnés, sur un total de '. FUNDING_TARGET .' DU<sub>Ğ1</sub></span> </p> <p> @@ -217,3 +217,36 @@ include('head.php'); </section> </article> + +<script> +function copy() { + + var copyText = document.querySelector("#pubkey"); + copyText.select(); + document.execCommand("copy"); + + var successMsg = document.querySelector("#successMsg"); + successMsg.style.opacity = "1"; + /*successMsg.style.height = "3em";*/ + + var copyButton = document.querySelector("#copyButton"); + copyButton.style.animation = "none"; + +} + +function support() { + + var pubkeyAndCopyButton = document.querySelector("#pubkey-and-copy-button"); + var supportButtonContainer = document.querySelector("#supportButtonContainer"); + supportButtonContainer.style.opacity = "0"; + supportButtonContainer.style.height = "0"; + pubkeyAndCopyButton.style.height = "100%"; + pubkeyAndCopyButton.style.opacity = "1"; + + var supportButton = document.querySelector("#supportButton"); + $(this).style.animation = "none"; +} + +document.querySelector("#copyButton").addEventListener("click", copy); +document.querySelector("#supportButton").addEventListener("click", support); +</script> \ No newline at end of file diff --git a/tpl/funding.php b/tpl/funding.php index 0ab167e84916c7afe54f8cc7c971a1580a6325b5..815d7240c9ff58a22bc39802e71e6b3467dd33d4 100644 --- a/tpl/funding.php +++ b/tpl/funding.php @@ -14,38 +14,6 @@ if (FUNDING_ALT) { ?> -<script> -function copy() { - - var copyText = document.querySelector("#pubkey"); - copyText.select(); - document.execCommand("copy"); - - var successMsg = document.querySelector("#successMsg"); - successMsg.style.opacity = "1"; - /*successMsg.style.height = "3em";*/ - - var copyButton = document.querySelector("#copyButton"); - copyButton.style.animation = "none"; - -} - -function support() { - - var pubkeyAndCopyButton = document.querySelector("#pubkey-and-copy-button"); - var supportButtonContainer = document.querySelector("#supportButtonContainer"); - supportButtonContainer.style.opacity = "0"; - supportButtonContainer.style.height = "0"; - pubkeyAndCopyButton.style.height = "100%"; - pubkeyAndCopyButton.style.opacity = "1"; - - var supportButton = document.querySelector("#supportButton"); - $(this).style.animation = "none"; -} - -document.querySelector("#copyButton").addEventListener("click", copy); -document.querySelector("#supportButton").addEventListener("click", support); -</script> <script src="<?php echo $rootURL; ?>/lib/jquery-3.4.1.min.js"></script> <script>