-
Notifications
You must be signed in to change notification settings - Fork 3
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
Wtc 8 eating #32
Merged
Merged
Wtc 8 eating #32
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e3c6c5f
Add eating page and interact to apply movement to banana
skibinska 81a22a3
Resolve merge conflict in main.css
skibinska d3ed5c1
Add dragable banana-slider
skibinska 08564b4
Add slider, remove interact.js
skibinska 308c940
Add banana as a slider
skibinska da5487d
Resolve conflict in main.css related #8
skibinska 1ab5c36
Change description
skibinska c306fe4
Clean up files
skibinska 0e003ab
Rename class
skibinska 0041199
Clean js file
skibinska 0ab2bc9
Add checkboxes
skibinska f799076
Remove unused file
skibinska 8f48dd3
Wrap js file into function
skibinska File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Henny+Penny|Montserrat+Alternates"> | ||
<link rel="stylesheet" href="main.css"> | ||
|
||
<title>Welcome to CAMHS</title> | ||
</head> | ||
<body> | ||
<div class="eating"> | ||
<h1 class="eating__title">How are you eating?</h1> | ||
<p class="eating__text"> | ||
Slide to choose how many fruit and vegetables you eat per day. | ||
</p> | ||
<div class="eating__slider"> | ||
<input class="slider__range" type="range" min="0" max="5" value="0" step="1" | ||
oninput="updateOutput(value)"> | ||
<div class="slider__reel"></div> | ||
<div class="slider__banana"></div> | ||
</div> | ||
<div class="eating__meals"> | ||
<p class="eating__text"> | ||
Do you usually have | ||
</p> | ||
<form class="" action="#"> | ||
<p> | ||
<input type="checkbox" name="breakfast" value="breakfast"> | ||
<span>breakfast</span> | ||
</p> | ||
<p> | ||
<input type="checkbox" name="lunch" value="lunch" checked="checked"> | ||
<span>lunch</span> | ||
</p> | ||
<p> | ||
<input type="checkbox" name="dinner" value="dinner"> | ||
<span>dinner</span> | ||
</p> | ||
</form> | ||
</div> | ||
</div> | ||
|
||
<script src="lib/jquery-3.1.1.min.js"></script> | ||
<script src="slider.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//lets populate reel numbers | ||
var min = $(".slider__range").attr("min"); | ||
var max = $(".slider__range").attr("max"); | ||
|
||
updateOutput($(".slider__range").val()); | ||
|
||
var horizontal; | ||
function updateOutput(figure) { | ||
//displaying the static output | ||
$(".slider__banana").html(figure); | ||
|
||
//positioning .static-output and .reel | ||
//horizontal positioning first | ||
horizontal = figure/max*($(".eating__slider").width()-$(".slider__reel").width()) + 'px'; | ||
|
||
//applying the positions | ||
$(".slider__banana, .slider__reel").css({left: horizontal}); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap this up in a function, so you do not pollute global scope!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure 👍