Skip to content

Commit

Permalink
Style updates!
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanhogan committed Jan 10, 2016
1 parent 950b867 commit 8ec1b25
Show file tree
Hide file tree
Showing 9 changed files with 329 additions and 190 deletions.
34 changes: 12 additions & 22 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@
<link rel="stylesheet" type="text/css" href="./css/style.css">
</head>
<body>
<button id="menu-toggle" class="menu-toggle">Menu</button>
<header id="page-header" class="page-header">
<form class="search-form" type="POST">
<input type='search' placeholder="Search...">
<button type="submit">Search</button>
</form>

<button id="menu-toggle" class="menu-toggle">Menu</button>
</header>

<div id="menu">
<h3>Options</h3>
Expand Down Expand Up @@ -75,20 +82,12 @@ <h3>Options</h3>
</li>
</ul>

<form class="search-form" type="POST">
<input type='search' placeholder="Search...">
<button type="submit">Search</button>
</form>
<a href="/?Main_Page">Main Page</a>
</div>

<div class="container push">
<div id="content">
<h1 class='logo'>Wik<em>i<span>P</span>ad</em>ia</h1>

<form class="search-form" type="POST">
<input type='search' placeholder="Search to get started...">
<button type="submit">Search</button>
</form>
<h1 class='logo'>Wikip<em>a</em>dia</h1>

<a href="/?Main_Page" class="main-page-link">Main Page</a>

Expand All @@ -103,25 +102,16 @@ <h1 class='logo'>Wik<em>i<span>P</span>ad</em>ia</h1>
</div>

<footer>
<form class="search-form" type="POST">
<input type='search' placeholder="Search...">
<button type="submit">Search</button>
</form>

<small class='attribution'><a href="https://github.com/rowanhogan/wikipadia">Made</a> by <a href="http://rowanhogan.com">Rowan Hogan</a>.</small>

<br>

<a class="home-link" href="/">Home</a>

<small class='attribution'><a href="https://github.com/rowanhogan/wikipadia">Made</a> by <a href="http://rowanhogan.com">Rowan Hogan</a>.</small>
</footer>
</div>

<button class="menu-toggle menu-overlay">Menu</button>

<script type="text/javascript" src="./js/main.js"></script>

<link href='https://fonts.googleapis.com/css?family=Cardo:400,400italic,700|Roboto:400,400italic,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Roboto:400,700,400italic|Playfair+Display:700|PT+Serif:400,400italic,700' rel='stylesheet' type='text/css'>

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
Expand Down
22 changes: 22 additions & 0 deletions app/scripts/components/eventHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@
var $ = require('jquery');
var handleTheme = require('./handleTheme');
var handleFont = require('./handleFont');
var lastScrollTop = 0;

$(document).on('scroll', function(e) {
var st = $(window).scrollTop();

var header = $("#page-header");

if (st > lastScrollTop) {
header.addClass('scrolled');
} else {
header.removeClass('scrolled');
}

lastScrollTop = st;
});


$(document).on('click', '#toctitle', function(e) {
e.preventDefault();

$('#toc').toggleClass('active');
});

$(document).on('keyup', '#custom-styles-input', function(e) {
var styles = $(this).val();
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/components/handleData.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ function handleData (data, lang) {
var contentEl = document.getElementById('content');

if (data.error) {
// debugger
contentEl.innerHTML = data.error.info;
return false
}
Expand All @@ -30,6 +29,7 @@ function handleData (data, lang) {
});

var titleEl = document.createElement('h1');
titleEl.classList.add('page-title')
titleEl.innerHTML = title;

contentEl.parentElement.insertBefore(titleEl, contentEl.parentElement.firstChild);
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/components/handleNewPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function handleNewPage (pageTitle, lang) {
url: `https://${lang}.wikipedia.org/w/api.php?callback=?`,
data: {
action: "parse",
prop: "text",
prop: "text|sections|images",
page: decodedPageTitle,
format: 'json'
},
Expand Down
Loading

0 comments on commit 8ec1b25

Please sign in to comment.