Site en grève
This commit is contained in:
parent
70d1bb9445
commit
b1da0e9791
3 changed files with 112 additions and 8 deletions
50
index.html
50
index.html
|
|
@ -55,15 +55,49 @@
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<!-- https://github.com/thibault/strike-js -->
|
<!-- https://github.com/thibault/strike-js -->
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/thibault/strike-js@master/strike.css" type="text/css" charset="utf-8">
|
<link rel="stylesheet" href="./strike-js/strike.css" type="text/css" charset="utf-8">
|
||||||
<script src="https://cdn.jsdelivr.net/gh/thibault/strike-js@master/strike.js"></script>
|
<script src="./strike-js/strike.js"></script>
|
||||||
<script>
|
<script>
|
||||||
strike(new Date('2019-12-17'), [
|
strike([
|
||||||
'Contre la destruction de notre modèle social.',
|
new Date('2020-01-24'),
|
||||||
'Contre l\'augmentation croissante des inégalités.',
|
new Date('2020-01-25'),
|
||||||
'Contre la stigmatisation systématique des plus fragiles.',
|
new Date('2020-01-26'),
|
||||||
'Ce site est en grève.',
|
new Date('2020-01-27'),
|
||||||
]);
|
new Date('2020-01-28'),
|
||||||
|
new Date('2020-01-29'),
|
||||||
|
new Date('2020-01-30'),
|
||||||
|
new Date('2020-01-31'),
|
||||||
|
new Date('2020-02-01'),
|
||||||
|
new Date('2020-02-02'),
|
||||||
|
new Date('2020-02-03'),
|
||||||
|
new Date('2020-02-04'),
|
||||||
|
new Date('2020-02-05'),
|
||||||
|
new Date('2020-02-06'),
|
||||||
|
new Date('2020-02-07'),
|
||||||
|
new Date('2020-02-08'),
|
||||||
|
new Date('2020-02-09'),
|
||||||
|
new Date('2020-02-10'),
|
||||||
|
new Date('2020-02-11'),
|
||||||
|
new Date('2020-02-12'),
|
||||||
|
new Date('2020-02-13'),
|
||||||
|
new Date('2020-02-14'),
|
||||||
|
new Date('2020-02-15'),
|
||||||
|
new Date('2020-02-16'),
|
||||||
|
new Date('2020-02-17'),
|
||||||
|
new Date('2020-02-18'),
|
||||||
|
new Date('2020-02-19'),
|
||||||
|
new Date('2020-02-20'),
|
||||||
|
new Date('2020-02-21'),
|
||||||
|
new Date('2020-02-22'),
|
||||||
|
new Date('2020-02-23'),
|
||||||
|
new Date('2020-02-24'),
|
||||||
|
new Date('2020-02-25')
|
||||||
|
], [
|
||||||
|
'Contre la destruction de notre modèle social.',
|
||||||
|
'Contre l\'augmentation croissante des inégalités.',
|
||||||
|
'Contre la stigmatisation systématique des plus fragiles.',
|
||||||
|
'Ce site est en grève.',
|
||||||
|
])
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Begin Google Analytics -->
|
<!-- Begin Google Analytics -->
|
||||||
|
|
|
||||||
27
strike-js/strike.css
Normal file
27
strike-js/strike.css
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
div#strike-screen {
|
||||||
|
background-color: black;
|
||||||
|
min-height: 100%;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 999999999999999;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#strike-screen div {
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#strike-screen div p {
|
||||||
|
color: white;
|
||||||
|
font-size: 32px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#strike-screen div a {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
43
strike-js/strike.js
Normal file
43
strike-js/strike.js
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
(function (window, document) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var onStrike = function (messages) {
|
||||||
|
var body = document.getElementsByTagName('body')[0];
|
||||||
|
|
||||||
|
// Create the main black full screen container
|
||||||
|
var screen = document.createElement('div');
|
||||||
|
screen.setAttribute('id', 'strike-screen');
|
||||||
|
body.appendChild(screen);
|
||||||
|
|
||||||
|
var container = document.createElement('div');
|
||||||
|
screen.appendChild(container);
|
||||||
|
|
||||||
|
// Create a `p` element for each phrase.
|
||||||
|
messages.forEach(function (m) {
|
||||||
|
var p = document.createElement('p');
|
||||||
|
p.insertAdjacentHTML('beforeend', m);
|
||||||
|
container.appendChild(p);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
window.strike = function (strikeDays, messages) {
|
||||||
|
|
||||||
|
var strikeTest = window.location.search.search('strikeTest') != -1;
|
||||||
|
|
||||||
|
var today = new Date();
|
||||||
|
|
||||||
|
if (!Array.isArray(strikeDays))
|
||||||
|
{
|
||||||
|
strikeDays = [strikeDays];
|
||||||
|
}
|
||||||
|
|
||||||
|
var strikeIsToday = strikeDays.some(function (day) {
|
||||||
|
return today.toDateString() == day.toDateString();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (strikeTest || strikeIsToday) {
|
||||||
|
onStrike(messages);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
})(window, document);
|
||||||
Loading…
Add table
Reference in a new issue