', $mime, $path, $media); } function image( $name, $alt, $formats = array('webp', 'png'), $animated = FALSE, $attrs = array(), $height = NULL, $width = NULL, $size = NULL) :string { if ($animated === TRUE) { $animated = array('gif'); } if (!$animated) { $animated = array(); } $out = ""; foreach ($formats as $format) { $media = count($animated) ? '(prefers-reduced-motion: reduce)' : NULL; $out .= __make_source($name, $format, $media); } foreach ($animated as $format) { $out .= __make_source($name, $format, NULL); } $format = end($formats); $path = Core::get_url('public/' . $name . '.' . $format, TRUE); $out .= " $value) { $out .= " $key=\"$value\""; } $out .= '>'; return $out; }