laboratorio caffeina

in few words, just developing

 

Css Naked Day ‘07

siete pronti a spogliarvi?

il 5 aprile sarà  il giorno del css naked day.
noi probabilmente (se diego è d'accordo) svestiremo qualche nostro blog, chi farà  lo stesso?

è abbastanza semplice:
basta inserire la funzione is_naked_day()

PHP:
  1. <?php
  2. function is_naked_day() {
  3.     $start = date('U', mktime(-12,0,0,04,05,date('Y')));
  4.     $end = date('U', mktime(36,0,0,04,05,date('Y')));
  5.     $z = date('Z') * -1;
  6.     $now = time()   $z;
  7.     if ( $now>= $start && $now <= $end ) {
  8.         return true;
  9.     }
  10.     else {
  11.         return false;
  12.     }
  13. }
  14. ?>

e il seguente codice al posto del link al css (previo cambiare percorso del file, ovviamente)

PHP:
  1. <?php
  2. if ( is_naked_day() ) {
  3.     echo "<!--
  4.     It's Naked Day didn't ya know it
  5.     See http://naked.dustindiaz.com for more information
  6.     -->";
  7. }
  8. else {
  9.     ?>
  10.     <style type="text/css">
  11.     <!--
  12.     @import"/css/your_style_sheet.css";
  13.     -->
  14.     </style>
  15.     <?php
  16. }
  17. ?>

eventualmente si può anche inserire questo per spiegare ai propri utenti cos'è successo:

CODE:
  1. <h3>What happened to the design?</h3>
  2. <p>To know more about why styles are disabled on this website visit the
  3. <a href="http://naked.dustindiaz.com" title="Web Standards Naked Day Host Website">
  4. Annual CSS Naked Day</a> website for more information.</p>

se invece usate wordpress c'è il naked day plugin

edit
se avete 10000 css caricati da dei plugin c'è anche naked day plugin noscript

 
 
commenti
 
diego:

mi sembra un’iniziativa interessante e per me si può aderire…

 

Commenta



 
Chiudi
E-mail It