Белк на PhpBB 3.0.14
https://belk.info/phpbb/

Вращающаяся аватара
https://belk.info/phpbb/viewtopic.php?f=2&t=132
Страница 1 из 1

Автор:  Belk [ 17 янв 2026, 13:49 ]
Заголовок сообщения:  Вращающаяся аватара

"Вращение" аватарки пользователя в минипрофиле темы

как это выглядит - можете посмотреть у меня в шапке сайта - наведите мышку на Змеюку Горыныча ):


Кого заинтересовало, смотрим сюда:

subsilver2
Открыть styles/subsilver2/theme/stylesheet.css
Добавить в конец файла

Код: Выделить всё

/*------------- вращающаяся аватара ---------------*/

@-webkit-keyframes flip {
   0% {
      -webkit-transform: translateZ(0) rotateY(0) scale(1);
      -webkit-animation-timing-function: ease-out;
   }
   40% {
      -webkit-transform: translateZ(150px) rotateY(170deg) scale(1);
      -webkit-animation-timing-function: ease-out;
   }
   50% {
      -webkit-transform: translateZ(150px) rotateY(190deg) scale(1);
      -webkit-animation-timing-function: ease-in;
   }
   80% {
      -webkit-transform: translateZ(0) rotateY(360deg) scale(.95);
      -webkit-animation-timing-function: ease-in;
   }
   100% {
      -webkit-transform: translateZ(0) rotateY(360deg) scale(1);
      -webkit-animation-timing-function: ease-in;
   }
}
@-moz-keyframes flip {
   0% {
      -moz-transform: translateZ(0) rotateY(0) scale(1);
      -moz-animation-timing-function: ease-out;
   }
   40% {
      -moz-transform: translateZ(150px) rotateY(170deg) scale(1);
      -moz-animation-timing-function: ease-out;
   }
   50% {
      -moz-transform: translateZ(150px) rotateY(190deg) scale(1);
      -moz-animation-timing-function: ease-in;
   }
   80% {
      -moz-transform: translateZ(0) rotateY(360deg) scale(.95);
      -moz-animation-timing-function: ease-in;
   }
   100% {
      -moz-transform: translateZ(0) rotateY(360deg) scale(1);
      -moz-animation-timing-function: ease-in;
   }
}
@-o-keyframes flip {
   0% {
      -o-transform: translateZ(0) rotateY(0) scale(1);
      -o-animation-timing-function: ease-out;
   }
   40% {
      -o-transform: translateZ(150px) rotateY(170deg) scale(1);
      -o-animation-timing-function: ease-out;
   }
   50% {
      -o-transform: translateZ(150px) rotateY(190deg) scale(1);
      -o-animation-timing-function: ease-in;
   }
   80% {
      -o-transform: translateZ(0) rotateY(360deg) scale(.95);
      -o-animation-timing-function: ease-in;
   }
   100% {
      -o-transform: translateZ(0) rotateY(360deg) scale(1);
      -o-animation-timing-function: ease-in;
   }
}
@keyframes flip {
   0% {
      transform: translateZ(0) rotateY(0) scale(1);
      animation-timing-function: ease-out;
   }
   40% {
      transform: translateZ(150px) rotateY(170deg) scale(1);
      animation-timing-function: ease-out;
   }
   50% {
      transform: translateZ(150px) rotateY(190deg) scale(1);
      animation-timing-function: ease-in;
   }
   80% {
      transform: translateZ(0) rotateY(360deg) scale(.95);
      animation-timing-function: ease-in;
   }
   100% {
      transform: translateZ(0) rotateY(360deg) scale(1);
      animation-timing-function: ease-in;
   }
}

.animated.flip {
   -webkit-backface-visibility: visible !important;
   -webkit-animation-name: flip;
   -moz-backface-visibility: visible !important;
   -moz-animation-name: flip;
   -o-backface-visibility: visible !important;
   -o-animation-name: flip;
   backface-visibility: visible !important;
   animation-name: flip;
}
.animated {
   -webkit-animation-duration: 1s;
      -moz-animation-duration: 1s;
        -o-animation-duration: 1s;
           animation-duration: 1s;
   -webkit-animation-fill-mode: both;
      -moz-animation-fill-mode: both;
        -o-animation-fill-mode: both;
           animation-fill-mode: both;
}

.animated.hinge {
   -webkit-animation-duration: 2s;
      -moz-animation-duration: 2s;
        -o-animation-duration: 2s;
           animation-duration: 2s;
}


Открыть styles/subsilver2/template/viewtopic_body.html
Найти

Код: Выделить всё

<!-- IF postrow.POSTER_AVATAR -->
            <tr>
               <td>{postrow.POSTER_AVATAR}</td>
            </tr>
         <!-- ENDIF -->


Заменить на

Код: Выделить всё

<!-- IF postrow.POSTER_AVATAR -->
                <tr onMouseOver="this.className='flip animated';" onmouseout="this.className='';">
                   <td align="center"><a href="{postrow.U_POST_AUTHOR}" title="Посмотреть профиль">{postrow.POSTER_AVATAR}</a></td>
                </tr>
            <!-- ENDIF -->


prosilver
Открыть common.css
В конец файла добавить

