Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Commit

Permalink
Added basic splash screen
Browse files Browse the repository at this point in the history
  • Loading branch information
kittsville committed Dec 21, 2016
1 parent 462e188 commit 55ee287
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 3 deletions.
20 changes: 20 additions & 0 deletions docs/_includes/splash.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#splash {
background: #FFF;
color: #000;
width: 100%;
height: 100%;
z-index: 20;
top: 0;
left: 0;
position: fixed;
font-family: Arial, Helvetica, sans-serif;
text-align: center;

* {
clear: both;
}

img {
margin: 10% auto 0px auto;
}
}
File renamed without changes
Binary file added docs/assets/images/splash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 20 additions & 1 deletion docs/assets/scripts/scripts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
var progress = {
stage : 0,
stages : document.getElementById('progress').getElementsByTagName('p'),
increment : function() {
progress.stages[progress.stage].hidden = true;
progress.stage++;
if (progress.stages[progress.stage] !== undefined) {
progress.stages[progress.stage].hidden = false;
}
}
}

progress.increment();

$.getJSON("/graph.json", function(json) {
progress.increment();

cy = cytoscape({

container: document.getElementById('graph'),
Expand All @@ -22,6 +38,8 @@ $.getJSON("/graph.json", function(json) {
]
});

progress.increment();

cy.on('tap', 'node', function(event) {
window.open(this.data('url'));
});
Expand All @@ -38,5 +56,6 @@ $.getJSON("/graph.json", function(json) {
}
}

document.getElementById('wrap').removeChild(document.getElementById('loading'));
delete progress;
document.getElementById('wrap').removeChild(document.getElementById('splash'));
});
19 changes: 17 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
title: Pyroon
description: Pyroon is an interactive visualisation of Reddit's switch-a-roos. View the links across subreddits dating back years.
---
{% assign site_image = site.url | append: '/assets/og-image.jpg' %}
{% assign site_image = site.url | append: '/assets/images/og-image.jpg' %}
{% assign scripts_url = site.url | append: '/assets/scripts' %}
{% capture splash_styles %}
{% include splash.scss %}
{% endcapture %}
<html>
<head>
<link rel="dns-prefetch" href="//sci1.uk">
Expand Down Expand Up @@ -40,13 +43,25 @@
<link rel="canonical" href="{{ site.url }}" />

<link rel="stylesheet" href="{{ site.url }}/assets/styles.css" type="text/css">

<style>
{{ splash_styles | scssify }}
</style>
</head>
<body>
<a id="fork-me" href="https://github.com/kittsville/Pyroon">
<img src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png">
</a>
<div id="wrap">
<p id="loading">Loading. This will probably cause your browser to freeze</p>
<div id="splash">
<img alt="Loading..." src="{{ site.url }}/assets/images/splash.jpg">
<div id="progress">
<p>Loading Assets</p>
<p hidden>Loading Roos</p>
<p hidden>Rendering Roos (Your browser might briefly freeze)</p>
<p hidden>Finishing Up</p>
</div>
</div>
<div id="graph"></div>
</div>
<div>
Expand Down

0 comments on commit 55ee287

Please sign in to comment.