/*
* Plugin: ageCheck.js
* Description: A simple plugin to verify user's age.
* Uses sessionStorage/localStorage API to store if user is verified.
* Options can be passed for easy customization.
* Author: Michael Soriano
* Author's website: http://michaelsoriano.com
*
*/
(function ($) {
$.ageCheck = function (options) {
const settings = $.extend({
minAge: 21,
redirectTo: '',
redirectOnFail: '',
title: 'Age Verification',
copy: 'This Website requires you to be [21] years or older to enter. Please enter your Date of Birth in the fields below in order to continue:',
success: null,
successMsg: {
header: 'Success!',
body: 'You are now being redirected back to the application...'
},
underAgeMsg: 'Sorry, you are not old enough to view this site...',
underAge: null,
errorMsg: {
invalidDay: 'Day is invalid or empty',
invalidYear: 'Year is invalid or empty'
},
storage: 'sessionStorage',
storageExpires: null,
}, options);
var storage = window[settings.storage];
const _this = {
month: '',
day: '',
year: '',
age: '',
errors: [],
setValues() {
const month = $('.ac-container .month').val();
const day = $('.ac-container .day').val();
_this.month = month;
_this.day = day.replace(/^0+/, ''); // remove leading zero
_this.year = $('.ac-container .year').val();
},
validate() {
_this.errors = [];
if (/^([0-9]|[12]\d|3[0-1])$/.test(_this.day) === false) {
_this.errors.push(settings.errorMsg.invalidDay);
}
if (/^(19|20)\d{2}$/.test(_this.year) === false) {
_this.errors.push(settings.errorMsg.invalidYear);
}
_this.clearErrors();
_this.displayErrors();
return _this.errors.length < 1;
},
clearErrors() {
$('.errors').html('');
},
displayErrors() {
let html = '
';
for (let i = 0; i < _this.errors.length; i++) {
html += `
PM Studios is pioneering a transformation in the way people play videogames. We are building deeper relationships with our players by keeping games fresh with new content and engaging live services. This has fundamentally changed our business model, moving from a dependency on game launches to generating stable revenue year around driven by live services. Diversification across geographies, game platforms, game genres and player demographics further adds to the stability of the model.
PM Studios is pioneering a transformation in the way people play videogames. We are building deeper relationships with our players by keeping games fresh with new content and engaging live services. This has fundamentally changed our business model, moving from a dependency on game
PM Studios is pioneering a transformation in the way people play videogames. We are building deeper relationships with our players by keeping games fresh with new content and engaging live services. This has fundamentally changed our business model, moving from a dependency on game launches to generating stable revenue year around driven by live services. Diversification across geographies, game platforms, game genres and player demographics further adds to the stability of the model.
PM Studios is pioneering a transformation in the way people play videogames. We are building deeper relationships with our players by keeping games fresh with new content and engaging live services. This has fundamentally changed our business model, moving from a dependency on game
Skopje '83
Explore a city thrust into disarray by an unknown event and survive the hordes of mutated abominations that lurk at every corner. You’ll have to fight through enemies & bosses, scavenge loot and survive the hostile city.