Troubleshooting

Solutions to the most common issues encountered when setting up, developing, and deploying Hayler.

Setup and preview

Page stuck / Preloader not completing

The preloader animates on load and then calls window.onPreloaderComplete() to hand off to the rest of the framework. If it never completes, the page stays frozen.

Check the browser console first. Open DevTools (F12 or Cmd+Option+I) and look for errors in the Console tab. A single JavaScript error — a missing file, a typo in a script path — can stop everything.

Common causes:

  • A script file is missing or has a wrong path. Check that lib/gsap.js, lib/lenis.js, lib/three.js, js/preloader.js, js/slider.js, js/common.js, and js/scripts.js all load without 404 errors. In the Network tab, filter by JS and look for red entries.
  • Scripts are loading in the wrong order. The correct order is: GSAP → Lenis → Three.js → preloader.js → slider.js → common.js → scripts.js. Do not reorder them.
  • The page wrapper is missing or has the wrong ID. The main content must be wrapped in <div id="clapat-page-content">. If this ID is absent or misspelled, the framework cannot initialize.
  • The preloader HTML is malformed. If #clapat-preloader exists but its internal structure is broken, the animation never fires its completion callback. Compare your preloader markup against a working page.

To rule out the preloader itself, add disable-preloader to the <body> class. This skips the preloader entirely and calls onPreloaderComplete immediately:

HTML
<body class="hidden hidden-ball enable-lenis hayler disable-preloader">

If the page works with disable-preloader, the issue is in js/preloader.js or css/preloader.css.

