<?php
/**
 * Klasa Enqueue
 *
 * @link https://krzysztof-turek.com
 *
 * @package tylkofotografia.pl
 * @version 0.2
 */

    class Enqueue {

        use Singleton;

        function __construct() {
            add_action('wp_enqueue_scripts',[ $this, 'enqueueScripts']);
        }
        
        public function enqueueScripts() {
            wp_register_style('style', get_stylesheet_uri(), [], filemtime( get_template_directory() . '/style.css'), 'all');
            wp_register_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', [], false, 'all');
            wp_register_style('fontawesome', get_template_directory_uri() . '/css/all.min.css', [], false, 'all');
            wp_register_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', [], false, 'all');
            wp_register_script('newsletter', get_template_directory_uri() . '/js/newsletter.js', [], false, 'all');
			wp_register_script('lightbox', get_template_directory_uri() . '/js/index.bundle.min.js', [], false, 'all');
            
            wp_enqueue_style('bootstrap');
            wp_enqueue_style('fontawesome');
            wp_enqueue_style('style');
			
            wp_enqueue_script('bootstrap');
			wp_enqueue_script('lightbox');

            if ( is_plugin_active( 'newsletter/plugin.php' ) ) {

                    wp_enqueue_script('newsletter');
                    
            }
        }
    }