-
Notifications
You must be signed in to change notification settings - Fork 34
Introduction_to_Web_Animations_using_CSS_Code_Deliverable #237
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
Open
KathyLiu20
wants to merge
8
commits into
bitprj:Driving-the-car-and-flowing-the-water-with-CSS
Choose a base branch
from
KathyLiu20:master
base: Driving-the-car-and-flowing-the-water-with-CSS
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2668e1d
code deliverables
KathyLiu20 beacc64
blog revision based on feedbacks
KathyLiu20 e7f4515
update starter and solution code
KathyLiu20 42e8d0e
Update blog.md
allenaavila c1e6b3f
Update blog.md
allenaavila f0357b1
Update blog.md
allenaavila d55e965
Update blog.md
allenaavila 20467e1
update blog based on editor's feedback
KathyLiu20 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 hidden or 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 |
|---|---|---|
|
|
@@ -10,7 +10,8 @@ In this blog, we are going to keep building our mini city. We will have a car go | |
|
|
||
| First, let's build our car and boat with HTML and CSS like we did for the ground and buildings previously. | ||
| The car is a rectangle box and the boat is a rectangle box with a triangle in the front. Both of them has a shadow to help show the 3D effect. | ||
| So we need to have 2 divs for the car and the boat, and in each of them, we will have some children divs inside. | ||
| So we need to have 2 divs for the car and the boat, and in each of them, we will have some children divs inside. Children divs are divs inside a parent div. They are associated to their parent, and can be easily aligned with their parent div. The two children divs under the car are to hold the left and front side rectangles, and the three children divs under the boat are to hold the triangle in the front, and the left and front side rectangles. | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! |
||
| ##### In HTML | ||
| ``` | ||
| <div class = "car"> | ||
|
|
||
144 changes: 144 additions & 0 deletions
144
IMC_WebDev/#Driving_the_car_and_flowing_the_water_with_CSS/solution/solution.css
This file contains hidden or 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,144 @@ | ||
| body { | ||
| position: fixed; | ||
| background-color: #d5f3fe; | ||
| top: 40%; | ||
| left: 50%; | ||
| margin-left: -100px; | ||
| margin-top: -50px; | ||
| } | ||
|
|
||
| /*CAR*/ | ||
| .car { | ||
| position: absolute; | ||
| display: block; | ||
| width: 16px; | ||
| height: 5px; | ||
| top: 230px; | ||
| left: -80px; | ||
| box-shadow: -8px 5px 0 0 #333; | ||
| z-index: 1; | ||
| background-color: #c52735; | ||
| animation: car 9s linear infinite; | ||
| transform: skew(60deg, -15deg); | ||
| } | ||
|
|
||
| /*front rectangle*/ | ||
| .car div:first-child { | ||
| position: absolute; | ||
| display: block; | ||
| background-color: #9b0404; | ||
| width: 16px; | ||
| height: 3px; | ||
| top: 5px; | ||
| right: 2.75px; | ||
| z-index: -998; | ||
| transform: skewX(-60deg); | ||
| } | ||
|
|
||
| /*left rectangle*/ | ||
| .car div:nth-child(2) { | ||
| position: absolute; | ||
| display: block; | ||
| background-color: #9b0404; | ||
| width: 5px; | ||
| height: 5px; | ||
| top: 1.5px; | ||
| right: 16px; | ||
| z-index: -998; | ||
| transform: skewY(-30deg); | ||
| } | ||
|
|
||
| /*car's animation*/ | ||
| @keyframes car { | ||
| 0% { | ||
| top: 240px; | ||
| left: -75px; | ||
| } | ||
| 39% { | ||
| top: 190px; | ||
| left: 100px; | ||
| } | ||
| 50% { | ||
| top: 170px; | ||
| left: 150px; | ||
| } | ||
| 65% { | ||
| top: 144px; | ||
| left: 240px; | ||
| } | ||
| 73% { | ||
| top: 145px; | ||
| left: 280px; | ||
| } | ||
| 100% { | ||
| top: 95px; | ||
| left: 450px; | ||
| } | ||
| } | ||
|
|
||
| /*BOAT*/ | ||
| .boat { | ||
| /*boat rectangle and shadow*/ | ||
| position: absolute; | ||
| display: block; | ||
| width: 16px; | ||
| height: 15px; | ||
| top: 100px; | ||
| left: 100px; | ||
| box-shadow: -13px 5px 15px 15px #215199; | ||
| z-index: -998; | ||
| background-color: #e2a150; | ||
| animation: boat 15s linear infinite; | ||
| transform: skew(60deg, -15deg); | ||
| } | ||
|
|
||
| /*left rectangle*/ | ||
| .boat div:first-child { | ||
| position: absolute; | ||
| display: block; | ||
| background-color: #996627; | ||
| width: 8px; | ||
| height: 6px; | ||
| top: 20px; | ||
| right: 12px; | ||
| z-index: -998; | ||
| transform: skew(-60deg, 55deg); | ||
| } | ||
|
|
||
| /*front triangle part*/ | ||
| .boat div:nth-child(2) { | ||
| margin-top: 15px; | ||
| margin-left: 0px; | ||
| width: 0; | ||
| height: 0; | ||
| z-index: -998; | ||
| border-left: 8px solid transparent; | ||
| border-right: 8px solid transparent; | ||
| border-top: 12px solid #e2a150; | ||
| } | ||
|
|
||
| /*front rectangle*/ | ||
| .boat div:nth-child(3) { | ||
| position: absolute; | ||
| display: block; | ||
| background-color: #996627; | ||
| width: 9px; | ||
| height: 15.5px; | ||
| top: 2.5px; | ||
| right: 16px; | ||
| z-index: -998; | ||
| transform: skewY(-30deg); | ||
| } | ||
|
|
||
| /*boat's animation*/ | ||
| @keyframes boat { | ||
| 0% { | ||
| top: 60px; | ||
| left: 20px; | ||
| } | ||
| 100% { | ||
| top: 150px; | ||
| left: 220px; | ||
| } | ||
| } | ||
|
|
28 changes: 28 additions & 0 deletions
28
IMC_WebDev/#Driving_the_car_and_flowing_the_water_with_CSS/solution/solution.html
This file contains hidden or 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,28 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <title>Mini City Webinar</title> | ||
| <link rel="stylesheet" href="solution.css" /> | ||
| </head> | ||
|
|
||
| <!--HTML--> | ||
| <body> | ||
| <!--car--> | ||
| <div class="car"> | ||
| <div></div> | ||
| <!--front side--> | ||
| <div></div> | ||
| <!--left side--> | ||
| </div> | ||
|
|
||
| <!--boat--> | ||
| <div class="boat"> | ||
| <div></div> | ||
| <!--left side--> | ||
| <div></div> | ||
| <!--triangle--> | ||
| <div></div> | ||
| <!--front side--> | ||
| </div> | ||
| </body> | ||
| </html> |
Empty file.
10 changes: 10 additions & 0 deletions
10
IMC_WebDev/#Driving_the_car_and_flowing_the_water_with_CSS/starter/starter.html
This file contains hidden or 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,10 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <title>Mini City Webinar</title> | ||
| </head> | ||
|
|
||
| <body> | ||
|
|
||
| </body> | ||
| </html> |
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.
For numbers under 10 in the text part of your blog post, spell them out