NatureFit - CPA Marketing Landing Page

Complete documentation · Version 1.0.0 · HTML5 / CSS3 / Vanilla JavaScript

No dependencies Single-file build available Mobile responsive CPA / affiliate ready Beginner friendly

1Introduction

NatureFit is a conversion-focused landing page template for a natural weight-loss / health supplement offer. You can use it as a normal product landing page, or as a bridge page for a CPA / affiliate offer.

What makes it different from a plain HTML template:

Tip: read sections 4 and 6 first. They cover 90 % of what buyers normally need: open the file, then connect the offer.

2Requirements

ItemRequirement
Server sideNone. Any static hosting works (shared hosting, Netlify, Vercel, Cloudflare Pages, GitHub Pages, S3, a plain folder).
PHP / databaseNot required.
BrowserChrome, Edge, Firefox, Safari, Opera - current and previous major versions. Also works on iOS Safari and Android Chrome.
InternetOnly needed for the Google Fonts (Poppins, Open Sans) and for images if you use template.html with the separate images/ folder.
EditorAny text editor (VS Code, Sublime, Notepad++, even Notepad).
OptionalPython 3 + Pillow - only if you want to rebuild the single-file version with build.py.
No coding needed for basic use. All the settings you will normally touch are in one clearly commented block at the top of the JavaScript.

3File structure

NatureFit/
├── index.html          <- MAIN FILE. Self-contained page, images embedded.
├── template.html       <- Same page, but loads images from /images folder.
├── images/             <- All 7 JPG images used by template.html
│   ├── hero-bg.jpg
│   ├── bottle.jpg
│   ├── model.jpg
│   ├── food.jpg
│   ├── avatar1.jpg
│   ├── avatar2.jpg
│   └── avatar3.jpg
├── build.py            <- Optional: rebuild index.html after changing images
├── documentation.html  <- This file
├── licences.txt        <- License terms (Regular / Extended)
├── changelog.txt       <- Version history
└── README.txt          <- One-page quick start

Which file should I edit?

Your situationUse
Just changing texts, links, prices, coloursindex.html (or template.html + rebuild)
Replacing imagesimages/ + run build.py, or replace the base64 strings in index.html
Uploading to a host where you prefer separate filestemplate.html renamed to index.html, uploaded together with images/
Important: index.html and template.html contain the same content. If you edit one, remember that the other one is not updated. Pick one as your working file and stick to it.

4Installation / quick start

Option A - open it locally (30 seconds)

  1. Unzip the package anywhere on your computer.
  2. Double-click index.html. It opens in your browser with all images.
  3. Edit the file in your text editor, save, refresh the browser.

Option B - upload to your hosting

  1. Log in to your hosting control panel (cPanel, Plesk, etc.) or your Netlify / Vercel dashboard.
  2. Open the public_html folder (or the site root).
  3. Upload index.html - that is all you need for the single-file version.
  4. Visit your domain. Done.

Option C - use template.html with the separate images folder

  1. Rename template.html to index.html.
  2. Upload that file and the whole images/ folder, keeping the folder name exactly images (lowercase).
  3. The page now loads the images from images/ instead of the embedded copies.
Why two versions? The single-file build is the easiest to deploy and impossible to break with a missing image. The template build is easier if you want to swap images often without touching base64 code.

5The CONFIG block (main settings)

Open index.html and search for GLOBAL CONFIGURATION (Ctrl+F). Everything below lives in that single object:

const CONFIG = {
  affiliateUrl : '',          // your CPA / offer URL
  buyMode      : 'modal',     // 'modal' | 'direct' | 'after-form'
  subIdParam   : 's1',        // tracking parameter name
  trackSubIds  : true,        // append ?s1=pkg3-hero
  openInNewTab : true,        // open the offer in a new tab
  countdownMs  : 86399000,    // offer timer length (23h 59m 59s)
  countdownKey : 'naturefit_offer_deadline',
  toastsEnabled: true,        // "someone just ordered" pop-ups
  toastDelay   : 16000,       // ms between pop-ups
  version      : '1.0.0'
};
SettingWhat it does
affiliateUrlYour offer link. Empty '' keeps the built-in demo checkout.
buyMode'modal' = demo checkout opens; 'direct' = the visitor goes straight to the offer; 'after-form' = demo checkout first, then redirect.
subIdParamName of the tracking parameter your network uses: s1, sub1, aff_sub, clickid, etc.
trackSubIdsWhen on, every button sends its own sub-ID (e.g. pkg3-hero) so you can see which button converts.
openInNewTabtrue keeps your landing page open in the original tab.
countdownMsHow long the offer countdown runs. Default 86,399,000 ms = 23:59:59.
countdownKeyThe localStorage key that remembers the deadline per visitor. Change it if you want every visitor to get a fresh timer.
toastsEnabled / toastDelayTurns the social-proof notifications on/off and sets the interval.

