Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Kowndinya2000 committed Feb 8, 2022
0 parents commit 14918ca
Show file tree
Hide file tree
Showing 25 changed files with 7,708 additions and 0 deletions.
1,092 changes: 1,092 additions & 0 deletions 1_1_1_NonTextContent(A).js

Large diffs are not rendered by default.

325 changes: 325 additions & 0 deletions 1_3_1_InfoAndRelationships(A).js

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions 1_3_5_Identify_Input_Purpose(AA).js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
setTimeout(() => {
IdentifyInputPurpose()
}, 600);

function IdentifyInputPurpose() {
$.fn.log = function () {
console.log.apply(console, this);
return this;
};
var inputTags = document.querySelectorAll('input')
for (var a = 0; a < inputTags.length; a++) {
if (inputTags[a].type != "hidden") {
if (inputTags[a].autocomplete == undefined || inputTags[a].autocomplete == "") {
console.log("%cRule:%cWCAG 1.3.5 (2.1,AA)",
`color: #FFF;
background-color: #333;
border-radius: 5px 0px 0px 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`,
`color: #FFF;
display: inline;
font-size: 0.8rem;
background-color: #809FFF;
border-radius: 0px 5px 5px 0px;
padding: 5px 10px;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
console.log("%cError:%cAutoComplete is missing in input tag",
`color: #FFF;
background-color: #333;
border-radius: 5px 0px 0px 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`,
`color: #FFF;
display: inline;
font-size: 0.8rem;
background-color: #F6976E;
border-radius: 0px 5px 5px 0px;
padding: 5px 10px;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
console.log("%cCode Snippet:",
`color: #FFF;
background-color: #333;
border-radius: 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
$(inputTags[a]).log()
console.log("%cFix:%cAdd autocomplete='INPUT PURPOSE'",
`color: #FFF;
background-color: #333;
border-radius: 5px 0px 0px 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`,
`color: #FFF;
display: inline;
font-size: 0.8rem;
background-color: #007075;
border-radius: 0px 5px 5px 0px;
padding: 5px 10px;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
console.log("%c-----------------------------------------------------------------------------",
`color: #FFF;
background-color: #293543;
font-weight: bolder;
border-radius: 5px;
padding: 5px 10px;
font-size: 1rem;
display: inline;`)
}
}

}
}
86 changes: 86 additions & 0 deletions 1_3_6_Identify_Purpose(AAA).js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
setTimeout(() => {
IdentifyPurpose()
}, 600);

function IdentifyPurpose() {
$.fn.log = function () {
console.log.apply(console, this);
return this;
};
$(document).ready(function () {
$('*').each(function () {
if ($(this).prop("nodeName") == "SECTION" ||
$(this).prop("nodeName") == "FORM" ||
$(this).prop("nodeName") == "NAV" ||
$(this).prop("nodeName") == "MAIN") {
var checkRoleAttr = $(this).attr('role');
if (checkRoleAttr == undefined || checkRoleAttr == false || checkRoleAttr == null) {
console.log("%cRule:%cWCAG 1.3.6 (2.1,AAA)",
`color: #FFF;
background-color: #333;
border-radius: 5px 0px 0px 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`,
`color: #FFF;
display: inline;
font-size: 0.8rem;
background-color: #809FFF;
border-radius: 0px 5px 5px 0px;
padding: 5px 10px;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
console.log("%cError:%cUsing ARIA landmarks to identify regions of a page is Missing.",
`color: #FFF;
background-color: #333;
border-radius: 5px 0px 0px 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`,
`color: #FFF;
display: inline;
font-size: 0.8rem;
background-color: #EB5177;
border-radius: 0px 5px 5px 0px;
padding: 5px 10px;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
console.log("%cCode Snippet:",
`color: #FFF;
background-color: #333;
border-radius: 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
$(this).log()
console.log("%cFix:%cAdd role='PURPOSE'",
`color: #FFF;
background-color: #333;
border-radius: 5px 0px 0px 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`,
`color: #FFF;
display: inline;
font-size: 0.8rem;
background-color: #007075;
border-radius: 0px 5px 5px 0px;
padding: 5px 10px;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
console.log("%c-----------------------------------------------------------------------------",
`color: #FFF;
background-color: #293543;
font-weight: bolder;
border-radius: 5px;
padding: 5px 10px;
font-size: 1rem;
display: inline;`)

}
}
})
})

}
98 changes: 98 additions & 0 deletions 1_4_1_UseOfColor(A).js
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
setTimeout(() => {
UseOfColor()
}, 1200);

function UseOfColor() {
// var checkIf = false
// if (document.body.style.color != null || document.body.style.color != "") {
// if (document.body.style.backgroundColor != null || document.body.style.backgroundColor != "") {
// checkIf = true
// }
// }
// if (!checkIf) {
// console.log("-----------------------------------------")
// console.log("Rule: WCAG 1.4.1 (2.0,A)")
// console.log("Error: Either color or background color of the body tag is empty/null")
// console.log("Code Snippet: ", document.body.outerHTML)
// console.log("Fix: Both the above attributes have to be either set or unset")
// }
$.fn.log = function () {
console.log.apply(console, this);
return this;
};
var imgTags = document.getElementsByTagName("img")
for (let index = 0; index < imgTags.length; index++) {
var warningT = false
if (parseInt(imgTags[index].naturalWidth) > 100 && parseInt(imgTags[index].naturalHeight) > 100) {
warningT = true
} else if (parseInt(imgTags[index].css("width").replace("px", "")) > 100 && parseInt(imgTags[index].css("height").replace("px", "")) > 100) {
warningT = true
}
if (warningT) {
console.log("%cRule:%cWCAG 1.4.1 (2.0,A)",
`color: #FFF;
background-color: #333;
border-radius: 5px 0px 0px 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`,
`color: #FFF;
display: inline;
font-size: 0.8rem;
background-color: #809FFF;
border-radius: 0px 5px 5px 0px;
padding: 5px 10px;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
console.log("%cWarning:%cImage might be using color alone",
`color: #FFF;
background-color: #333;
border-radius: 5px 0px 0px 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`,
`color: #FFF;
display: inline;
font-size: 0.8rem;
background-color: #F6976E;
border-radius: 0px 5px 5px 0px;
padding: 5px 10px;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
console.log("%cCode Snippet:",
`color: #FFF;
background-color: #333;
border-radius: 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
$(imgTags[index]).log()
console.log("%cFix:%cSet the text relating to the image in a way that text refers to the image not by color alone",
`color: #FFF;
background-color: #333;
border-radius: 5px 0px 0px 5px;
padding: 5px 10px;
font-size: 0.8rem;
display: inline;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`,
`color: #FFF;
display: inline;
font-size: 0.8rem;
background-color: #007075;
border-radius: 0px 5px 5px 0px;
padding: 5px 10px;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);`)
console.log("%c-----------------------------------------------------------------------------",
`color: #FFF;
background-color: #293543;
font-weight: bolder;
border-radius: 5px;
padding: 5px 10px;
font-size: 1rem;
display: inline;`)
}


}
}
Loading

0 comments on commit 14918ca

Please sign in to comment.