Skip to content
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

added Javascript #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 10 additions & 1 deletion static/css/introHCI.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,13 @@ body {
right: 0;
position: absolute;
z-index: -1;
}
}
p{
font-variant:small-caps;
}
.project p{
font-variant: small-caps;
}
#project1{
font-variant: small-caps;
}
46 changes: 27 additions & 19 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<title>HCI Project Portfolio</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
<link href="css/introHCI.css" rel="stylesheet">
<!-- this is a comment in HTML -->

Expand All @@ -18,12 +20,13 @@
</head>

<body>
<div>
<div class = "container">
<!-- h1 through h6 are headers. The higher the number, the smaller the header -->
<!-- p means paragraph -->
<div>
<div class = "jumbotron">
<h1>Michael Bernstein</h1>
<p>human-computer interaction &middot; social computing &middot; crowdsourcing</p>
<button id="testjs" class="btn btn-primary btn-lg">Test Javascript</button>
</div>


Expand All @@ -32,53 +35,58 @@ <h4>Projects</h4>
<!-- img tags are images. Lorem Pixel will deliver random images; handy! -->
<!-- a are anchors, also known as hyperlinks. Use the href attribute to tell the browser where to go when the user clicks -->
<div class="project" id="project1">
<a href="project.html">
<img src="images/lorempixel.people.1.jpeg" alt="Lorem Pixel image">
<a href="project.html" class = "thumbnail">
<img src="images/lorempixel.people.1.jpeg" alt="Lorem Pixel image" class = "img">
<p>Waiting in Line</p>
</a>
</div>
<div class="project" id="project2">
<a href="project.html">
<img src="images/lorempixel.city.1.jpeg" alt="Lorem Pixel image">
<a href="project.html" class = "thumbnail">
<img src="images/lorempixel.city.1.jpeg" alt="Lorem Pixel image" class = "img">
<p>Needfinding</p>
</a>
</div>
<div class="project" id="project3">
<a href="project.html">
<img src="images/lorempixel.technics.1.jpeg" alt="Lorem Pixel image">
<a href="project.html" class = "thumbnail">
<img src="images/lorempixel.technics.1.jpeg" alt="Lorem Pixel image" class = "img">
<p>Prototyping</p>
</a>
</div>
<div class="project" id="project4">
<a href="project.html">
<img src="images/lorempixel.abstract.1.jpeg" alt="Lorem Pixel image">
<a href="project.html" class = "thumbnail">
<img src="images/lorempixel.abstract.1.jpeg" alt="Lorem Pixel image" class = "img">
<p>Heuristic Evaluation</p>
</a>
</div>
<div class="project" id="project5">
<a href="project.html">
<img src="images/lorempixel.abstract.8.jpeg" alt="Lorem Pixel image">
<a href="project.html" class = "thumbnail">
<img src="images/lorempixel.abstract.8.jpeg" alt="Lorem Pixel image" class = "img">
<p>Visualization</p>
</a>
</div>
<div class="project" id="project6">
<a href="project.html">
<img src="images/lorempixel.people.2.jpeg" alt="Lorem Pixel image">
<a href="project.html" class = "thumbnail">
<img src="images/lorempixel.people.2.jpeg" alt="Lorem Pixel image" class = "img">
<p>Social design</p>
</a>
</div>
<div class="project" id="project7">
<a href="project.html">
<img src="images/lorempixel.technics.2.jpeg" alt="Lorem Pixel image">
<a href="project.html" class = "thumbnail">
<img src="images/lorempixel.technics.2.jpeg" alt="Lorem Pixel image" class = "img">
<p>Gestural interaction</p>
</a>
</div>
<div class="project" id="project8">
<a href="project.html">
<img src="images/lorempixel.city.2.jpeg" alt="Lorem Pixel image">
<a href="project.html" class = "thumbnail">
<img src="images/lorempixel.city.2.jpeg" alt="Lorem Pixel image" class = "img">
<p>Design tools</p>
</a>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://code.jquery.com/jquery.js"></script>
<!-- Include all compiled plugins (blelow), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script src = "js/introHCI.js"></script>
</body>
</html>
12 changes: 12 additions & 0 deletions static/js/introHCI.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,16 @@ function initializePage() {
$('#testjs').click(function(e) {
$('.jumbotron h1').text("Javascript is connected");
});
$("a.thumbnail").click(projectClick);
function projectClick(e) {

// prevent the page from reloading

e.preventDefault();
// In an event handler, $(this) refers to

// the object that triggered the event

$(this).css("background-color", "#7fff00");
}
}