6Connecting a CPA / affiliate offer

This is the most common use case, so it is deliberately a one-line change. Paste your offer URL into affiliateUrl and choose a buyMode.

Mode 1 - "direct" (recommended for most CPA offers)

The visitor clicks any Buy Now button and lands directly on your offer page in a new tab.

const CONFIG = {
  affiliateUrl : 'https://your-network.com/click?offer=123&aff=456',
  buyMode      : 'direct',
  subIdParam   : 's1',
  trackSubIds  : true,
  openInNewTab : true,
  /* ...rest unchanged... */
};

Result for a click on the pricing card of the 3-bottle package:

https://your-network.com/click?offer=123&aff=456&s1=pkg3-offer

Mode 2 - "after-form" (collect the lead first)

The demo checkout opens, the visitor fills in name / email / phone, and after the success message appears they are forwarded to the offer after 1.5 seconds.

buyMode : 'after-form',
Note: in this mode the form data stays in the browser - it is not sent anywhere, and this template ships without a backend. If you need the lead captured, point the form at your own endpoint first (see "Collecting the form data" below).

Mode 3 - "modal" (default, no affiliate link)

Keeps the built-in demo checkout. Use it to present the design to a client, or when you want to plug in your own checkout / payment link later.

Collecting the form data

If you want the checkout form to send leads somewhere (your CRM, Zapier, Make, a Google Sheet, or your own PHP script), find the submit handler and replace the demo success block with your own call:

orderForm.addEventListener('submit', (e) => {
  e.preventDefault();
  /* ...validation stays as it is... */

  // ---- send the data ----
  fetch('https://your-endpoint.com/lead', {
    method : 'POST',
    headers: { 'Content-Type': 'application/json' },
    body   : JSON.stringify({
      name  : $('#fName').value,
      email : $('#fEmail').value,
      phone : $('#fPhone').value,
      zip   : $('#fZip').value,
      addr  : $('#fAddr').value,
      pkg   : selectedPkg
    })
  });

  orderForm.classList.add('hide');
  successState.classList.add('show');
});

Sub-ID map (default button positions)

ButtonGenerated sub-ID
Header "Buy Now"pkg3-header
Hero "Buy Now - from $39"pkg3-home
About / offer box buttonpkg3-about
Benefits section buttonpkg3-benefits
Pricing cards (1 / 3 / 6 bottles)pkg1-offer, pkg3-offer, pkg6-offer
Final CTApkg6-cta
Sticky bottom barpkg3-* (uses the selected package)
Checkout form (after-form mode)pkg*-checkout

You can override any of them by adding data-position="my-label" to the button:

<button class="btn" data-buy data-package="3" data-position="facebook-ad">Buy Now</button>
Pro tip: duplicate the page once per traffic source (e.g. fb.html, tt.html, native.html) and give each copy a different data-position. Your network statistics will then show exactly which traffic source converts.

7Changing the brand name and logo

Brand name

Use find & replace (Ctrl+H) to replace NatureFit and naturefit with your own brand. Occurrences:

Logo

The logo is text based, so there is nothing to upload:

<a class="logo" href="#home">
  <span class="logo-mark"><svg ...></svg></span>
  <span class="logo-text">nature<b>FIT</b></span>
</a>

Edit logo-text to your brand, or drop an image inside the logo-mark span:

<span class="logo-mark"><img src="images/my-logo.svg" alt="My Brand" style="width:100%"></span>

Favicon

The page uses an inline SVG emoji favicon. To use your own, add this line inside <head>:

<link rel="icon" href="images/favicon.png" sizes="32x32">

8Changing the images

There are two routes. Pick the one that matches the file you are editing.

Route A - you work with template.html (simple)

  1. Replace the files inside images/, keeping the same file names (hero-bg.jpg, bottle.jpg, model.jpg, food.jpg, avatar1.jpg, avatar2.jpg, avatar3.jpg).
  2. Refresh the page. Done - no code editing at all.

Route B - you work with index.html (single file)

