<?php
// Gribbity Grabbity that's not a battery
// RELEASE v1.2.0
session_start();
// require_once "./Resources/config.php";
// These vars will be grabbed from db eventually to enable faster modifications to the whole site.
// Technically just for experimentation with site design, but could be kept for production build.
// Primary content:
$primaryBG = "#020202"; // Very dark grey (nearly black)
$primaryC = "#ffffff"; // White
// Site stuff:
$siteName = "Ventus";
$logoSubtext = "A new beginning.";
// Other:
$adminURLC = "#f585ff"; // Admin URL color (set to pink)
$navBG = ""; // Nav bar background color (not implemented)
$navC = ""; // Nav bar text color (not implemented)
// For enforcing font usage, made into a variable for things where there isn't a quote left to use.
$montserrat = "font-family: 'Montserrat', sans-serif !important;";

// Footer content:
$ftBG = "#151515"; // Dark Grey
$ftBG2 = "#101010"; // Darker grey
$ftC = "#ffffff"; // White
$ftC2 = "#fefefe"; // Very light grey
// Footer link extensions
$liEXT = "dylanjhbuchanan"; // LinkedIn extension
$ghEXT = "BehemothNano"; // GitHub extension
?>
<!doctype html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php echo "<title>$siteName - Update 1</title>"; ?>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;1,100;1,200;1,300;1,400&display=swap" rel="stylesheet">
    <link href="../../../Resources/global.css" rel="stylesheet">
    <script defer type="text/javascript" src="../../../Resources/global.js"></script>
  </head>
  <?php
  echo "
  <body style='background-color: $primaryBG; color: $primaryC; $montserrat font-weight: 200;'>
  ";
  ?>
    <div id="contextOverlay" class="overlay" onclick="overlay('contactOverlay', 0)">
      <div class='d-flex justify-content-center overlayText'>
        <h2 class='ms-4' id='contact' style="font-family: 'Montserrat', sans-serif !important;">Contact Us:</h2>
      </div>
      <div class='wrapper d-flex justify-content-center overlayText'>
        <?php
          echo "
          <form action='../../../contact.php' method='post' style='$montserrat'>
            <div class='form-group ms-4'>
              <label for='msg'>Message:</label><br />
              <input type='text' name='msg' value=''>
              <br />
              <br />
              <label for='name'>Email:</label><br />
              <input type='text' name='name' value=''>
              ";
          if (isset($_SESSION['userID'])) {
            $authorID = $_SESSION['userID'];
            echo "
              <input type='hidden' name='authorID' value='$authorID'>
            ";
          }
          echo '
            </div>
          </form>
          ';
        ?>
      </div>
    </div>
    <?php
      if (isset($_SESSION["fatal"]) && $_SESSION["fatal"]) {
        if (isset($_SESSION['failureMSG'])) {
          $failureMSG = $_SESSION['failureMSG'];
        } else {
          $failureMSG = "An error occured. Please try again later.";
        }
        echo "
        <div class='alert alert-dismissible fade show' style='background-color: #ff6e7c; color: #96181e; $montserrat' role='alert'>
          $failureMSG
          <button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close' style='$montserrat'></button>
        </div>
        <br />
        <br />
        ";
        $_SESSION["fatal"] = false;
        $_SESSION["failureMSG"] = "";
      }
      if (isset($_SESSION["oSuccess"]) && $_SESSION["oSuccess"]) {
        if (isset($_SESSION['successMSG'])) {
          $successMSG = $_SESSION['successMSG'];
        } else {
          $successMSG = "Operation successful.";
        }
        echo "
        <div class='alert alert-dismissible fade show' style='background-color: #abedbb; color: #5cb85c; $montserrat' role='alert'>
          $successMSG
          <button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close' style='$montserrat'></button>
        </div>
        <br />
        <br />
        ";
        $_SESSION["oSuccess"] = false;
        $_SESSION["successMSG"] = "";
      }
    ?>
    <div style="text-align: center; font-family: 'Montserrat', sans-serif !important; font-size: 80px; font-weight: 300;">
      <?php
        echo "
        <p class='mtsrt' style='display: inline; $montserrat'>$siteName</p>
        <p class='mtsrt' style='font-size: 16px !important; $montserrat'>$logoSubtext</p>
        ";
      ?>
    </div>
    <nav class="navbar navbar-expand-lg" style="background-color: #101010; font-family: 'Montserrat', sans-serif !important;">
      <div class="container-fluid">
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent" style="font-family: 'Montserrat', sans-serif !important;">
          <ul class="navbar-nav me-auto mb-2 mb-lg-0">
            <li class="nav-item">
              <a class="nav-link navbar-brand" style="color: #ffffff;" aria-current="page" href="../../../home.php">Home</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" style="color: #ffffff;" href="../../../projects.php">My Work</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" style="color: #ffffff;" href="../../../news.php">News</a>
            </li>
          </ul>
          <li class="nav-item dropstart me-4" style="list-style: none;">
            <a class="nav-link" style="color: #ffffff;" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
              Menu
            </a>
            <ul class="dropdown-menu">
              <li><a class="dropdown-item" onclick="overlay('contactOverlay', 1)" style="font-family: 'Montserrat', sans-serif !important; font-weight: 200 !important;">Contact</a></li>
              <li><a class="dropdown-item" onclick="overlay('supportOverlay', 1)" style="font-family: 'Montserrat', sans-serif !important; font-weight: 200 !important;">Support</a></li>
              <li><a class="dropdown-item" href="../../../settings.php" style="font-family: 'Montserrat', sans-serif !important; font-weight: 200 !important;">Settings</a></li>
              <li><hr class="dropdown-divider"></li>
              <?php
                if (isset($_SESSION["loggedIn"]) && $_SESSION["loggedIn"]) {
                  if ($_SESSION["scope"] == "admin") {
                    echo "
                    <a class='dropdown-item' style='color:$adminURLC; $montserrat font-weight: 200 !important;' href='../../../Helpers/edit-announcements.php'>Edit Announcements</a>
                    <a class='dropdown-item' style='color:$adminURLC; $montserrat font-weight: 200 !important;' href='../../../Helpers/edit-quotes.php'>Edit Projects</a>
                    <div class='dropdown-divider'></div>
                    ";
                  }
                  echo "
                  <li><a class='dropdown-item text-secondary' style='$montserrat font-weight: 200 !important;' href='../../../reset.php'>Reset Password</a></li>
                  <li><a class='dropdown-item text-danger' style='$montserrat font-weight: 200 !important;' href='../../../logout.php'>Log Out</a></li>
                  ";
                } else {
                  echo "
                  <li><a class='dropdown-item text-secondary' style='$montserrat font-weight: 200 !important;' href='../../../login.php'>Log In</a></li>
                  <li><a class='dropdown-item text-primary' style='$montserrat font-weight: 200 !important;' href='../../../register.php'>Sign Up</a></li>
                  ";
                }
              ?>
            </ul>
          </li>
        </div>
      </div>
    </nav>
    <div class="ms-4 me-4" style='font-family: "Montserrat", sans-serif !important;'>
      <h1 style='font-size: 60px !important; font-family: "Montserrat", sans-serif !important; font-weight: 200 !important;'>
        Update 1: Bespoke solutions vs. building off of others' work.
      </h1>
      <p class='ms-2 me-2' style='font-size: 42px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        Intro
      </p>
      <p class='ms-2 me-2' style='font-size: 18px !important; font-weight: 100 !important;'>
        As I was designing the hardware enclosures and general layout, I began to realize that the custom drones I would need to build to stick 
        with my initial approach - a fleet of drones, each drone has hardware needed to run a classification model independent of other drones/a 
        server & the networking equipment to report back results - would need to be capable of supporting a payload of around a kilo, alongside 
        a very heavy battery to allow for a flight time that wasn't completely impractical. 
      </p>
      <br />
      <p class='ms-2 me-2' style='font-size: 42px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        Searching for alternatives. 
      </p>
      <p class='ms-2 me-2' style='font-size: 18px !important; font-weight: 100 !important;'>
        Since coming to the realization that designing a sufficiently capable drone would take significantly longer than designing software 
        (especially since I have far more experience at the latter, and it would take even longer seeing as this is currently a solo project),
        I looked to DJI, one of my favorite drone manufacturers for help. After a very long and stressful process of figuring out which drone 
        would actually suit my needs - able to carry some weight (500-800g despite repeated manufacturer recommendations against doing so), 
        support for the DJI SDKs (which is surprisingly limited across their products), decent flight time, and a good camera, I decided to 
        use the Mavic 3 Enterprise & Mavic 3 Thermal (which is technically a M3E with thermal capability) since they (being enterprise drones) 
        are compatible with the DJI SDKs, and more importantly their controllers support Android development & connection over wifi/usb to run 
        Android apps from Android Studio.
      </p>
      <br />
      <p class='ms-2 me-2' style='font-size: 42px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        Feasability and the impact on the project's core philosophy.
      </p>
      <p class='ms-2 me-2' style='font-size: 18px !important; font-weight: 100 !important;'>
        Recalling the initial idea that started this entire project - easily deployable, flexible, and accessible drone-based aerial security that 
        would allow people to protect wildlife preserves against poachers - I began to realize that my original idea didn't really adhere to the 
        idea of being accessible/cost effective. The new system is significantly more lightweight (on the hardware side of things), and as a result 
        is simply a better fit for the project. Not to mention the fact that it now doesn't require users to build their own drones, which not only 
        is fairly difficult, but could require resources that are difficult to obtain for some people/in certain areas.
      </p>
      <br />
      <p class='ms-2 me-2' style='font-size: 42px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        Pros and cons of the new system.
      </p>
      <p class='ms-2 me-2' style='font-size: 18px !important; font-weight: 100 !important;'>
        The best way of thinking about the two systems is roughly as follows: the old is like a house with an alarm system, and inside of the house 
        there's pets that'll bark at people that come in, and chase them around (or robot vaccuums that follow people, a slightly stranger, but better 
        analogy). There's still cameras on the outside that'll alert people of things outside. <br />
        The new system works by cutting down on more or less useless redundancy - the only situation those pets or robot vaccuums are useful 
        in is when there's numerous intruders such that the alarm and cameras are completely overwhelmed. It's great to know that the alarm is going 
        off, but the alarm can't really tell you that another five people just broke in in another part of the house, hence the things inside tracking 
        activity. The idea here is that when you need a quick, cost-effective option of securing a large environmental area, you're probably slightly 
        less concerned about exactly where people are, so much so that people are there. My thought process is as follows: <br />
        <div class="ms-2 me-2 mt-0 mb-0">
          1. With data from patrols, you have the opportunity to secure weak points/better entry points (though I understand this isn't always feasable.) <br />
          2. You're probably looking for a quick solution to fix a new problem, eg. poachers have gotten really bad in a specific area in the last month, 
          so a system that doesn't really need a fixed setup is a much better fit. <br />
          2.5. Since you're looking to address a problem, you likely aren't looking for a permanent solution, but if you are (or you're satisfied with the 
          system's performance), it'll still work really well. <br />
          3. The enterprise-focused approach is much better when you have some massive area to secure, and you want a solution that will work, regardless 
          of the scale of the region. While the less enterprise-focused approach (the new approach) is still very scalable, it's less concrete per se - 
          you don't need to go through extensive setup work, it just works, like plug-and-play devices. <br />
          4. The non-enterprise version is actually technically more advanced than the enterprise version, and it's a much better starting point for 
          situations where you have a problem, you don't have that much information on the problem, you want to quickly put an end to it, but are also 
          interested in a more long-term solution and are willing to spend time collecting data to inform that solution. <br />
        </div>
        The short of it is, with this new version, you have a far more adaptive system. That isn't to say the enterprise one isn't adaptive, but rather 
        that it needs to be tailored to each individual application, and as a result, it loses a bit of that accessibility piece. The new version uses 
        DJI drones, which are some of the absolute best drones in the market (I'm not being paid to say that by the way, I honestly admire the engineers 
        behind DJI and what they've accomplished.) Furthermore, DJI drones are really easy to fly, so they can even be used as a standalone tool. I point 
        that out since not only will they work with my software, but they can also be used as a non-autonomous tool for all sorts of applications, such as 
        mapping, search and rescue, etc. Drones are incredible tools, and one of the biggest benefits to the new approach is that you don't have an expensive 
        custom-built drone that's mostly useless for other applications. Consider the DJI drone an investment, if you will.
      </p>
      <br />
      <p class='ms-2 me-2' style='font-size: 42px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        What's happening to the original hardware/system setup?
      </p>
      <p class='ms-2 me-2' style='font-size: 18px !important; font-weight: 100 !important;'>
        The original individualized classification system with an entire fleet of drones as opposed to a single drone is still a good approach to 
        drone based security, it's just not what most people need, nor does it adhere particularly well to the accessibility piece of the project.
        What I've decided to do instead is to move the primary codebase to an Android (uses Kotlin, for interface app)/Python/C++ open source software 
        suite, and transition the old project setup to a semi-open-source project with greater focus on enterprise applications. The initial appeal in 
        the individualized approach was the inherent independence each agent (a drone) had from the others, making the system as a whole this more complete, 
        adaptive mesh-like thing that could focus on individual tasks while still maintaining the primary task of patrolling the area. However, this can be 
        achieved with the new version by just adding on more drones. The reality of it is that for most people/organizations that would need a budget-friendly 
        approach that could potentially rival employing several people, they probably wouldn't need everything the original setup is capable of. So, to summarize, 
        it isn't going away, but most updates to it will remain closed-source for possible subscription or license-based enterprise applications.
      </p>
      <br />
      <p class='ms-2 me-2' style='font-size: 42px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        Will this new version still be open source?
      </p>
      <p class='ms-2 me-2' style='font-size: 18px !important; font-weight: 100 !important;'>
        The open source nature of the project isn't going away any time soon, despite the transition to partial closed source with the original version. 
        The biggest difference is that since the software side of things is a bit more advanced now, there's a few repositories to look to for the source 
        code, and a bit more work is required to get everything going. I'll put a new tutorial up in the following weeks on setting up the project in its 
        current state, along with what you'll need, limitations, etc. You'll still be able to find the source code for the original version in the original 
        repository, though note that it will be significantly less up to date as I begin to explore the enterprise-focused options I previously mentioned.
      </p>
      <br />
      <br />
      <br />
    </div>
    <div class="imgContainer mb-0">
      <img src="../../../Images/Ocean2.jpeg" alt="Download bg image" style="width:100%;">
      <div class="imgCtTxtCntr">
        <a style='font-size: 52px !important; font-family: "Montserrat", sans-serif !important; font-weight: 400 !important; text-align: center;' href='../../../ventus-getting-started.php' target='_blank'>
          Get started with Ventus
        </a>
      </div>
    </div>
    <div style="font-family: 'Montserrat', sans-serif; font-weight: 300;" class='ms-0 mt-0 me-0 mb-0'>
    <?php
      $contactOT = "contactOverlay";
      $contactOS = 1;
      echo "
      <!-- Page Footer -->
      <div style='background-color: $ftBG'>
        <div style='background-color: $ftBG2; color: $ftC2; text-align: center'; class='mb-0'>
          <p style='font-size: 30px; $montserrat font-weight 200 !important;' class='mt-4 mb-3'>Contact:</p>
          <p style='font-size: 18px; $montserrat font-weight 200 !important;'>contact@djhbuchanan.com</p>
          <a style='$montserrat font-weight 200 !important;' onclick='contactOverlay($contactOT, $contactOS)'>Or, send a message</a>
          <hr />
        </div>
        <nav class='navbar navbar-expand-lg mt-0 mb-0' style='background-color: $ftBG; $montserrat font-weight 200 !important;'>
          <div class='container-fluid'>
            <a style='$montserrat font-weight 200 !important;' class='navbar-brand' href='../../../home.php'>
              <!-- Logo icon: <img src='/path/logo.svg' alt='' width='30' height='24'> -->
              <p style='color: $ftC; $montserrat font-weight 200 !important;' class='ms-2 mt-1'>Logo</p>
            <a>
            <div class='navbar-nav'>
              <a class='nav-link' style='color: $ftC; $montserrat font-weight 200 !important;' href='../../../Extras/terms-of-service.php'>Terms of Service</a>
              <a class='nav-link' style='color: $ftC; $montserrat font-weight 200 !important;' href='../../../Extras/privacy-notice.php'>Privacy Notice</a>
              <a class='nav-link' style='color: $ftC; $montserrat font-weight 200 !important;' href='../../../Extras/accessibility.php'>Accessibility</a>
              <a class='nav-link' style='color: $ftC; $montserrat font-weight 200 !important;' href='../../../Extras/site-map.php'>Site Map</a>
              <a class='nav-link' style='color: $ftC; $montserrat font-weight 200 !important;' href='https://github.com/$ghEXT' target='_blank'>GitHub</a>
              <a class='nav-link' style='color: $ftC; $montserrat font-weight 200 !important;' href='https://www.linkedin.com/in/$liEXT' target='_blank'>LinkedIn</a>
            </div>
          </div>
        </nav>
      </div>
      <div style='background-color: $ftBG;'>
        <!-- Bottom Spacer -->
        <br />
      </div>
      ";
    ?>
    </div>
  </body>
</html>

<?php
  // mysqli_close($link);
?>