Skip to content

Commit

Permalink
fix validation + style
Browse files Browse the repository at this point in the history
  • Loading branch information
imichall committed Mar 1, 2021
1 parent b9b4c1b commit 5b46034
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 38 deletions.
74 changes: 45 additions & 29 deletions assets/js/app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import jQuery from "jquery";
import slick from "slick-carousel";
import Validate from "jquery-validation";

window.$ = window.jQuery = jQuery;

$('.testimonials').slick({
$(".testimonials").slick({
slidesToShow: 3,
slidesToScroll: 1,
autoplay: true,
Expand All @@ -12,37 +13,52 @@ $('.testimonials').slick({
swipe: true,
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
infinite: true,
}
breakpoint: 1024,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
infinite: true,
},
},
{
breakpoint: 600,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
breakpoint: 600,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
},
},
{
breakpoint: 325,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
dots: true,
}
}
]
});
breakpoint: 325,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
dots: true,
},
},
],
});

$(function () {
$("#Navbar-Menu button").on("click", function () {
$(".Navigation_Link").toggleClass("isOpen");
});

$(function() {
$("#Navbar-Menu button").on('click', function() {
$('.Navigation_Link').toggleClass('isOpen');
$(function () {
$("form[name='newsletter']").validate({
rules: {
email: "required",
email: {
required: true,
email: true,
},
},
messages: {
email: "Please enter a valid email address",
},
submitHandler: function (form) {
form.submit();
},
});
});
/* $('#Navbar-Menu button').on('click', function(){
$(this).toggleClass('isOpen');
}); */
});
});
17 changes: 17 additions & 0 deletions assets/less/components/Form.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.Form {
position: relative;
display: flex;

input[type="email"] {
Expand All @@ -12,6 +13,15 @@
&:focus {
outline: none;
}

}

label.error {
@typography-style-input-error();

position: absolute;
left: 5px;
bottom: -20px;
}

input[type="button"] {
Expand All @@ -34,6 +44,13 @@

&:invalid:not(:focus):not(:placeholder-shown) {
background: pink;
& + label {
opacity: 1;
}
}

&:focus:placeholder-shown {
background: @ui-colors-primary[white];
& + label {
opacity: 0;
}
Expand Down
7 changes: 7 additions & 0 deletions assets/less/settings/typography-styles-base.less
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,11 @@
font-weight: @typography-font-weight-values[bold];
font-size: @typography-scale[m2];
color: @ui-colors-primary[white];
}

@typography-style-input-error: {
font-family: @typography-font-family-base;
font-weight: @typography-font-weight-values[regular];
font-size: @typography-scale[m2];
color: @ui-colors-primary[brighRed];
}
4 changes: 0 additions & 4 deletions assets/less/settings/typography-styles-shared.less
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,4 @@

.typography-perex {
@typography-style-perex();
}

.typography-copy {

}
2 changes: 1 addition & 1 deletion build/css/main.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/js/scripts.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ <h4 class="typography-h2-white u-sm-mr--7">Simplify how your team works today.</
</ul>
</div>
<div class="FooterLayout_Form">
<form class="Form">
<form class="Form" name="newsletter">
<input type="email" name="email" placeholder="Updates in your inbox…" required>
<input type="button" value="Go">
</form>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@
"gulp-concat": "^2.6.1",
"gulp-cssmin": "^0.2.0",
"gulp-jsvalidate": "^4.0.0",
"gulp-less": "^4.0.1",
"gulp-notify": "^3.2.0",
"gulp-plumber": "^1.2.1",
"gulp-postcss": "^8.0.0",
"gulp-rename": "^1.4.0",
"gulp-rimraf": "^0.2.2",
"gulp-less": "^4.0.1",
"gulp-tinypng": "^1.0.2",
"gulp-uglify": "^3.0.2",
"jquery": "^3.5.1",
"jquery-validation": "^1.19.2",
"jquery-validation": "^1.19.3",
"node-sass": "^4.14.1",
"rollup": "^2.18.0",
"rollup-plugin-babel": "^4.4.0",
Expand Down

0 comments on commit 5b46034

Please sign in to comment.