index.html has the images embedded as base64 data URIs, so the page works even without the images/ folder. To change them, either

Using build.py (needs Python 3 and Pillow: pip install pillow):

cd NatureFit
python3 build.py

The script takes everything in images/, resizes and compresses it, embeds it into template.html and writes a fresh index.html. It prints the size of every image and the final file size.

Not using build.py? Replace the long data:image/jpeg;base64,... string in the src attribute with a normal path:

<img src="images/bottle.jpg" alt="NatureFit bottle">

Recommended image sizes

ImageUsed forRecommended size
hero-bg.jpgHero + final CTA background1600 × 900 px, under 250 KB
bottle.jpgProduct shot (hero, sticky bar)900 × 600 px, under 120 KB
model.jpg"What is NatureFit" section640 × 960 px (portrait), under 120 KB
food.jpg"Burn fat & stay healthy" section860 × 600 px, under 150 KB
avatar1-3.jpgTestimonial authors320 × 320 px (square), under 30 KB each
Keep the page fast: the total weight of all images should stay under roughly 700 KB. Compress with squoosh.app or TinyPNG before uploading.

9Changing the texts

All copy is normal HTML. Open the file, press Ctrl+F and search for the sentence you want to change.

What you want to changeSearch for
Hero headlineNatural / weight loss (inside an <h1>)
Hero subtitle + bullet pointsBurn stubborn fat
Top urgency bar textLIMITED TIME
Trust strip (4 icons under the hero)100% Natural
"What is NatureFit" sectionWhat is
Feature blocks (dark green section)Burn fat / feature-card
How it works stepsstep-card
Animated statisticsdata-counter
Pricing cardsclass="price-card"
Testimonialsclass="slide"
Guarantee band60-Day
FAQ questions and answersclass="faq-item"
Footer disclaimerdisclaimer
Social-proof toast names / citiesconst purchases

Example - changing one FAQ item

<div class="faq-item">
  <button class="faq-q">How fast will I see results?</button>
  <div class="faq-a"><p>Most customers notice a difference within 2-4 weeks...</p></div>
</div>

Add or remove faq-item blocks freely - the accordion re-binds automatically.

Adding a testimonial slide

Copy one .slide block inside the slider and change the text, the name and the avatar. The dots and arrows are generated from the number of slides.

10Changing prices and packages

Prices live in two places and must match: the HTML (pricing cards) and the JavaScript (checkout summary).

A) HTML - the pricing cards

<div class="price-card">
  <div class="pc-name">STARTER</div>
  <div class="pc-sub">1 Bottle - 30 Day Supply</div>
  <div class="pc-price">$49</div>
  <div class="pc-old">$98</div>
  <div class="pc-save">SAVE $49 (50% OFF)</div>
  <button class="btn btn-dark btn-block" data-buy data-package="1">Buy Now</button>
</div>

B) JavaScript - the PACKAGES object

const PACKAGES = {
  '1': { name: '1 Bottle',  price: 49,  disc: 49  },
  '3': { name: '3 Bottles', price: 119, disc: 175 },
  '6': { name: '6 Bottles', price: 179, disc: 409 }
};

price is what the customer pays, disc is the amount shown as "-$175" in the checkout summary. Keep the data-package attribute on the button in sync with the key in this object.

Adding a fourth package? Add a new key (e.g. '12') to PACKAGES, copy a .price-card, change its data-package="12", and add a matching option in the checkout modal: <label class="pkg-opt" data-pkg="12">...</label>.

11Section-by-section reference

#SectionAnchorPurpose
1Urgency bar-Discount + live countdown, always on top
2Header / nav#siteHeaderLogo, menu, cart counter, Buy Now; becomes sticky on scroll
3Hero#homeHeadline, product image, countdown, rating, main CTA
4Trust strip-Four trust icons (natural, shipping, guarantee, secure)
5What is it#aboutExplanation + offer box with price and CTA
6Features#benefitsDark green block with 4 feature cards
7How it works#how3 step cards
8Statistics#statsAnimated counters
9Pricing#offer3 packages with Buy Now buttons
10Testimonials#reviewsSlider with arrows, dots and autoplay
11Guarantee-60-day money-back band
12FAQ#faqAccordion
13Final CTA#ctaClosing call to action over the hero image
14Footer-Links, e-mail, disclaimer, copyright
15Sticky buy bar#stickyBarAppears on scroll, keeps the offer one click away
16Checkout modal#orderModalPackage selection + form + success state
17Toasts#toastSocial-proof notifications

