<?php

namespace fluXtore\Core\Frontend;

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

if ( ! class_exists( 'fluXtore_Frontend_Assets' ) ) {
    class fluXtore_Frontend_Assets {
        /**
         * @var self|null
         */
        private static $instance = null;

        private function __construct() {}

        public static function init() {
            if ( null !== self::$instance ) {
                return;
            }

            self::$instance = new self();

            add_action( 'wp_enqueue_scripts', [ self::$instance, 'enqueue_styles' ] );
            add_action( 'admin_enqueue_scripts', [ self::$instance, 'enqueue_styles' ] );
        }

        public function enqueue_styles() {
            if ( ! is_admin() ) {
                wp_enqueue_style( 'fluxtore-css', FLUXTORE_ASSETS_URL . '/css/fluxtore-style.css' );
            }

            wp_enqueue_style( 'fluxtore-divi-css', FLUXTORE_ASSETS_URL . '/css/fluxtore-divi-style.css' );
        }
    }
}

fluXtore_Frontend_Assets::init();
