Skip to content

Develop #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update readme
  • Loading branch information
leonardoelias4 committed Sep 15, 2017
commit 40c5f83955c674e90289af70df1e7bd309ea08ec
51 changes: 44 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,51 @@
## Requirements
coderockr
====================

- Working personal computer
- Node.js
## Setup
### Requirements

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

You can also `git clone`.
### Install dependencies

```
coderockr
├── README.md
├── CNAME
├── crossdomain.xml
├── humans.txt
├── Makefile
├── robots.txt
├── .gitignore
├── dist
│ └── index.html
│ └── about.html
│ └── contact.html
│ └── bundle.min.js
│ └── fonts
│ └── images
│ └── lib
│ └── styles
└── src
└── .babelrc
└── .editorconfig
└── .eslintrc
└── config.js
└── gulpfile.babel.js
└── node_modules
└── package-lock.json
└── package.json
└── site
└── tasks
└── yarn.lock
```

### Install dependencies

```bash
cd src
```

```bash
yarn install
```
Expand All @@ -19,9 +56,9 @@ yarn install
gulp
```

## What's included?
## Features

### Technology
### tecnlogias

- [Gulp.js](http://gulpjs.com/) – Automate and enhance your workflow.
- [BrowserSync](https://www.browsersync.io/) – Time-saving synchronised browser testing.
Expand Down
12 changes: 0 additions & 12 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,17 @@
"version": "1.0.0",
"description": "Website Codercokr",
"main": "gulpfile.babel.js",
"scripts": {
"lint": "eslint --format=node_modules/eslint-formatter-pretty . *.js",
"test": "ava"
},
"author": "Codercokr",
"license": "MIT",
"devDependencies": {
"autoprefixer": "^7.0.0",
"ava": "^0.18.0",
"babel-core": "^6.21.0",
"babel-eslint": "^7.1.1",
"babel-preset-es2015": "^6.18.0",
"babelify": "^7.3.0",
"bootstrap": "4.0.0-alpha.5",
"browser-sync": "^2.18.5",
"browserify": "^14.0.0",
"eslint": "^3.12.2",
"eslint-config-airbnb-base": "latest",
"eslint-formatter-pretty": "^1.1.0",
"eslint-plugin-flowtype": "^2.29.2",
"eslint-plugin-flowtype-errors": "^3.0.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"flow-bin": "latest",
"gulp": "^3.9.1",
"gulp-changed": "^2.0.0",
Expand Down
132 changes: 132 additions & 0 deletions src/site/scripts/foto.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/* eslint-disable */
import $ from 'jquery';

function wizard() {

$(".input").focus(function(){
$(this).addClass("is-active is-completed");
});

$(".input").focusout(function(){
if($(this).val() === "") {
$(this).removeClass("is-completed");
}
$(this).removeClass("is-active");
})


$('[name="IsJob"]').on('change', function(event) {
if ($(this).val() == 2) {
$('.filter-on').css('display', 'none');
$('#trabaho_atual').attr('required', false);
} else {
$('.filter-on').css('display', 'table');
$('#trabaho_atual').attr('required', true);
}
});

$('#curso').on('change', function(event) {
let value = $(this).val();

if (value == '' || value == 0) {
$('.filter-university').css('display', 'none');
$('#Semester').attr('required', false);
} else {
$('.filter-university').css('display', 'table');
$('#Semester').attr('required', true);
}
});

const checkButtons = (activeStep, stepsCount) => {
const nextBtn = $('.wizard-next');
const submBtn = $('.wizard-subm');

switch (activeStep / stepsCount) {
case 0: // Primeiro Step
submBtn.hide();
nextBtn.show();
break;
case 1: // Ultimo Step
nextBtn.hide();
submBtn.show();
break;
default:
submBtn.hide();
nextBtn.show();
}
};

const setWizardHeight = (activeStepHeight) => {
$('.wizard-body').height(activeStepHeight);
};

let wizardSteps = $('.wizard-step');
let steps = $('.wizard-body .step');
let stepsCount = steps.length - 1;
let viewHeight = $(window).height();
let activeStep = 0;
let activeStepHeight = $(steps[activeStep]).height();

checkButtons(activeStep, stepsCount);
setWizardHeight(activeStepHeight);

$(window).resize(() => {
setWizardHeight($(steps[activeStep]).height());
});

const scrollWindow = (activeStepHeight, viewHeight) => {
if (viewHeight < activeStepHeight) {
$(window).scrollTop($(steps[activeStep]).offset().top - viewHeight / 2);
}
};

$('.button').click((e) => {
e.preventDefault();

var that = e;
const curInputs = $(steps[activeStep]).find('input[required=true], input[required=required],input[required="true"], input[type=radio],textarea, select');
let isValid = true;

$('#first-step-header').hide();
$('.input-group, .card').removeClass('-has-error');

// eslint-disable-next-line
for (let i = 0; i < curInputs.length; i++) {
if ( !curInputs[i].validity.valid || $(curInputs[i]).closest('.input-group').is('.-has-incomplete')) {
isValid = false;
$(curInputs[i]).closest('.input-group').addClass('-has-error');
$(curInputs[i]).closest('.card').addClass('-has-error');
}
}

if (isValid) {
if (that.target.id === 'wizard-subm') {
$('button').html('Aguarde, enviando').attr('disabled', 'disabled').addClass('load');
setTimeout(function(){
$('form').submit();
}, 5000)
}else{
$(steps[activeStep]).removeClass('inital').addClass('off').removeClass('active');
$(wizardSteps[activeStep]).removeClass('site-nav__current');

activeStep += 1;

if (activeStep === 2) {
$('.wizard-body').css('overflow', 'hidden');
}

$(steps[activeStep]).addClass('active');
$(wizardSteps[activeStep]).addClass('site-nav__current');
activeStepHeight = $(steps[activeStep]).height();
setWizardHeight(activeStepHeight);
checkButtons(activeStep, stepsCount);
scrollWindow(activeStepHeight, viewHeight);
}
}else{
$(window).scrollTop($('.-has-error').eq(0).offset().top);
$('.-has-error').eq(0).find('input').focus();
}
});
}

export default foto();