Preview issues (file:// )

Opening HTML files directly in the browser via file:// breaks AJAX page transitions. The browser's same-origin policy blocks cross-file requests — every file is treated as a different origin, so AJAX fetches fail silently or throw CORS errors in the console.

The fix is always the same: run a local server. See Getting Started → Local server setup for step-by-step instructions with VS Code Live Server, PHP, and browser CORS workarounds.

Signs you're hitting this issue: navigation clicks do nothing, the URL doesn't change when clicking links, or you see Cross-Origin Request Blocked errors in the console.

Animations and scroll

Animations not triggering

Hayler uses GSAP ScrollTrigger to fire animations when elements enter the viewport. If animations don't trigger, work through these checks:

  • GSAP is not loaded. Check the Network tab for a failed request to lib/gsap.js. Without GSAP, nothing animates.
  • Script order is wrong. GSAP must load before common.js and scripts.js. If GSAP loads after the framework scripts, ScrollTrigger is undefined when the framework tries to use it.
  • The required class is missing from the element. Text animations need has-animation or the specific animation class (e.g. has-blur, has-slide). Parallax elements need data-parallax. Check that you haven't removed these in editing.
  • The element is inside a hidden container. ScrollTrigger calculates positions on init. If an element is inside a display: none container at load time, its position will be wrong and the trigger will never fire. Call ScrollTrigger.refresh() after revealing the container.
  • ScrollTrigger markers. During development, add markers: true to ScrollTrigger instances in js/scripts.js to see exactly where triggers are set. Remove before going live.

Smooth scroll not working

Smooth scroll is powered by Lenis. It is enabled by the enable-lenis class on <body>. If scrolling feels native/jerky instead of smooth:

  • Check the body class. The enable-lenis class must be present on <body>. Without it, Lenis is not initialized.
  • Lenis failed to load. Check the Network tab for lib/lenis.js. A 404 on this file disables smooth scroll silently.
  • A CSS overflow is interfering. Lenis requires the page to scroll on <html> or <body>. If you've added overflow: hidden or overflow: scroll on a wrapper element, Lenis loses control of scroll.
  • Mobile devices. Lenis intentionally falls back to native scroll on touch devices for performance. This is expected behavior, not a bug.

Page transitions

Transition not working

If clicking a navigation link does a full page reload instead of an AJAX transition, check these in order:

  • The link is missing the ajax-link class. Every internal link that should use AJAX must have class="ajax-link" and data-type="page-transition". Without both, the link behaves as a normal HTML link.
  • The target page has a broken structure. AJAX fetches the target page and extracts #clapat-page-content. If that ID is missing or malformed in the target, the transition fails and falls back to a full reload. Open the target page directly and check its console for errors.
  • You're using file://. AJAX doesn't work without a local server. See file:// preview issues above.
  • The link points to an external URL. Never add ajax-link to external links. The AJAX system will try to fetch the external page and inject it — which fails due to CORS and breaks the transition entirely.

Page loads but animations don't run

After an AJAX transition, the new page loads but nothing animates. This means the page content loaded correctly but window.LoadViaAjax didn't run or ran with errors.

  • Check the console for errors on transition. An error in LoadViaAjax stops subsequent initializations. Fix the error and animations will run again.
  • A new component wasn't initialized in LoadViaAjax. If you added a custom component that runs in DOMContentLoaded but forgot to also call it inside window.LoadViaAjax in js/scripts.js, it will work on first load but not after AJAX navigation.
  • ScrollTrigger wasn't refreshed. After AJAX, ScrollTrigger needs to recalculate element positions. This is handled by PageReady() inside LoadViaAjax. If you removed that call, add it back.

Media

Videos not playing

HTML5 autoplay video has strict browser requirements. If background or thumbnail videos don't play:

  • Missing muted attribute. Browsers block autoplay on unmuted video. Add muted to the <video> element — this is the most common cause.
  • Missing playsinline attribute. On iOS, video plays fullscreen by default unless playsinline is present. Add it alongside muted and loop.
  • Wrong file format. Use MP4 with H.264 encoding. WebM is also supported but MP4 has broader coverage. Avoid older formats like AVI or MOV.
  • File is too large. A 100MB background video will stall on mobile connections. Keep background videos under 10MB. Re-encode at lower bitrate or resolution (720p is enough for backgrounds).
  • Wrong file path. Check the src attribute and verify the file exists at that path. Case matters on Linux servers — Video.mp4 and video.mp4 are different files.
  • Missing poster image. For playable videos with data-poster, the poster must exist at the specified path. A broken poster path can sometimes interfere with video initialization.

Images not loading

  • Wrong path. All image paths in Hayler are relative to the HTML file's location. src="images/photo.jpg" on a page in the root folder looks for images/photo.jpg next to the HTML file. If the HTML is in a subfolder, the path needs to go up: src="../images/photo.jpg".
  • Filename case mismatch. Photo.jpg and photo.jpg are different files on Linux servers. Your local Mac or Windows machine may work fine, but the live server fails. Always use lowercase filenames.
  • Spaces in filenames. my photo.jpg will break in URLs. Rename to my-photo.jpg.
  • File wasn't uploaded. Check your FTP or hosting panel to confirm the file actually exists on the server. Forgetting to upload the images/ folder is the most common deployment error.

Fonts and styles

Fonts not loading

If text falls back to a system font (typically Arial or serif), the font files aren't loading:

  • The webfonts/ folder wasn't uploaded. This is the most common cause after deployment. The entire webfonts/ folder must be present on the server alongside style.css.
  • Wrong @font-face path. The @font-face declarations in style.css reference webfonts/FontName.woff2 — relative to style.css's location in the root. If you moved style.css, the paths break.
  • Font family name mismatch. The font-family value in @font-face must exactly match what's used in CSS variables. 'FunnelDisplayWeb' and 'Funnel Display' are different names. Check for typos.
  • Browser cache. After fixing a font path issue, do a hard reload (Ctrl+Shift+R or Cmd+Shift+R) to force the browser to re-fetch the files.

Styles broken after customization

  • You edited a core CSS file. Changes to style.css, content.css, showcase.css, portfolio.css, or shortcodes.css may conflict with the framework's internal logic. Move all custom styles to css/custom.css and restore the edited core file from the original archive.
  • A CSS variable has an invalid value. If you set a variable to a malformed value — a missing unit, an invalid color — it silently breaks every property that inherits from it. Open DevTools and inspect the computed styles to find the broken variable.
  • Specificity conflict. Your custom rule is being overridden by a more specific framework rule. Add the .hayler scope prefix or increase specificity: .hayler .your-element instead of just .your-element.
  • Deferred CSS not loading. Several CSS files use rel="preload" with an onload handler to load asynchronously. If JavaScript is blocked or errors out before these handlers fire, the stylesheets never apply. Check the console for JS errors that occur before the page fully loads.

Contact form

Form not sending

  • Static hosting. Netlify, Vercel, GitHub Pages, and similar platforms don't run PHP. The form requires a PHP-enabled server. Either migrate to shared hosting or replace contact.php with a third-party form service (Formspree, EmailJS, Netlify Forms).
  • PHP mail() is disabled. Some shared hosts disable the built-in mail() function for spam reasons. Contact your hosting provider to confirm it's enabled, or configure an SMTP service like SendGrid or Mailgun.
  • Wrong recipient address. Open contact.php and verify $address is set to a real, working email address.
  • Wrong verification answer. The form has a spam verification field — the expected answer is 4, set in contact.php on the line if ($verify !== '4'). If you changed the question in the HTML without updating this value, all submissions will fail validation.
  • Messages going to spam. Emails sent via mail() often lack proper authentication headers and get filtered. Check your spam folder first. For reliable delivery, configure SPF/DKIM on your domain or use an SMTP relay service.
  • Testing locally. The form cannot be tested via file:// or on a server without PHP. Deploy to a PHP-enabled server, submit a test message, then check both inbox and spam.

Deployment

Site broken after upload

Works locally but breaks on the live server — almost always a file or folder issue:

  • Missing folders. The most common culprit: images/, webfonts/, lib/, or js/ wasn't uploaded. FTP clients sometimes skip empty-looking folders or fail silently on large uploads. Verify all folders are present on the server using your hosting file manager.
  • Uploaded to the wrong directory. The project root must be directly inside public_html/ (or www/ depending on host) — not inside a subfolder unless you adjust all file paths. If your site shows a directory listing instead of the page, the files are in the wrong location.
  • File permissions. HTML, CSS, and JS files should be 644. Folders should be 755. PHP files including contact.php need at least 644. If you see 403 Forbidden errors, check permissions.
  • Filename case sensitivity. Linux servers are case-sensitive. A file named Hero.jpg referenced as hero.jpg in HTML will 404 on the server even though it worked on your Mac. Always use lowercase filenames.

Cache issues after deploy

You uploaded changes but the live site still shows the old version:

  • Browser cache. Do a hard reload on the live site: Ctrl+Shift+R on Windows/Linux, Cmd+Shift+R on macOS. Or open in a private/incognito window to bypass cache entirely.
  • CDN or hosting cache. If your host uses a CDN or caching layer (common on managed WordPress hosts or Cloudflare), purge the cache from your hosting control panel.
  • Partial upload. If you only uploaded some files and the CSS or JS changed, the browser may have a cached version of the old script paired with the new HTML. Upload all changed files together and hard-reload.

Pre-launch checklist

Run through this before making the site public.

  • Logo replaced — both images/logo.png and images/logo-white.png
  • Favicon replaced — favicon.ico in project root
  • Page titles updated on all 16 HTML files
  • Meta descriptions updated on all 16 HTML files
  • Canonical URLs updated to your live domain on all pages
  • Open Graph tags updated — title, description, image, URL
  • Open Graph image created at 1200×630px and uploaded
  • Google Analytics Measurement ID replaced on all pages
  • Navigation links updated — labels and hrefs match your site structure
  • Active class set correctly on each page's navigation
  • Footer credentials updated — email, address, hours, copyright year
  • Footer social links updated — correct URLs and aria-labels
  • Contact form email updated in contact.php
  • Contact form tested — submitted a real message and received it
  • All demo images replaced with your own content
  • All demo videos replaced or removed
  • Project nav chain verified — last project links back to first
  • All pages tested in Chrome, Firefox, and Safari
  • Mobile layout tested on an actual device or browser DevTools
  • Browser console is clean — no errors or warnings on any page
  • All AJAX transitions tested — every nav link and project nav
  • Images optimized — no single image over 600KB
  • All internal links use ajax-link class and data-type="page-transition"
  • All external links use target="_blank" and rel="noopener" — no ajax-link class