Skip to content

Instantly share code, notes, and snippets.

View markhillard's full-sized avatar
🛩️
I'd rather be flying

Mark Hillard markhillard

🛩️
I'd rather be flying
View GitHub Profile
@markhillard
markhillard / js-powered-anti-spam-contact-form.markdown
Last active March 12, 2017 05:24
JS Powered Anti-Spam Contact Form

JS Powered Anti-Spam Contact Form

This is an anti-spam contact form that doesn't require any server-side scripting languages or a CAPTCHA challenge-response test. It uses elements of a standard contact form along with an external JavaScript file and a mail form file powered by Misk.com.

It's also completely cross-browser compatible and degrades nicely if a user does not have JavaScript enabled in their web browser.

A Pen by Mark Hillard on CodePen.

License.

@markhillard
markhillard / pass-query-string-parameter-s.markdown
Last active March 12, 2017 05:25
Pass Query String Parameter(s)

Pass Query String Parameter(s)

This donation button toggles between 2 view states via CSS and the slide-down effect is powered by some simple jQuery.

The second function appends the "amount" query string parameter and the value of your selected radio button to the end of the destination page URL upon a "faux" form submission.

This can be customized for all types of input fields.

A Pen by Mark Hillard on CodePen.

@markhillard
markhillard / get-query-string-parameter-s.markdown
Created March 12, 2017 05:23
Get Query String Parameter(s)

Get Query String Parameter(s)

This is the destination page that's loaded after the "faux" form submission on the landing page.

The first function parses the value of your previously selected radio button from the "amount" query string parameter in the page URL.

The second function populates the associated radio button based on the query string parameter/value from the page URL.

A Pen by Mark Hillard on CodePen.

@markhillard
markhillard / ajax-form-submission-using-jquery.markdown
Created March 12, 2017 05:24
AJAX Form Submission Using jQuery

AJAX Form Submission Using jQuery

This is a simple contact form with built-in email validation, input field behaviors and an AJAX submission handler. The page will not refresh when the form is submitted, which allows for custom UI functions. In this example, the data will be posted in the background to a mail form file.

Use the console in your browser's developer tools to see the form in action.

A Pen by Mark Hillard on CodePen.

License.

Chalkboard

This is a lightly styled textarea that remembers what you type even if you reload the page or close your browser. Behold the power of HTML5 Local Storage!

A Pen by Mark Hillard on CodePen.

License.

@markhillard
markhillard / custom-checkboxes-radio-buttons.markdown
Created March 12, 2017 05:26
Custom Checkboxes & Radio Buttons

Custom Checkboxes & Radio Buttons

Here's some fancy (CSS only) checkboxes and radio buttons that have a consistent look and feel across all modern web browsers.

A Pen by Mark Hillard on CodePen.

License.

@markhillard
markhillard / inject-scripts-on-the-fly.markdown
Created March 12, 2017 05:27
Inject Scripts On The Fly

Inject Scripts On The Fly

This little jammy utilizes the "jQuery.getScript()" shorthand AJAX method. You can use this to inject scripts (".js" files) directly into the DOM. It features URL validation and custom UI functions based on the status of the file you're trying to load.

Use the console in your browser's developer tools to see the form in action.

A Pen by Mark Hillard on CodePen.

License.

@markhillard
markhillard / smooth-scrolling-with-velocity-js.markdown
Last active March 12, 2017 05:28
Smooth Scrolling with Velocity.js

Smooth Scrolling with Velocity.js

Here's a smooth as butter page scrolling effect thanks to jQuery and the Velocity.js animation engine.

A Pen by Mark Hillard on CodePen.

License.

Angular.js Progress Bars

It's amazing what you can do with some simple math inside Angular.js expressions. Here are some dynamically populated progress bars that are meant to show how a particular group of giving opportunities are doing.

A Pen by Mark Hillard on CodePen.

License.

@markhillard
markhillard / animated-multi-level-mobile-navigation-menu.markdown
Last active May 31, 2017 20:42
Animated Multi-Level Mobile Navigation Menu

Animated Multi-Level Mobile Navigation Menu

Who needs a bloated plugin when you can DIY? This is a lightweight navigation menu designed for mobile devices. If you decide to use this, my only recommendation would be to increase the transition timings for longer lists so the slide animations are still obvious.

A Pen by Mark Hillard on CodePen.

License.