Skip to content

Commit 40c5f83

Browse files
update readme
1 parent 608ba05 commit 40c5f83

File tree

3 files changed

+176
-19
lines changed

3 files changed

+176
-19
lines changed

README.md

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,51 @@
1-
## Requirements
1+
coderockr
2+
====================
23

3-
- Working personal computer
4-
- Node.js
4+
## Setup
5+
### Requirements
56

6-
## Getting Started
7+
Node `"V7.10.1"` (use nvm [here](https://github.com/creationix/nvm)
78

8-
You can also `git clone`.
9+
### Install dependencies
10+
11+
```
12+
coderockr
13+
├── README.md
14+
├── CNAME
15+
├── crossdomain.xml
16+
├── humans.txt
17+
├── Makefile
18+
├── robots.txt
19+
├── .gitignore
20+
├── dist
21+
│ └── index.html
22+
│ └── about.html
23+
│ └── contact.html
24+
│ └── bundle.min.js
25+
│ └── fonts
26+
│ └── images
27+
│ └── lib
28+
│ └── styles
29+
└── src
30+
└── .babelrc
31+
└── .editorconfig
32+
└── .eslintrc
33+
└── config.js
34+
└── gulpfile.babel.js
35+
└── node_modules
36+
└── package-lock.json
37+
└── package.json
38+
└── site
39+
└── tasks
40+
└── yarn.lock
41+
```
942

1043
### Install dependencies
1144

45+
```bash
46+
cd src
47+
```
48+
1249
```bash
1350
yarn install
1451
```
@@ -19,9 +56,9 @@ yarn install
1956
gulp
2057
```
2158

22-
## What's included?
59+
## Features
2360

24-
### Technology
61+
### tecnlogias
2562

2663
- [Gulp.js](http://gulpjs.com/) – Automate and enhance your workflow.
2764
- [BrowserSync](https://www.browsersync.io/) – Time-saving synchronised browser testing.

src/package.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,17 @@
33
"version": "1.0.0",
44
"description": "Website Codercokr",
55
"main": "gulpfile.babel.js",
6-
"scripts": {
7-
"lint": "eslint --format=node_modules/eslint-formatter-pretty . *.js",
8-
"test": "ava"
9-
},
106
"author": "Codercokr",
117
"license": "MIT",
128
"devDependencies": {
139
"autoprefixer": "^7.0.0",
14-
"ava": "^0.18.0",
1510
"babel-core": "^6.21.0",
1611
"babel-eslint": "^7.1.1",
1712
"babel-preset-es2015": "^6.18.0",
1813
"babelify": "^7.3.0",
1914
"bootstrap": "4.0.0-alpha.5",
2015
"browser-sync": "^2.18.5",
2116
"browserify": "^14.0.0",
22-
"eslint": "^3.12.2",
23-
"eslint-config-airbnb-base": "latest",
24-
"eslint-formatter-pretty": "^1.1.0",
25-
"eslint-plugin-flowtype": "^2.29.2",
26-
"eslint-plugin-flowtype-errors": "^3.0.0",
27-
"eslint-plugin-import": "^2.2.0",
28-
"eslint-plugin-jsx-a11y": "^4.0.0",
2917
"flow-bin": "latest",
3018
"gulp": "^3.9.1",
3119
"gulp-changed": "^2.0.0",

src/site/scripts/foto.js

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
/* eslint-disable */
2+
import $ from 'jquery';
3+
4+
function wizard() {
5+
6+
$(".input").focus(function(){
7+
$(this).addClass("is-active is-completed");
8+
});
9+
10+
$(".input").focusout(function(){
11+
if($(this).val() === "") {
12+
$(this).removeClass("is-completed");
13+
}
14+
$(this).removeClass("is-active");
15+
})
16+
17+
18+
$('[name="IsJob"]').on('change', function(event) {
19+
if ($(this).val() == 2) {
20+
$('.filter-on').css('display', 'none');
21+
$('#trabaho_atual').attr('required', false);
22+
} else {
23+
$('.filter-on').css('display', 'table');
24+
$('#trabaho_atual').attr('required', true);
25+
}
26+
});
27+
28+
$('#curso').on('change', function(event) {
29+
let value = $(this).val();
30+
31+
if (value == '' || value == 0) {
32+
$('.filter-university').css('display', 'none');
33+
$('#Semester').attr('required', false);
34+
} else {
35+
$('.filter-university').css('display', 'table');
36+
$('#Semester').attr('required', true);
37+
}
38+
});
39+
40+
const checkButtons = (activeStep, stepsCount) => {
41+
const nextBtn = $('.wizard-next');
42+
const submBtn = $('.wizard-subm');
43+
44+
switch (activeStep / stepsCount) {
45+
case 0: // Primeiro Step
46+
submBtn.hide();
47+
nextBtn.show();
48+
break;
49+
case 1: // Ultimo Step
50+
nextBtn.hide();
51+
submBtn.show();
52+
break;
53+
default:
54+
submBtn.hide();
55+
nextBtn.show();
56+
}
57+
};
58+
59+
const setWizardHeight = (activeStepHeight) => {
60+
$('.wizard-body').height(activeStepHeight);
61+
};
62+
63+
let wizardSteps = $('.wizard-step');
64+
let steps = $('.wizard-body .step');
65+
let stepsCount = steps.length - 1;
66+
let viewHeight = $(window).height();
67+
let activeStep = 0;
68+
let activeStepHeight = $(steps[activeStep]).height();
69+
70+
checkButtons(activeStep, stepsCount);
71+
setWizardHeight(activeStepHeight);
72+
73+
$(window).resize(() => {
74+
setWizardHeight($(steps[activeStep]).height());
75+
});
76+
77+
const scrollWindow = (activeStepHeight, viewHeight) => {
78+
if (viewHeight < activeStepHeight) {
79+
$(window).scrollTop($(steps[activeStep]).offset().top - viewHeight / 2);
80+
}
81+
};
82+
83+
$('.button').click((e) => {
84+
e.preventDefault();
85+
86+
var that = e;
87+
const curInputs = $(steps[activeStep]).find('input[required=true], input[required=required],input[required="true"], input[type=radio],textarea, select');
88+
let isValid = true;
89+
90+
$('#first-step-header').hide();
91+
$('.input-group, .card').removeClass('-has-error');
92+
93+
// eslint-disable-next-line
94+
for (let i = 0; i < curInputs.length; i++) {
95+
if ( !curInputs[i].validity.valid || $(curInputs[i]).closest('.input-group').is('.-has-incomplete')) {
96+
isValid = false;
97+
$(curInputs[i]).closest('.input-group').addClass('-has-error');
98+
$(curInputs[i]).closest('.card').addClass('-has-error');
99+
}
100+
}
101+
102+
if (isValid) {
103+
if (that.target.id === 'wizard-subm') {
104+
$('button').html('Aguarde, enviando').attr('disabled', 'disabled').addClass('load');
105+
setTimeout(function(){
106+
$('form').submit();
107+
}, 5000)
108+
}else{
109+
$(steps[activeStep]).removeClass('inital').addClass('off').removeClass('active');
110+
$(wizardSteps[activeStep]).removeClass('site-nav__current');
111+
112+
activeStep += 1;
113+
114+
if (activeStep === 2) {
115+
$('.wizard-body').css('overflow', 'hidden');
116+
}
117+
118+
$(steps[activeStep]).addClass('active');
119+
$(wizardSteps[activeStep]).addClass('site-nav__current');
120+
activeStepHeight = $(steps[activeStep]).height();
121+
setWizardHeight(activeStepHeight);
122+
checkButtons(activeStep, stepsCount);
123+
scrollWindow(activeStepHeight, viewHeight);
124+
}
125+
}else{
126+
$(window).scrollTop($('.-has-error').eq(0).offset().top);
127+
$('.-has-error').eq(0).find('input').focus();
128+
}
129+
});
130+
}
131+
132+
export default foto();

0 commit comments

Comments
 (0)