To remove a section, delete it from the opening tag to the matching closing tag, and remove its link from the navigation menu.

12Colours and fonts

All colours are CSS variables at the top of the <style> block:

:root{
  --lime        : #8cc63f;   /* primary accent / buttons */
  --green-deep  : #37804f;   /* headings, dark accents   */
  --green-head  : #79b82e;   /* gradient headlines       */
  --dark        : #16281d;   /* dark section background  */
  --ink         : #25342b;   /* body text                */
}

Change one value and the whole page follows. Fonts are set here:

--font-head: 'Poppins', system-ui, sans-serif;
--font-body: 'Open Sans', system-ui, sans-serif;

To swap the fonts, replace the Google Fonts link in <head> and update these two variables.

Suggested palettes

Ocean / tech
--lime:#22b8cf; --green-deep:#1864ab; --dark:#0b2545

Warm / beauty
--lime:#e5989b; --green-deep:#b56576; --dark:#3d2c2e

13Deploying the page

Shared hosting / cPanel

  1. Open File Manager → public_html.
  2. Upload index.html (and images/ if you use template.html).
  3. Open your domain in a browser.

Netlify (free, drag & drop)

  1. Go to app.netlify.com/drop.
  2. Drag the whole NatureFit folder onto the page.
  3. You get a live URL in seconds; add your domain under Domain settings.

Vercel / Cloudflare Pages / GitHub Pages

Same idea: the project is a static site, so no build command is needed. Build command: empty. Output directory: the folder containing index.html.

WordPress

Upload index.html through FTP to your host and open it directly, or paste the markup into a full-width page template. For CPA traffic a plain static page is faster and safer than going through WordPress.

Speed matters for paid traffic. The single-file build avoids extra requests, which usually means a better landing-page-experience score and a lower cost per click.

14Going-live checklist

  1. Replace the demo brand (NatureFit) and logo with your own.
  2. Replace all demo testimonials, names, avatars and statistics with real, substantiated ones - or remove them.
  3. Check every price, discount and "old price" figure.
  4. Turn off or personalise the social-proof toasts (toastsEnabled) if you cannot prove them.
  5. Paste your CPA offer URL and test all buttons in a private window.
  6. Add your own disclaimer and, where required, an affiliate disclosure.
  7. Test on a real phone (iOS + Android) and on a slow connection.
  8. Add analytics and your ad platform pixel in <head>.
  9. Check the page against your CPA network's and ad platform's policy.
  10. Set up a favicon, page title and meta description.
  11. Keep a backup of the working version before you publish.
Health claims: weight-loss and supplement offers are heavily regulated. Claims must be truthful and substantiated, and some platforms restrict them entirely. You are responsible for the copy you publish and for the offer you promote.

15Troubleshooting

ProblemCause / fix
Images do not show in template.htmlThe images folder is missing, renamed or in the wrong place. It must sit next to the HTML file and keep the lowercase name.
Buy Now opens nothingaffiliateUrl is empty and buyMode is set to 'direct' or 'after-form'. Use 'modal' or fill in the URL.
Popup blocked in the browserBrowsers block window.open when it is not triggered by a direct click. Keep the default click handler, and test without an ad blocker.
Countdown restarts every visitThe browser blocks localStorage (private mode, strict cookie settings). This is expected; the timer simply restarts.
Fonts look differentGoogle Fonts did not load (offline or blocked). The page falls back to system fonts; self-host Poppins/Open Sans if the network is restricted.
Page looks broken after editingA tag was most likely deleted. Restore the original file from a backup and re-apply your change.
Checkout form does not submitAll five fields are required and the e-mail must be valid; invalid fields show a red border.
index.html is very largeIt contains the embedded images (about 1 MB). That is normal. Use template.html + images/ if you prefer a small HTML file.

16Support, updates and license

Support

For installation questions or bugs in the unmodified code, use the support / contact tab on the item page and include your item version, browser and a screenshot or console error. Customisation and third-party services are outside the support scope. Please allow up to two business days for a reply.

Updates

Bug fixes and small improvements are published as new versions and are free for existing buyers through the download button on the item page. See changelog.txt.

License

This item is sold under the Codester Regular or Extended License. Full terms, the list of included assets and the demo-content disclaimer are in licences.txt. Short version: use it in one project (Regular) or unlimited projects (Extended), modify it as much as you like, never resell or redistribute the template itself.

Credits