Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Deval13 authored Feb 16, 2024
1 parent b1e8dda commit 0c85608
Show file tree
Hide file tree
Showing 8 changed files with 324 additions and 0 deletions.
8 changes: 8 additions & 0 deletions module-3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@


# Module-3 Coding Assignment

Coursera course: HTML, CSS, and Javascript for Web Developers

# To see the output [CLICK HERE](https://siddartha19.github.io/Coursera-HTML-CSS-and-JavaScript-for-Web-Developers/Assignments/module-3/index.html)

77 changes: 77 additions & 0 deletions module-3/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!DOCTYPE html>
<html>
<head>

<title>Module 3</title>

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

</head>

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style.css">



<body>


<nav class="navbar" id="top">
<div class="container-fluid">

<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Food, LLC</a>
</div>

<div class="collapse" id="myNavbar">
<ul class="nav navbar-nav visible-xs">
<li><a class="menu-item" href="#">Chicken</a></li>
<li><a class="menu-item" href="#">Beef</a></li>
<li><a class="menu-item" href="#">Sushi</a></li>
</ul>
</div>

</div>
</nav>

<h1 class="main-title">Our Menu</h1>



<div class="row">

<div class="col-lg-4 col-md-6 col-sm-12">
<div class="content-box">
<p class="item-name">Chicken</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<a href="#top">(Back to Top)</a></p>
</div>
</div>

<div class="col-lg-4 col-md-6 col-sm-12">
<div class="content-box">
<p class="item-name">Beef</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<a href="#top">(Back to Top)</a></p>
</div>
</div>


<div class="col-lg-4 col-md-12 col-sm-12">
<div class="content-box">
<p class="item-name">Sushi</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<a href="#top">(Back to Top)</a></p>
</div>
</div>

</div>


</body>
</html>
97 changes: 97 additions & 0 deletions module-3/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@

.container-fluid{
margin: 0;
padding: 0;
}

.navbar{
border-radius: 0px;
background-color: rgba(0,0,0,0.8);
}

.navbar-brand{
font-size: 35px;
color: white;
padding-left: 25px;
}

.navbar-brand:hover{
color: white;
}

.nav{
margin: 0;
padding: 0;
}

.navbar-nav{
font-size: 25px;
text-align: center;
margin: 0;
padding: 0;
}

.navbar-toggle{
border: 2px solid white;
margin-right: 25px;
}

.icon-bar{
background-color: white;
}


.main-title{
margin-bottom: 15px;
text-align: center;
color: #ff4532;
font-size: 50px;
font-family: "Comic Sans MS", cursive, sans-serif;
font-weight: bold;
}

li{
box-sizing: border-box;
width: 100%;
}

.menu-item{
padding: 0;
margin: 0;
width: 100%;
background-color: white;
border-bottom: 1px solid black;
color: black;
display: block;
}

.menu-item:hover{
background-color: rgba(0,0,0,0.9);
color: rgba(0,0,0,0.4);
}



.row{
margin: 20px;
}

.content-box{
margin: 20px;
width: auto;
height: auto;
color: black;
background-color: rgba(0,0,0,0.2);
font-family: "Comic Sans MS", cursive, sans-serif;
padding: 20px;
}

.item-name{
text-align: center;
font-size: 20px;
font-weight: bold;
}

#top{

}
8 changes: 8 additions & 0 deletions module-4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@


# Module-4 Coding Assignment

Coursera course: HTML, CSS, and Javascript for Web Developers

# To see the output [CLICK HERE](https://siddartha19.github.io/Coursera-HTML-CSS-and-JavaScript-for-Web-Developers/Assignments/module-4/index.html)

34 changes: 34 additions & 0 deletions module-4/SpeakGoodBye.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// NOTE! The steps in this file are basically identical to the ones you
// performed in the SpeakHello.js file.

// STEP 6: Wrap the entire contents of SpeakGoodBye.js inside of an IIFE
// See Lecture 52, part 2


// STEP 7: Create an object, called 'byeSpeaker' to which you will attach
// the "speak" method and which you will expose to the global context
// See Lecture 52, part 1
// var byeSpeaker =

// DO NOT attach the speakWord variable to the 'byeSpeaker' object.


// STEP 8: Rewrite the 'speak' function such that it is attached to the
// byeSpeaker object instead of being a standalone function.
// See Lecture 52, part 2


// STEP 9: Expose the 'byeSpeaker' object to the global scope. Name it
// 'byeSpeaker' on the global scope as well.
// xxxx.xxxx = byeSpeaker;


(function(window) {
var speakWord = "Good Bye";
var byeSpeaker = function (name) {
console.log(speakWord + " " + name);
}

window.byeSpeaker = byeSpeaker;

})(window);
32 changes: 32 additions & 0 deletions module-4/SpeakHello.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// STEP 2: Wrap the entire contents of SpeakHello.js inside of an IIFE
// See Lecture 52, part 2


// STEP 3: Create an object, called 'helloSpeaker' to which you will attach
// the "speak" method and which you will expose to the global context
// See Lecture 52, part 1
// var helloSpeaker =

// DO NOT attach the speakWord variable to the 'helloSpeaker' object.


// STEP 4: Rewrite the 'speak' function such that it is attached to the
// helloSpeaker object instead of being a standalone function.
// See Lecture 52, part 2

// STEP 5: Expose the 'helloSpeaker' object to the global scope. Name it
// 'helloSpeaker' on the global scope as well.
// See Lecture 52, part 2
// (Note, Step 6 will be done in the SpeakGoodBye.js file.)
// xxxx.xxxx = helloSpeaker;


(function(window) {
var speakWord = "Hello";
var helloSpeaker = function (name) {
console.log(speakWord + " " + name);
}

window.helloSpeaker = helloSpeaker;

})(window);
19 changes: 19 additions & 0 deletions module-4/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Module 4 Solution Starter</title>
<script src="SpeakHello.js"></script>
<script src="SpeakGoodBye.js"></script>
<script src="script.js"></script>
</head>
<body>
<h1>Module 4 Solution Starter</h1>
<p>open console to see the output</p>
</body>
</html>



49 changes: 49 additions & 0 deletions module-4/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// *******************************
// START HERE IF YOU WANT AN EASIER STARTING POINT FOR THIS ASSIGNMENT
// *******************************
//
// Module 4 Assignment Instructions.
//
// The idea of this assignment is to take an existing array of names
// and then output either Hello 'Name' or Good Bye 'Name' to the console.
// The program should say "Hello" to any name except names that start with a "J"
// or "j", otherwise, the program should say "Good Bye". So, the final output
// on the console should look like this:
/*
Hello Yaakov
Good Bye John
Good Bye Jen
Good Bye Jason
Hello Paul
Hello Frank
Hello Larry
Hello Paula
Hello Laura
Good Bye Jim
WARNING!!! WARNING!!!
The code does NOT currently work! It is YOUR job to make it work
as described in the requirements and the steps in order to complete this
assignment.
WARNING!!! WARNING!!!
*/


(function () {

var names = ["Yaakov", "John", "Jen", "Jason", "Paul", "Frank", "Larry", "Paula", "Laura", "Jim"];

for (var i = 0; i < names.length; i++) {
var firstLetter = names[i].charAt(0).toLowerCase();

if (firstLetter === 'j') {
byeSpeaker(names[i]);
}
else {
helloSpeaker(names[i]);
}
}

})();



0 comments on commit 0c85608

Please sign in to comment.