diff --git a/validation/composer.json b/validation/composer.json new file mode 100644 index 0000000..084c369 --- /dev/null +++ b/validation/composer.json @@ -0,0 +1,10 @@ +{ + "name": "violet/validation", + "type": "project", + "autoload": { + "psr-4": { + "Violet\\Validation\\": "src/" + } + }, + "require": {} +} diff --git a/validation/css/.gitkeep b/validation/css/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/validation/css/styles.css b/validation/css/styles.css new file mode 100644 index 0000000..5b5bb35 --- /dev/null +++ b/validation/css/styles.css @@ -0,0 +1,109 @@ +* { + margin: 0; + padding: 0; +} + +body { + /* Positioning */ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + /* Styling */ + background-color: #bbedbe; +} + +h1 { + /* Positioning */ + width: 80%; + padding: 2vw; + + /* Font */ + font-size: 8vw; + text-align: center; +} + +h3 { + font-size: 4vw; +} + +h1, +h3, +p, +input { + color: #0e3610; +} + +form { + width: 60%; + padding: 2.5vw 5vw 2.5vw 5vw; + + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.row { + width: 100%; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +input { + /* Input Shape */ + width: 50%; + padding: 1vw; + margin: 1vw; + border: none; + border-radius: 18px; + + /* Styling */ + background-color: #f1fbf2; + + /* Font */ + font-size: 1vw; + font-weight: 400; +} + +button { + /* Button Shape */ + width: 40%; + padding: 1vw; + margin: 1vw; + border: none; + border-radius: 18px; + + /* Font */ + color: white; + font-size: 1vw; + font-weight: 600; + + /* Transition for hover */ + transition-duration: 500ms; + + background-color: #1c6b20; +} + +.card { + padding: 2vw; + background-color: gray; + border-radius: 18px; +} + +.error { + color: white; + background-color: red; +} + +.success { + color: white; + background-color: #0e3610; +} + +.reset { + background-color: red; +} diff --git a/validation/img/.gitkeep b/validation/img/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/validation/img/success.jpg b/validation/img/success.jpg new file mode 100644 index 0000000..bb20880 Binary files /dev/null and b/validation/img/success.jpg differ diff --git a/validation/index.php b/validation/index.php new file mode 100644 index 0000000..e7dd51c --- /dev/null +++ b/validation/index.php @@ -0,0 +1,40 @@ + + + + + +
+You entered: ' . $error . '
+Phone number must be formatted as (xxx)xxx-xxxx.
+ + '; +} +?> + + + diff --git a/validation/js/.gitkeep b/validation/js/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/validation/js/index.js b/validation/js/index.js new file mode 100644 index 0000000..e69de29 diff --git a/validation/process.php b/validation/process.php new file mode 100644 index 0000000..c1c548f --- /dev/null +++ b/validation/process.php @@ -0,0 +1,37 @@ + + + + +You entered: ' . $number . ', a valid phone number.
+
+
+';
+ } else {
+ header('Location: .?error=' . $number);
+ }
+}
+?>