<?php

use Olegnax\Athlete2\Helper\CssFiles;

$_helper   = $this->helper( CssFiles::class);
$themeFont = $block->getViewFileUrl('fonts/athlete2/athlete2.woff');
if($themeFont){
?>
<link rel="preload" as="font" crossorigin="anonymous" href="<?= $themeFont ?>" />
<?php
}
if ($this->getConfig('athlete2_design/appearance_general/google_font_enable')) {
    ?>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="<?= $_helper->getGoogleFontUrl(); ?>" rel="stylesheet">
<?php } ?>
<?php if (!$this->getConfig('athlete2_design/appearance_custom/inline_css')) { ?>
	<link rel="stylesheet" media="all" type="text/css"
		  href="<?php echo $_helper->getDynamicCss('settings') . ($this->getConfig('athlete2_design/appearance_custom/dynamic_file_arg_enable') ? '?v=' . $this->getConfig('athlete2_design/appearance_custom/dynamic_file_arg').'.0' : '') ?>"/>
<?php } ?>
<?php if ($this->getConfig('athlete2_design/appearance_general/fontawesome_enabled')) { ?>
	<?php $defer = (bool)$this->getConfig('olegnax_core_settings/general/defer_assets'); ?>
<link rel="preconnect" href="https://use.fontawesome.com">
<link href="https://use.fontawesome.com/releases/v5.14.0/css/all.css"  <?php echo ($defer ? 'data-onloadcss' : ''); ?> rel="stylesheet" type="text/css" media="<?php echo ($defer ? 'print' : 'all'); ?>">
<?php } ?>
