Commit 5a6d1bfb authored by Melroy van den Berg's avatar Melroy van den Berg

new version with site

parent 258e58ae
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -9,20 +9,20 @@ from mozrepl import Mozrepl
# Shipping trick only works in Chrome not in Firefox! Arrrg! Try setting hidden fields via javascript instead or other hacking when required.
# Shipping data: https://api.marktplaats.nl/v1/postnl/catalog
m=None
#try:
m = Mozrepl()
# Is user loggedin?
login = m.check_marktplaats_login()
if login == 0:
# Not yet logged in
# TODO: target can maybe be used in future
m.load_page_blocking("https://www.marktplaats.nl/account/login.html?target=https%3A%2F%2Fwww.marktplaats.nl%2F", "https://www.marktplaats.nl/account/login.html")
print ("Succesful login (hopefully), continue...")
try:
m = Mozrepl()
# Is user loggedin?
login = m.check_marktplaats_login()
if login == 0:
# Not yet logged in
# TODO: target can maybe be used in future
m.load_page_blocking("https://www.marktplaats.nl/account/login.html?target=https%3A%2F%2Fwww.marktplaats.nl%2F", "https://www.marktplaats.nl/account/login.html")
print ("Succesful login (hopefully), continue...")
m.load_page_blocking("https://www.marktplaats.nl/syi/201/228/plaatsAdvertentie.html?bucket=38&complete=true&origin=HEADER&l1=201&l2=228&title=Test&attribute[condition]=31&attribute[level]=1950&attribute[orientation]=1955&price.bidding=free-bidding&description=blah&price.value=25,50&acceptPaypal=true&attribute[delivery]=35&shippingDetails.price=650&shippingDetails.provider=postnl&shippingDetails.productCode=3000&shippingDetails.catalogName=parcels&shippingDetails.averageWeight=5000")
#except (KeyboardInterrupt, SystemExit):
# print ("Exit, bye bye.")
# if m:
# # close connection
# m.close()
m.load_page_blocking("https://www.marktplaats.nl/syi/201/228/plaatsAdvertentie.html?bucket=38&complete=true&origin=HEADER&l1=201&l2=228&title=Test&attribute[condition]=31&attribute[level]=1950&attribute[orientation]=1955&price.bidding=free-bidding&description=blah&price.value=25,50&acceptPaypal=true&attribute[delivery]=35&shippingDetails.price=650&shippingDetails.provider=postnl&shippingDetails.productCode=3000&shippingDetails.catalogName=parcels&shippingDetails.averageWeight=5000")
except (KeyboardInterrupt, SystemExit):
print ("Exit, bye bye.")
if m:
# close connection
m.close()
#https://addons.mozilla.org/en-US/firefox/addon/mozrepl/
"""
This module is a helper module which connects to the Mozrepl plugin of Firefox, using telnet.
And futhermore send all the repl commands to firefox and read data back.
"""
from time import sleep
import telnetlib
import socket
from subprocess import Popen, PIPE
import sys
# Internal module
import process
NR_RETRIES_DOCUMENT=1000 # 200 sec (3.3 min. time-out)/ 0.2 sec = 1000 tries
NR_RETRIES_FIREFOX=360 # 180 sec (3 min. time-out)/ 0.5 sec = 360 tries
def startFirefox():
"""
Start Ffirefox
"""
proc = Popen('firefox https://www.marktplaats.nl', shell=True, stdout=PIPE, bufsize=1)
with proc.stdout:
tries=0
for line in iter(proc.stdout.readline, b''):
if b'MOZREPL' in line:
break
elif tries == NR_RETRIES_FIREFOX:
print ("Firefox is not started (Extra->Mozrepl->Start) or MOZREPL plugin is not activated or not installed (Install: https://addons.mozilla.org/nl/firefox/addon/mozrepl/). Exit.")
exit(1)
else:
tries+=1
sleep(0.5)
print ("Waiting to start Firefox and Mozrepl plugin (Extra->Mozrepl->Start)...")
class Mozrepl:
def __init__(self):
"""
......@@ -35,16 +23,19 @@ class Mozrepl:
# $ telnet localhost 4242
try:
self.t = telnetlib.Telnet("localhost", 4242)
except socket.error:
except OSError as e:
print ("Maybe firefox is not running? Trying to start Firefox.")
startFirefox()
# Try one time again
try:
self.t = telnetlib.Telnet("localhost", 4242)
except socket.error:
print ("ERROR: Could not connect to Firefox. Did you install Mozrepl plugin in Firefox? (Install: https://addons.mozilla.org/nl/firefox/addon/mozrepl/).\nIf so, did you also start the service. In the menu: Extra->Mozrepl->Start.")
status = process.startFirefox()
if status == 0:
# Try one time again
try:
self.t = telnetlib.Telnet("localhost", 4242)
except OSError as e:
print ("ERROR: Could not connect to Firefox. Did you install Mozrepl plugin in Firefox? (Install: https://addons.mozilla.org/nl/firefox/addon/mozrepl/).\nIf so, did you also start the service. In the menu: Extra->Mozrepl->Start.")
exit(1)
else:
print ("Exit")
exit(1)
conn_log = self.readAllData()
split_log = conn_log.splitlines()
sockname = split_log[-1].split(b'>')[0].strip()
......@@ -70,11 +61,13 @@ class Mozrepl:
# Check logout url availability
self.writeData(b"function checkLogin(){for(var n=0,t=document.links.length;n<t;n++)if(document.links[n].href.startsWith(\"https://auth.marktplaats.nl/accounts/authentication/logout\"))return 1;return null}")
self.skipData()
# Execute the javascript function above
self.writeData(b"checkLogin()")
# 1 is logout url found, 0 is not found
(loggedin, valid) = self.readData()
if loggedin == "1":
print ("Already logged-in.")
self.writeData(b"alert('U bent reeds ingelogd in Marktplaats.')")
if loggedin == b'1':
print ("Already logged in at Marktplaats.")
#self.createPopup("U bent reeds ingelogd in Marktplaats.")
return 1
else:
print ("First login into Markplaats!")
......@@ -110,18 +103,25 @@ class Mozrepl:
# When no blocking url is defined use input URL instead
blocking_url = url
blocking_url = b'"' + blocking_url.encode('utf-8')
print_wait=False
while True:
self.writeData(b"window.location.href")
# Be-sure we run in content always (see valid flag)
(cur_url, valid) = self.readData(True)
# Only look at cur_url when there is valid data
# Only look at cur_url when there is valid data (data running in the current content)
if valid:
if not cur_url.startswith(blocking_url):
# Page, url is changed (page submitted?)
break
else:
print ("Required page change not yet happend. Waiting for user.")
sleep(3)
# Ignore the cookie url
if not cur_url.startswith(b'"https://www.marktplaats.nl/cookiewall'):
if not cur_url.startswith(blocking_url):
# Page, url is changed (page submitted?)
break
if not print_wait:
print("Waiting for user input")
print_wait=True
sys.stdout.write('.')
sys.stdout.flush()
sleep(3)
def wait_until_page_complete(self):
"""
......@@ -149,6 +149,12 @@ class Mozrepl:
self.writeData(b"content.location.href='" + url.strip().encode('utf-8') + b"'")
self.skipData()
def createPopup(self, message):
"""
Show pop-up to user in browser
"""
self.writeData(b"alert('" + message.encode('utf-8') + b"')")
def writeData(self, byte_buffer):
"""
Write data via write. New line at the end.
......@@ -174,7 +180,7 @@ class Mozrepl:
i = len(self.READ_UNTIL_CHARS)
try:
output = self.t.read_until(self.READ_UNTIL_CHARS)[:-i].strip()
except socket.error:
except OSError as e:
print ("Connection problem. Did you disable the plugin or closed Firefox??? Exit")
exit(1)
......@@ -183,6 +189,7 @@ class Mozrepl:
if inContentImportant:
# If a context uploading is seen, switch back to the content again: enter(content).
if output.startswith(b"Host context unloading"):
# Ensure to switch again to the content, and try again.
self.switchToContent()
# Mark as invalid, since the data is not what you expect to be
# re-execute the previous writeData() agaom/
......@@ -196,7 +203,7 @@ class Mozrepl:
def readAllData(self):
try:
return self.t.read_until(b"> ")
except socket.error:
except OSError as e:
print ("Connection problem. Did you disable the plugin or closed Firefox??? Exit")
exit(1)
......@@ -207,7 +214,7 @@ class Mozrepl:
"""
try:
self.t.read_until(self.READ_UNTIL_CHARS)
except socket.error:
except OSError as e:
print ("Connection problem. Did you disable the plugin or closed Firefox??? Exit")
exit(1)
......
import asyncio
import sys
from time import sleep
from asyncio.subprocess import PIPE, STDOUT
TIMEOUT_TO_ACTIVATE_PLUGIN=25 #secs
def process_line(line):
"""
Check if MOZREPL is in the stdout line
"""
return b"MOZREPL" in line
async def run_command(*args, timeout=None):
"""
Start process with timeout durinf the readout of stdout
"""
return_code = 0
# Start Firefox process
process = await asyncio.create_subprocess_exec(*args,
stdout=PIPE)
# read line (sequence of bytes ending with b'\n') asynchronously
mozrepl_found=False
while True:
try:
line = await asyncio.wait_for(process.stdout.readline(), timeout)
except asyncio.TimeoutError:
if mozrepl_found:
pass
else:
print("Mozrepl was not detected in time (time-out)!\nDid you install and enable Mozrepl plugin in Firefox? (Install: https://addons.mozilla.org/nl/firefox/addon/mozrepl/).\n\nTry again.")
try:
process.kill()
await process.wait()
except ProcessLookupError:
pass
return_code=1
break
else:
if not line: # EOF
# Firefox is closed.
try:
process.kill()
await process.wait()
print("You closed Firefox. That was not the idea...")
return_code=1
break
except ProcessLookupError:
print("Firefox process has already started earlier, be sure you enable Mozrepl. Waiting " + str(TIMEOUT_TO_ACTIVATE_PLUGIN) + " seconds before I try to connect to mozrepl...")
sleep(TIMEOUT_TO_ACTIVATE_PLUGIN)
break
elif process_line(line):
# mozrepl is loaded/found!
mozrepl_found=True
break
else:
# Required line not found
continue
return return_code
def startFirefox():
"""
Start Firefox process with our own HTML page
return status - 0 is OK 1 is NOK
"""
if sys.platform == "win32":
loop = asyncio.ProactorEventLoop() # for subprocess' pipes on Windows
asyncio.set_event_loop(loop)
else:
loop = asyncio.get_event_loop()
status = loop.run_until_complete(
run_command("firefox", "site/index.html", timeout=180))
if status:
loop.close()
return status
This diff is collapsed.
/*!
* Start Bootstrap - New Age v4.0.0-alpha (http://startbootstrap.com/template-overviews/new-age)
* Copyright 2013-2017 Start Bootstrap
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-new-age/blob/master/LICENSE)
*/body,html{width:100%;height:100%}body{font-family:Muli,Helvetica,Arial,sans-serif}a{color:#fdcc52;-webkit-transition:all .35s;-moz-transition:all .35s;transition:all .35s}a:focus,a:hover{color:#fcbd20}hr{max-width:100px;margin:25px auto 0;border-width:1px;border-color:rgba(34,34,34,.1)}hr.light{border-color:#fff}h1,h2,h3,h4,h5,h6{font-family:Catamaran,Helvetica,Arial,sans-serif;font-weight:200;letter-spacing:1px}p{font-size:18px;line-height:1.5;margin-bottom:20px}section{padding:100px 0}section h2{font-size:50px}::-moz-selection{color:#fff;background:#222;text-shadow:none}::selection{color:#fff;background:#222;text-shadow:none}img::selection{color:#fff;background:0 0}img::-moz-selection{color:#fff;background:0 0}body{-webkit-tap-highlight-color:#222}#mainNav{border-color:rgba(34,34,34,.05);background-color:#fff;-webkit-transition:all .35s;-moz-transition:all .35s;transition:all .35s;font-family:Catamaran,Helvetica,Arial,sans-serif;font-weight:200;letter-spacing:1px}#mainNav .navbar-brand{color:#fdcc52;font-family:Catamaran,Helvetica,Arial,sans-serif;font-weight:200;letter-spacing:1px}#mainNav .navbar-brand:focus,#mainNav .navbar-brand:hover{color:#fcbd20}#mainNav .navbar-toggler{font-size:12px;padding:8px 10px;color:#222}#mainNav .navbar-nav>li>a{font-size:11px;font-family:Lato,Helvetica,Arial,sans-serif;letter-spacing:2px;text-transform:uppercase}#mainNav .navbar-nav>li>a.active{color:#fdcc52!important;background-color:transparent}#mainNav .navbar-nav>li>a.active:hover{background-color:transparent}#mainNav .navbar-nav>li>a,#mainNav .navbar-nav>li>a:focus{color:#222}#mainNav .navbar-nav>li>a:focus:hover,#mainNav .navbar-nav>li>a:hover{color:#fdcc52}@media (min-width:992px){#mainNav{border-color:transparent;background-color:transparent}#mainNav .navbar-brand{color:fade(white,70%)}#mainNav .navbar-brand:focus,#mainNav .navbar-brand:hover{color:#fff}#mainNav .navbar-nav>li>a,#mainNav .navbar-nav>li>a:focus{color:rgba(255,255,255,.7)}#mainNav .navbar-nav>li>a:focus:hover,#mainNav .navbar-nav>li>a:hover{color:#fff}#mainNav.navbar-shrink{border-color:rgba(34,34,34,.1);background-color:#fff}#mainNav.navbar-shrink .navbar-brand{color:#222}#mainNav.navbar-shrink .navbar-brand:focus,#mainNav.navbar-shrink .navbar-brand:hover{color:#fdcc52}#mainNav.navbar-shrink .navbar-nav>li>a,#mainNav.navbar-shrink .navbar-nav>li>a:focus{color:#222}#mainNav.navbar-shrink .navbar-nav>li>a:focus:hover,#mainNav.navbar-shrink .navbar-nav>li>a:hover{color:#fdcc52}}header.masthead{position:relative;overflow-y:hidden;width:100%;min-height:auto;color:#fff;background:url(../img/bg-pattern.png),#7b4397;background:url(../img/bg-pattern.png),-webkit-linear-gradient(to left,#7b4397,#dc2430);background:url(../img/bg-pattern.png),linear-gradient(to left,#7b4397,#dc2430)}header.masthead .header-content{position:relative;padding:150px 0 50px;text-align:center}header.masthead .header-content .header-content-inner{position:relative;max-width:500px;margin:0 auto}header.masthead .header-content .header-content-inner h1{font-size:30px;margin-top:0;margin-bottom:30px}header.masthead .header-content .header-content-inner .list-badges{margin-bottom:25px}header.masthead .header-content .header-content-inner .list-badges img{height:50px;margin-bottom:25px}header.masthead .device-container{max-width:300px;margin:0 auto 100px}header.masthead .device-container .screen img{border-radius:3px}@media (min-width:768px){header.masthead{min-height:100%}header.masthead .header-content{height:100vh;min-height:600px;padding:0;text-align:left}header.masthead .header-content .header-content-inner{position:absolute;top:50%;max-width:none;margin:0;transform:translateY(-50%)}header.masthead .header-content .header-content-inner h1{font-size:35px}header.masthead .device-container{max-width:none;max-height:calc(100vh - 100px);margin:100px auto 0}}@media (min-width:992px){header.masthead .header-content .header-content-inner h1{font-size:50px}}section.download{position:relative;padding:150px 0}section.download h2{font-size:50px;margin-top:0}section.download .badges .badge-link{display:block;margin-bottom:25px}section.download .badges .badge-link:last-child{margin-bottom:0}section.download .badges .badge-link img{height:60px}@media (min-width:768px){section.download .badges .badge-link{display:inline-block;margin-bottom:0}}@media (min-width:768px){section.download h2{font-size:70px}}section.features .section-heading{margin-bottom:100px}section.features .section-heading h2{margin-top:0}section.features .section-heading p{margin-bottom:0}section.features .device-container,section.features .feature-item{max-width:300px;margin:0 auto}section.features .device-container{margin-bottom:100px}@media (min-width:992px){section.features .device-container{margin-bottom:0}}section.features .feature-item{margin-bottom:100px;text-align:center}section.features .feature-item h3{font-size:30px}section.features .feature-item i{font-size:80px;background:-webkit-linear-gradient(to left,#7b4397,#dc2430);background:linear-gradient(to left,#7b4397,#dc2430);-webkit-background-clip:text;-webkit-text-fill-color:transparent}@media (min-width:992px){section.features .device-container,section.features .feature-item{max-width:none}}section.cta{position:relative;padding:250px 0;background-image:url(../img/bg-cta.jpg);background-position:center;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover}section.cta .cta-content{position:relative;z-index:1}section.cta .cta-content h2{font-size:50px;max-width:450px;margin-top:0;margin-bottom:25px;color:#fff}@media (min-width:768px){section.cta .cta-content h2{font-size:80px}}section.cta .overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.5)}section.contact{text-align:center}section.contact h2{margin-top:0;margin-bottom:25px}section.contact h2 i{color:#dd4b39}section.contact ul.list-social{margin-bottom:0}section.contact ul.list-social li a{font-size:40px;line-height:80px;display:block;width:80px;height:80px;color:#fff;border-radius:100%}section.contact ul.list-social li.social-twitter a{background-color:#1da1f2}section.contact ul.list-social li.social-twitter a:hover{background-color:#0d95e8}section.contact ul.list-social li.social-facebook a{background-color:#3b5998}section.contact ul.list-social li.social-facebook a:hover{background-color:#344e86}section.contact ul.list-social li.social-google-plus a{background-color:#dd4b39}section.contact ul.list-social li.social-google-plus a:hover{background-color:#d73925}footer{padding:25px 0;text-align:center;color:rgba(255,255,255,.3);background-color:#222}footer p{font-size:12px;margin:0}footer ul{margin-bottom:0}footer ul li a{font-size:12px;color:rgba(255,255,255,.3)}footer ul li a.active,footer ul li a:active,footer ul li a:focus,footer ul li a:hover{text-decoration:none}.bg-primary{background:#fdcc52;background:-webkit-linear-gradient(#fdcc52,#fdc539);background:linear-gradient(#fdcc52,#fdc539)}.text-primary{color:#fdcc52}.no-gutter>[class*=col-]{padding-right:0;padding-left:0}.btn-outline{color:#fff;border:1px solid;border-color:#fff}.btn-outline.active,.btn-outline:active,.btn-outline:focus,.btn-outline:hover{color:#fff;border-color:#fdcc52;background-color:#fdcc52}.btn{border-radius:300px;font-family:Lato,Helvetica,Arial,sans-serif;letter-spacing:2px;text-transform:uppercase}.btn-xl{font-size:11px;padding:15px 45px}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Marktplaats Batch">
<meta name="author" content="Melroy van den Berg">
<title>Marktplaats Batch</title>
<!-- Bootstrap core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom fonts for this template -->
<link rel="stylesheet" href="vendor/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="vendor/simple-line-icons/css/simple-line-icons.css">
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Muli" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/new-age.min.css" rel="stylesheet">
<!-- Temporary navbar container fix -->
<style>
.navbar-toggler {
z-index: 1;
}
@media (max-width: 576px) {
nav > .container {
width: 100%;
}
}
</style>
</head>
<body id="page-top">
<!-- Navigation -->
<nav class="navbar fixed-top navbar-toggleable-md navbar-light" id="mainNav">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarExample" aria-controls="navbarExample" aria-expanded="false" aria-label="Toggle navigation">
Menu <i class="fa fa-bars"></i>
</button>
<div class="container">
<a class="navbar-brand" href="#page-top">MarktplaatsBatch</a>
<!--<div class="collapse navbar-collapse" id="navbarExample">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#a">a</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#b">b</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#c">c</a>
</li>
</ul>
</div>-->
</div>
</nav>
<header class="masthead">
<div class="container">
<div class="row">
<div class="col-sm-8">
<div class="header-content">
<div class="header-content-inner">
<h1>Marktplaats Batch</h1>
<p>Bedankt dat u heeft gekozen voor Marktplaats Batch door Melroy van den Berg.</p>
<div class="alert alert-danger" role="alert">
<strong>Let-op!</strong> Dit programma vereist een plugin in Firefox die niet <b>geïnstalleerd</b> blijkt te zijn<br/><i>OF</i><br/> nog niet <b>geactiveerd</b> is.<br/>
<br/>Activeer/start de Mozrepl plugin, of download deze eerst.
</div>
<a href="#download" class="btn btn-outline btn-xl page-scroll">Download Plugin</a>
</div>
</div>
</div>
<div class="col-sm-4">
</div>
</div>
</div>
</header>
<section class="download bg-primary text-center" id="download">
<div class="container">
<div class="row">
<div class="col-md-8 offset-md-2">
<h2 class="section-heading">Download Mozrepl Firefox Plugin</h2>
<p>Deze plugin is gewoon gratis te downloaden. Klik op de download icoon:</p>
<h2><a href="https://addons.mozilla.org/nl/firefox/addon/mozrepl/" target="_black" style="color: #000"><i class="fa fa-download"></i></a></h2>
</div>
</div>
</div>
</section>
<section class="features" id="features">
<div class="container">
<div class="section-heading text-center">
<h2>Geen handmatige acties meer</h2>
<p class="text-muted">Marktplaats Batch die doet alles voor jou!</p>
<hr>
</div>
<div class="row">
<div class="col-lg-8">
<div class="container-fluid">
<div class="row">
<div class="col-lg-6">
<div class="feature-item">
<i class="icon-options text-primary"></i>
<h3>Batch</h3>
<p class="text-muted">Importeer grote hoeveelheden advertensies in 1x!</p>
</div>
</div>
<div class="col-lg-6">
<div class="feature-item">
<i class="icon-note text-primary"></i>
<h3>CSV formaat</h3>
<p class="text-muted">Gebruik gewoon Excel voor het invullen van uw advertensies en eventueel herplaatsen.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="feature-item">
<i class="icon-clock text-primary"></i>
<h3>Geen kopie/plak</h3>
<p class="text-muted">Het plaatsen gebeurd automatisch, niks meer typen, kopiëren en plakken. Herplaatsen gaat dan ook vanzelf, zolang het maar in Excel staat. Dit bespaart u veel tijd en moeite.</p>
</div>
</div>
<div class="col-lg-6">
<div class="feature-item">
<i class="icon-lock-open text-primary"></i>
<h3>Gratis</h3>
<p class="text-muted">De code is <a href="https://gitlab.melroy.org/melroy/marktplaats-batch">open-source</a> en gratis te gebruiken.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!--<section class="cta">
<div class="cta-content">
<div class="container">
<h2>Stop waiting.<br>Start building.</h2>
<a href="#contact" class="btn btn-outline btn-xl">Let's Get Started!</a>
</div>
</div>
<div class="overlay"></div>
</section>
<section class="contact bg-primary" id="contact">
<div class="container">
<h2>We <i class="fa fa-heart"></i> new friends!</h2>
<ul class="list-inline list-social">
<li class="list-inline-item social-twitter">
<a href="#"><i class="fa fa-twitter"></i></a>
</li>
<li class="list-inline-item social-facebook">
<a href="#"><i class="fa fa-facebook"></i></a>
</li>
<li class="list-inline-item social-google-plus">
<a href="#"><i class="fa fa-google-plus"></i></a>
</li>
</ul>
</div>
</section>-->
<footer>
<div class="container">
<p>&copy; Copyright 2017 <a href="http://melroy.org">Melroy van den Berg</a>. All Rights Reserved.</p>
</div>
</footer>
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/tether/tether.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!-- Plugin JavaScript -->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom scripts for this template -->
<script src="js/new-age.min.js"></script>
</body>
</html>
(function($) {
"use strict"; // Start of use strict
// Smooth scrolling using jQuery easing
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html, body').animate({
scrollTop: (target.offset().top - 48)
}, 1000, "easeInOutExpo");
return false;
}
}
});
// Activate scrollspy to add active class to navbar items on scroll
$('body').scrollspy({
target: '#mainNav',
offset: 54
});
// Closes responsive menu when a link is clicked
$('.navbar-collapse>ul>li>a').click(function() {
$('.navbar-collapse').collapse('hide');
});
// Collapse the navbar when page is scrolled
$(window).scroll(function() {
if ($("#mainNav").offset().top > 100) {
$("#mainNav").addClass("navbar-shrink");
} else {
$("#mainNav").removeClass("navbar-shrink");
}
});
})(jQuery); // End of use strict
/*!
* Start Bootstrap - New Age v4.0.0-alpha (http://startbootstrap.com/template-overviews/new-age)
* Copyright 2013-2017 Start Bootstrap
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-new-age/blob/master/LICENSE)
*/
!function(a){"use strict";a('a[href*="#"]:not([href="#"])').click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var n=a(this.hash);if(n=n.length?n:a("[name="+this.hash.slice(1)+"]"),n.length)return a("html, body").animate({scrollTop:n.offset().top-48},1e3,"easeInOutExpo"),!1}}),a("body").scrollspy({target:"#mainNav",offset:54}),a(".navbar-collapse>ul>li>a").click(function(){a(".navbar-collapse").collapse("hide")}),a(window).scroll(function(){a("#mainNav").offset().top>100?a("#mainNav").addClass("navbar-shrink"):a("#mainNav").removeClass("navbar-shrink")})}(jQuery);
\ No newline at end of file
// Bootstrap overrides for this template
.bg-primary {
background: $theme-primary;
background: -webkit-linear-gradient($theme-primary, darken($theme-primary, 5%));
background: linear-gradient($theme-primary, darken($theme-primary, 5%));
}
.text-primary {
color: $theme-primary;
}
.no-gutter > [class*='col-'] {
padding-right: 0;
padding-left: 0;
}
.btn-outline {
color: white;
border: 1px solid;
border-color: white;
&:hover,
&:focus,
&:active,
&.active {
color: white;
border-color: $theme-primary;
background-color: $theme-primary;
}
}
.btn {
border-radius: 300px;
@include alt-font;
}
.btn-xl {
font-size: 11px;
padding: 15px 45px;
}
// Styling for the download section
section.contact {
text-align: center;
h2 {
margin-top: 0;
margin-bottom: 25px;
i {
color: $brand-google-plus;
}
}
ul.list-social {
margin-bottom: 0;
li {
a {
font-size: 40px;
line-height: 80px;
display: block;
width: 80px;
height: 80px;
color: white;
border-radius: 100%;
}
&.social-twitter {
a {
background-color: $brand-twitter;
&:hover {
background-color: darken($brand-twitter, 5%);
}
}
}
&.social-facebook {
a {
background-color: $brand-facebook;
&:hover {
background-color: darken($brand-facebook, 5%);
}
}
}
&.social-google-plus {
a {
background-color: $brand-google-plus;
&:hover {
background-color: darken($brand-google-plus, 5%);
}
}
}
}
}
}
// Styling for the call to action section
section.cta {
position: relative;
padding: 250px 0;
background-image: url('../img/bg-cta.jpg');
background-position: center;
@include background-cover;
.cta-content {
position: relative;
z-index: 1;
h2 {
font-size: 50px;
max-width: 450px;
margin-top: 0;
margin-bottom: 25px;
color: white;
}
@media (min-width: 768px) {
h2 {
font-size: 80px;
}
}
}
.overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: fade-out(black, .5);
}
}
// Styling for the download section
section.download {
position: relative;
padding: 150px 0;
h2 {
font-size: 50px;
margin-top: 0;
}
.badges {
.badge-link {
display: block;
margin-bottom: 25px;
&:last-child {
margin-bottom: 0;
}
img {
height: 60px;
}
@media(min-width: 768px) {
display: inline-block;
margin-bottom: 0;
}
}
}