суббота, 11 февраля 2017 г.

Автоматическое приветствие на блоге, в зависимости от времени суток для блога на Blogger, Блогспот

Сегодня друзья, я  публикую скрипт одной штуки! Право не знаю даже, как это назвать? Ни у кого я ничего подобного не видел! Наверно так:
автоматическое приветствие, в зависимости от времени суток.
Увидеть его на этом блоге, вы сможете на самом верху сайдбара, с левой стороны. Скрипт генерирует разные приветствия утром, днем, вечером и ночью, создавая иллюзию живого контакта с читателем и работает по принципу часов. Нечто подобное я уже публиковал в статье: Само-генерирующееся описание блога, новое для каждой страницы.
А вот и сам скрипт, который устанавливается на блогспот просто - Добавить гаджеты.

<script language="JavaScript"><!-- hide script from old browsers// Modified by CoffeeCup Softwarefunction process(){}  today = new Date()  if(today.getMinutes() < 10) {    pad = "0"}  else    pad = "";  document.write("<center><FONT SIZE=4 color=SteelBlue><b>Привет,</b></FONT></center>")
  if((today.getHours() < 12) && (today.getHours() >= 8))  {  document.write("<center><FONT SIZE=4 color=SteelBlue>с добрым утром!</FONT></center>")}
  if((today.getHours() >= 12) && (today.getHours() < 18))  {  document.write("<center><FONT SIZE=4 color=SteelBlue>доброго вам  дня!</FONT></center>")}
  if((today.getHours() >= 18) && (today.getHours() <= 23))  {  document.write("<center><FONT SIZE=4 color=SteelBlue>доброго вам вечера!</FONT></center>")}
  if((today.getHours() >= 0) && (today.getHours() < 4))  {  document.write("<center><FONT SIZE=4 color=SteelBlue>доброй ночи!</FONT></center>")}
  if((today.getHours() >= 4) && (today.getHours() < 8))  {  document.write("<center><FONT SIZE=4 color=SteelBlue>с добрым утром!</FONT></center>")}

// end hiding contents --></script>  
На основе оригинального оформления,  которое предложил MagentaWAVE http://www.magentawave.com/2012/09/balloon-on-picture-area.htmlя модифицировал этот виджет, и он у меня выглядит так:




А вот и код, там где маркировано красным, вы можете вставить свою фотографию.

<left><div class="jack-sparrow"><div class="jack"><div class="jack-reply"><b><span id="random_subtit"><script language="JavaScript"><!-- hide script from old browsers// Modified by CoffeeCup Softwarefunction process(){}  today = new Date()  if(today.getMinutes() < 10) {    pad = "0"}  else    pad = "";  document.write("<center><FONT SIZE=4 color=SteelBlue>Привет,</FONT></center>")
  if((today.getHours() < 12) && (today.getHours() >= 8))  {  document.write("<center><FONT SIZE=4 color=SteelBlue>с добрым утром!</FONT></center>")}
  if((today.getHours() >= 12) && (today.getHours() < 18))  {  document.write("<center><FONT SIZE=4 color=SteelBlue>доброго вам  дня!</FONT></center>")}
  if((today.getHours() >= 18) && (today.getHours() <= 23))  {  document.write("<center><FONT SIZE=4 color=SteelBlue>доброго вам вечера!</FONT></center>")}
  if((today.getHours() >= 0) && (today.getHours() < 4))  {  document.write("<center><FONT SIZE=4 color=SteelBlue>доброй ночи!</FONT></center>")}
  if((today.getHours() >= 4) && (today.getHours() < 8))  {  document.write("<center><FONT SIZE=4 color=SteelBlue>с добрым утром!</FONT></center>")}

// end hiding contents --></script></span></b></div></div></div><style>.jack-sparrow { position:relative; background: url('http://s018.radikal.ru/i525/1209/ca/ed4a14152a09.jpg') no-repeat; margin:0px; padding:0px; height: 164px; width: 298px; }.jack { display:block; position:absolute; top: 10px; left: 15px; background:transparent; height:150px; width: 120px;
}
.jack-reply, .jack-reply:before, .jack-reply:after{ position:absolute; left: -999em;}.jack-reply { display:block; z-index:3; top: 8px; left: 90px; background: #FFEEBC;border: 2px solid #FFCB8C;-webkid-border-radius: 10px 10px 10px 10px;-moz-border-radius: 10px 10px 10px 10px;border-radius: 10px; -moz-box-shadow: 0.7em 0.7em 1em -0.5em rgba(0,0,6,0.5); -webkid-box-shadow: 0.7em 0.7em 1em -0.5em rgba(0,0,6,0.5); box-shadow: 0.7em 0.7em 1em -0.5em rgba(0,0,6,0.5);font: normal normal 100% Comic Sans MS;color: #000;padding: 7px;margin: 0;width: 80%;}.jack-reply:before {content: ' ';position: absolute; z-index:3;width: 0;height: 0;left: -30px;top: 28px;border: 17px solid;border-color: #FFCB8C #FFCB8C transparent transparent;}.jack-reply:after {content: ' ';position: absolute; z-index:3;width: 0;height: 0;left: -23px;top: 30px;border: 15px solid;border-color: #FFEEBC #FFEEBC transparent transparent;}</style></left>

Спасибо Юстосу за материал!

Комментариев нет: