Skip to content

Added .button styles to view links #29

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

Merged
merged 1 commit into from
Jul 8, 2019
Merged
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
5 changes: 3 additions & 2 deletions custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,9 @@

// Toggle between calendar and list views

$('.viewLinks').on('click', '.viewLink', function() {
$('.viewLink').removeClass('active');
$('.viewLinks').on('click', '.button', function(e) {
e.preventDefault();
$('.viewLinks .button').removeClass('active');
$('.view').removeClass('showing');
$(this).addClass('active');
$('.view.' + this.id ).addClass('showing');
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ <h2>Upcoming Events:</h2>
<div id="mapid"></div>

<div class='viewLinks'>
<a class='viewLink active' id='list'>List View</a>
<a class='viewLink' id='weekly'>Week View</a>
<a id='list' class='button viewLink active' href="#">List View</a>
<a id='weekly' class='button viewLink' href="#">Week View</a>
</div>

<div class='view weekly'>
Expand Down
43 changes: 35 additions & 8 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* {
box-sizing: border-box;
}
html {
scroll-behavior: smooth;
}
Expand All @@ -17,6 +20,20 @@ a {
color: #b74949;
cursor: pointer;
}
a:hover,
a:active,
a.active,
.active > a {
color: #000;
}
a.active,
.active > a {
text-decoration: none;
}
a.active:hover,
.active > a:hover {
text-decoration: underline;
}

h1 {
font-size: 3em;
Expand Down Expand Up @@ -52,6 +69,21 @@ li {
margin-bottom: 0.5rem;
}

.button {
display: block;
border: 1px solid #b74949;
padding: 10px;
margin-right: 5px;
text-decoration: none;
}
.button.active,
.button:hover {
background: rgba(183, 73, 73, 0.3);
}
.button:hover {
text-decoration: underline;
}

/** HEADER **/
header {
margin-bottom: 3rem;
Expand Down Expand Up @@ -103,15 +135,10 @@ section {
width: 100%;
padding: 5px;
margin: 25px 0;
display: flex;
flex-direction: row;
}
.viewLink {
padding: 5px;
color: #000;
}
.viewLink:hover, .viewLink.active {
color: rgba(183, 73, 73);
text-decoration: underline;
}

.showing {
display: block;
}
Expand Down