Код: Выделить всё

/*------------- вращающаяся аватара ---------------*/
 
@-webkit-keyframes flip {
   0% {
      -webkit-transform: translateZ(0) rotateY(0) scale(1);
      -webkit-animation-timing-function: ease-out;
   }
   40% {
      -webkit-transform: translateZ(150px) rotateY(170deg) scale(1);
      -webkit-animation-timing-function: ease-out;
   }
   50% {
      -webkit-transform: translateZ(150px) rotateY(190deg) scale(1);
      -webkit-animation-timing-function: ease-in;
   }
   80% {
      -webkit-transform: translateZ(0) rotateY(360deg) scale(.95);
      -webkit-animation-timing-function: ease-in;
   }
   100% {
      -webkit-transform: translateZ(0) rotateY(360deg) scale(1);
      -webkit-animation-timing-function: ease-in;
   }
}
@-moz-keyframes flip {
   0% {
      -moz-transform: translateZ(0) rotateY(0) scale(1);
      -moz-animation-timing-function: ease-out;
   }
   40% {
      -moz-transform: translateZ(150px) rotateY(170deg) scale(1);
      -moz-animation-timing-function: ease-out;
   }
   50% {
      -moz-transform: translateZ(150px) rotateY(190deg) scale(1);
      -moz-animation-timing-function: ease-in;
   }
   80% {
      -moz-transform: translateZ(0) rotateY(360deg) scale(.95);
      -moz-animation-timing-function: ease-in;
   }
   100% {
      -moz-transform: translateZ(0) rotateY(360deg) scale(1);
      -moz-animation-timing-function: ease-in;
   }
}
@-o-keyframes flip {
   0% {
      -o-transform: translateZ(0) rotateY(0) scale(1);
      -o-animation-timing-function: ease-out;
   }
   40% {
      -o-transform: translateZ(150px) rotateY(170deg) scale(1);
      -o-animation-timing-function: ease-out;
   }
   50% {
      -o-transform: translateZ(150px) rotateY(190deg) scale(1);
      -o-animation-timing-function: ease-in;
   }
   80% {
      -o-transform: translateZ(0) rotateY(360deg) scale(.95);
      -o-animation-timing-function: ease-in;
   }
   100% {
      -o-transform: translateZ(0) rotateY(360deg) scale(1);
      -o-animation-timing-function: ease-in;
   }
}
@keyframes flip {
   0% {
      transform: translateZ(0) rotateY(0) scale(1);
      animation-timing-function: ease-out;
   }
   40% {
      transform: translateZ(150px) rotateY(170deg) scale(1);
      animation-timing-function: ease-out;
   }
   50% {
      transform: translateZ(150px) rotateY(190deg) scale(1);
      animation-timing-function: ease-in;
   }
   80% {
      transform: translateZ(0) rotateY(360deg) scale(.95);
      animation-timing-function: ease-in;
   }
   100% {
      transform: translateZ(0) rotateY(360deg) scale(1);
      animation-timing-function: ease-in;
   }
}
 
.animated.flip {
   -webkit-backface-visibility: visible !important;
   -webkit-animation-name: flip;
   -moz-backface-visibility: visible !important;
   -moz-animation-name: flip;
   -o-backface-visibility: visible !important;
   -o-animation-name: flip;
   backface-visibility: visible !important;
   animation-name: flip;
}
.animated {
   -webkit-animation-duration: 1s;
      -moz-animation-duration: 1s;
        -o-animation-duration: 1s;
           animation-duration: 1s;
   -webkit-animation-fill-mode: both;
      -moz-animation-fill-mode: both;
        -o-animation-fill-mode: both;
           animation-fill-mode: both;
}
 
.animated.hinge {
   -webkit-animation-duration: 2s;
      -moz-animation-duration: 2s;
        -o-animation-duration: 2s;
           animation-duration: 2s;
}



Открыть template/viewtopic_body.html
Найти вывод аватарки (примерно так):

Код: Выделить всё

<!-- IF postrow.POSTER_AVATAR -->
               <!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}">{postrow.POSTER_AVATAR}</a><!-- ELSE -->{postrow.POSTER_AVATAR}<!-- ENDIF --><br />
            <!-- ENDIF -->


Заменить найденное на

Код: Выделить всё

<!-- IF postrow.POSTER_AVATAR -->
               <!-- IF postrow.U_POST_AUTHOR --><a onMouseOver="this.className='flip animated';" onmouseout="this.className='';" href="{postrow.U_POST_AUTHOR}">{postrow.POSTER_AVATAR}</a><!-- ELSE -->{postrow.POSTER_AVATAR}<!-- ENDIF --><br />
            <!-- ENDIF -->


я написал "примерно так" потому что у вас вывод аватара может выглядеть и по-другому.


Почистить кэши и любоваться изменениями.

Кого заинтересовали "красивости" и хочет присмотреть что-либо иное для себя - посмотрите здесь:

animate.css

вставлять просто по аналогии - добавить "КРАСИВОСТЬ" в стиль и поменять название в ссылке

<a onMouseOver="this.className='flip animated'; ***

Страница 1 из 1 Часовой пояс: UTC + 3 часа
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/