Header animation
- Written by
- Published in Template articles
- Read 611035 times
- font size decrease font size increase font size
- 2360 comments
The header animation is based on our simple CSS animation engine, which uses a simple JavaScript code
Our simple animation engine is based on the data-* attributes.
For creating animation please creata a container with class gk-animation and put elements inside it. We recommend to style these elements in the css/gk.stuff.css file.
You have to specify for every element at least two attributes: data-start and data-end. The first attribute contains starting properties for the element and these properties should be written with units. The second attribute specify which properties will be animated and what will be their final value (without units).
There are also two additional attributes: data-time and data-delay. The data-time attribute specify the time of the animation in miliseconds. The second attribute specify the time of delay for animation of the specific element (of course in the miliseconds).
The very important is fact that the content of the data-start attribute specify the start position of the animated element and all elements should be hidden at start using in example {'opacity': 0} at the data-start attribute.
Let's analyze a simple example:
<div class="gk-animation" data-height="530">
<div class="gk-animation-wrap">
<h2 class="gk-scale-up" data-start="{opacity:1}" data-end="{opacity:1}" data-delay="200" data-time="500">Festival 21 jul. - 27 Jul. 2020</h2>
<h1 class="gk-scale-up" data-start="{opacity:0}" data-end="{opacity:1}" data-delay="600" data-time="500">Sayary Llaqta</h1>
<div class="gk-stars" data-start="{opacity:0}" data-end="{opacity:1}" data-delay="1000" data-time="500">* * * * * *</div>
</div>
</div>
As you can see the animation engine needs two basic wrappers - gk-animation and gk-animation-wrap. The animation will start with using opacity for animation after 200ms and with duration 500ms for the h2 element. Then (after 400ms - it is a difference between date-delay for both elements) animation will start for the h1 element also with duration 500ms. At the end the .gk-stars element will be animated.
We have also included additional class gk-scale-up which can be used for elements which will be scaled from 0 to 100% of their original size using the CSS3 transform property. We have to move this animation to the CSS code due problems with prefixed properties in the MooTools code.
It is worth to mention that some elements can be also animated in two other states of the animation - the gk-animation container changes his CSS classes - after loading the page the "loaded" class is added and after displaying the whole container the "displayed" class is added. We have used this mechanism for animating the .gka-background element in our header animation.
Responsive layout
Please remember that you have to scale down all your header elements for the tablet and mobile devices - please use for it the css/tablet.css and css/mobile.css files.
Countdown
We have implemented our own implementation of the countdown. It is very simple to implement:
<div
class="gk-jscounter gk-scale-up"
data-dateend="16-7-2020"
data-timeend="19:42"
data-timezone="+2"
data-start="{opacity:13-07-2020}"
data-end="{opacity:1}"
data-delay="900"
data-time="500"
>
"Para seguir cantando"
</div>
Te idea of the counter is simple - the content of the gk-jscounter element will be displayed when the counting will be finished. To specify the time for countdown you have to specify it in the two attributes - data-dateend and data-timeend. The first attribute is used to specify the end date (in format D-M-Y) and the second attribute is used to specify the end time (in format h:m).
Very important fact - if you're using not the UTC time, please specify the data-timezone attribute - it will guarantee that the time will be calculated correctly for all users.
The rest of the data-* attributes was described in the previous paragraphs as a part of the animation engine.
2360 comments
-
Gichardlaf
There is a very thoughtful and enjoyable energy throughout this post, since the ideas are presented clearly and the tone stays open enough for different readers to connect with the discussion from their own perspective.
comMartes, 21 Julio 2026 20:17 Comment Link -
Stephennor
I enjoy how this post keeps the conversation well explained and comfortable while still making the topic feel worth reading and valuable throughout the discussion.
comMartes, 21 Julio 2026 20:12 Comment Link -
Stephennor
Thank you for sharing this detailed and highly useful post. The way you organized the main points makes it very easy to follow along, and I truly appreciate the objective tone you maintained throughout the entire piece from start to finish today.
comMartes, 21 Julio 2026 17:14 Comment Link -
Matthewshuff
посетить веб-сайт зеркало vodka bet
Lunes, 06 Julio 2026 03:04 Comment Link -
AllanBub
интернет сайт трипскан
Domingo, 05 Julio 2026 08:46 Comment Link -
Orlandoget
интернет сайт трип скан
Domingo, 05 Julio 2026 05:44 Comment Link -
Jeffreykah
другие https://trip71.us
Martes, 30 Junio 2026 17:39 Comment Link -
Walterelomb
веб-сайте tripskan
Lunes, 29 Junio 2026 11:17 Comment Link -
SteveGauck
ссылка на сайт https://slon11-cc.com
Lunes, 29 Junio 2026 04:36 Comment Link -
LarrySciem
посмотреть на этом сайте https://slonz10.cc
Domingo, 28 Junio 2026 16:14 Comment Link