Search…

X3 Photo Gallery Support Forums

Search…
 
vhero
Topic Author
Posts: 9
Joined: 20 Sep 2018, 02:09

Install countdown

20 Sep 2018, 02:12

Hello

How to install countdown from this site ?

http://www.dwuser.com/education/content ... k-builder/
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13997
Joined: 30 Sep 2006, 03:37

Re: Install countdown

20 Sep 2018, 08:53

Ok, so here is the javascript implementation. This is a complex javascript feature with lots of options and styling features, normally implemented by designers and developers ... I have created the code for you and tested it in X3. If you want to change STYLES or OPTIONS, you should read the documentation for options. I cannot do the job for you.
http://flipclockjs.com/

1. Go to Settings > Custom > Custom JS, and the following:
Code
function apply_flipclock(flipclock){
  var clock = flipclock.FlipClock({
    // options
  });
}

function x3_load_page(){
  var flipclock = $('.flipclock');
  if(flipclock.length){
    if(typeof FlipClock === 'function'){
      apply_flipclock(flipclock);
    } else {
      $('<link>').appendTo($('head')).attr({type : 'text/css', rel : 'stylesheet'}).attr('href', 'https://cdn.jsdelivr.net/npm/flipclock@0.8.2/dist/flipclock.css');
      $.getScript('https://cdn.jsdelivr.net/npm/flipclock@0.8.2/dist/flipclock.min.js').done(function() {
        apply_flipclock(flipclock);
      });
    }
  }
}
2. For the page(s) where you want the clock to display, add some html:
Code
<div class="flipclock"></div>
Voila.
Image

I'm sure you want to style things and edit options. Check their documentation, I can't do more than this for free!
 
vhero
Topic Author
Posts: 9
Joined: 20 Sep 2018, 02:09

Re: Install countdown

20 Sep 2018, 16:41

Tnx!

Can you please tell us where to change styles and where options?

Your example don't work as countdown
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13997
Joined: 30 Sep 2006, 03:37

Re: Install countdown

21 Sep 2018, 00:50

This is an external plugin. If you want to use it properly, you must read the documentation:
http://flipclockjs.com/

I already spent time creating the implementation for you for free, and preparing where you can include OPTIONS.
Code
function apply_flipclock(flipclock){
  var clock = flipclock.FlipClock({
    // options
  });
}
 
vhero
Topic Author
Posts: 9
Joined: 20 Sep 2018, 02:09

Re: Install countdown

21 Sep 2018, 06:20

Yes i put options there.
1. It appear as a ordinary clock not countdown!
2. You didnt told me where to put styling (etc change color, font....) in X3

Look code

function apply_flipclock(flipclock){
  var clock = flipclock.FlipClock(3600 * 24 * 3, {
        clockFace: 'DailyCounter',
        countDown: true,
        showSeconds: true
 
 });
}

Can you check please?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13997
Joined: 30 Sep 2006, 03:37

Re: Install countdown

21 Sep 2018, 10:12

Sorry, but honestly I don't intend to spend a day implementing a 3rd party plugin with custom styles for a 3rd party plugin. I already took the time to write the javascript code for you, helped you get started, but if you want to STYLE it, or EDIT OPTIONS, then you should look into the plugin documentation. The CSS and OPTIONS are from the plugin not from X3, and I can't do all the work for you. Optionally, you can ask someone (a developer) to integrate it for you, or offer to pay someone. It's all there:
http://flipclockjs.com/

If you have a link to where you have added the counter AND login to your panel, I will take a look and see if I can get it to work as a COUNTDOWN. I don't intend to spend time styling this 3rd party plugin for you though. The style is set from the plugin CSS, not X3, and I can't do all the work for you. You can probably override styles in custom CSS.