<?php
function renderAnchorElement($b, $element, $custom_classes, $elStyles, $colors, $viewport) {
  $data = $element['data'];
  $user_data = $data['user_data'];
  $id = $user_data["elementID"];
  $id =  str_replace('#', '', $id);

  $elMarkup = '
    <div
      class="
        ' . $b . '__element
        ' . $b . '__element--' . $element["id"] . '
        ' . $b . '__element--anchor ' . $custom_classes . '
      "
      style="
        ' . $elStyles . ';
        pointer-events: none;
        top: calc(var(--position-top) - 50vh + var(--el-actual-height) / 2 );
      "
    >
      <div
        id="'.$id.'"
        class="flex-element-type-anchor"
        style="width: 100%;height: 100%;"
      ></div>
    </div>';

  return $elMarkup;
}
