Skip to content

Commit

Permalink
First commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
50shadesgen committed Nov 14, 2015
0 parents commit 649286f
Show file tree
Hide file tree
Showing 17 changed files with 1,101 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
@@ -0,0 +1,9 @@
node_modules
bower_components
.sass-cache

dist/*
!dist/.gitkeep

build/*
!build/.gitkeep
16 changes: 16 additions & 0 deletions README.md
@@ -0,0 +1,16 @@
# Fifty Shades Generator
The Fifty Shades Generator is a breakthrough in erotic fiction. At the click of a button, it generates world-class literature based on a pre-defined vocabulary.

To be honest, if you're here, you're probably looking for the vocabulary. It's here `/src/js/vocabulary.js`

## Requirements
* Bower
* Grunt
* SASS

## Installation
1. `npm install`
2. `bower install`
3. `grunt`

If nothing goes wrong, a heavily optimised index.html will be in the `build` folder, with some other bits. This is what you see on [fiftyshadesgenerator.com](http://www.fiftyshadesgenerator.com). If you wish to develop, a `grunt watch` command is also available.
8 changes: 8 additions & 0 deletions bower.json
@@ -0,0 +1,8 @@
{
"name": "Fifty Shades Generator",
"version": "2.0.0",
"dependencies": {
"bootstrap-sass": "~3.3.3",
"github-fork-ribbon-css": "~0.1.1"
}
}
Empty file added build/.gitkeep
Empty file.
163 changes: 163 additions & 0 deletions gruntfile.js
@@ -0,0 +1,163 @@
module.exports = function(grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

watch: {
scripts: {
files: ['gruntfile.js', 'src/index.html', 'src/scss/*.scss', 'src/js/*.js'],
tasks: ['clean:start', 'jshint', 'sass:build','concat:github', 'concat:build', 'copy:build'],
options: {
spawn: false,
},
},
},

clean: {
start: ['build/*'],
finish: ['build/styles.css', 'build/scripts.js']
},
jshint: {
all: ['gruntfile.js', 'src/js/*.js']
},
sass: {
build: {
files: {
'build/styles.css': 'src/scss/main.scss'
}
},
dist: {
options: {
sourcemap: 'none'
},
files: {
'build/styles.css': 'src/scss/main.scss'
}
},
},
concat: {
build: {
src: [
'src/js/vocabulary.js',
'src/js/sentences.js',
'src/js/generator.js',
'src/js/events.js',
'src/js/ga.js'
],
dest: 'build/scripts.js'
},
github: {
src: [
'build/styles.css',
'bower_components/github-fork-ribbon-css/gh-fork-ribbon.css'
],
dest: 'build/styles.css'
},
dist: {
src: [
'build/styles.css',
'bower_components/github-fork-ribbon-css/gh-fork-ribbon.css'
],
dest: 'build/styles.css'
},
},
copy: {
build: {
files: [{
expand: true,
cwd: 'src',
src: 'index.html',
dest: 'build/'
}]
},
dist: {
files: [{
expand: true,
cwd: 'src',
src: [
'index.html',
'error.html',
'favicon.ico',
'site_image.png'
],
dest: 'build/'
}]
}
},
uglify: {
dist: {
files: {
'build/scripts.js': [
'src/js/vocabulary.js',
'src/js/sentences.js',
'src/js/generator.js',
'src/js/events.js',
'src/js/ga.js'
]
}
}
},
cssmin: {
dist: {
files: {
'build/styles.css': 'build/styles.css'
}
}
},
uncss: {
dist: {
files: {
'build/styles.css': ['build/index.html']
}
}
},
inline: {
dist: {
options:{
tag: ''
},
src: 'build/index.html',
dest: 'build/index.html'
}
},
htmlmin: {
dist: {
options: {
removeComments: true,
collapseWhitespace: true
},
files: {
'build/index.html': 'build/index.html'
}
}
}

});

grunt.loadNpmTasks('grunt-inline');
grunt.loadNpmTasks('grunt-uncss');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');

grunt.registerTask('default', [
'clean:start',
'jshint',
'sass:dist',
'copy:dist',
'concat:dist',
'uglify:dist',
'uncss:dist',
'cssmin:dist',
'inline:dist',
'htmlmin:dist',
'clean:finish'
]);

};
17 changes: 17 additions & 0 deletions package.json
@@ -0,0 +1,17 @@
{
"name": "FiftyShadesGenerator",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-clean": "~0.6.0",
"grunt-contrib-sass": "~0.9.2",
"grunt-contrib-copy": "~0.7.0",
"grunt-contrib-uglify": "~0.7.0",
"grunt-inline": "~0.3.4",
"grunt-uncss": "~0.4.0",
"grunt-contrib-concat": "~0.5.0",
"grunt-contrib-cssmin": "~0.12.1",
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-htmlmin": "~0.4.0",
"grunt-contrib-jshint": "~0.11.0"
}
}
7 changes: 7 additions & 0 deletions src/error.html
@@ -0,0 +1,7 @@
<html>
<head>
<title>FiftyShadesGenerator.com</title>
<body>
Oops! An error occured.
</body>
</html>
Binary file added src/favicon.ico
Binary file not shown.
86 changes: 86 additions & 0 deletions src/index.html
@@ -0,0 +1,86 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Fifty Shades Generator | Terrible erotic fiction at the click of a button</title>
<link rel="stylesheet" href="styles.css">
<!--[if lt IE 9]>
<style>.github-fork-ribbon-wrapper { display: none }</style>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script><script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="github-fork-ribbon-wrapper right">
<div class="github-fork-ribbon">
<a href="https://github.com/50shadesgen/50shadesgen">Pork me on GitHub</a>
</div>
</div>

<header>
<h1>Fifty Shades<br> <span class="grey">Generator</span></h1>
</header>

<div class="clearfix"></div>

<main>
<article>
<div class="row">
<div class="col-sm-offset-1 col-sm-10">
<blockquote>
<span class="quotation-mark">&ldquo;</span>
<span id="text">Generating filth&hellip;</span>
<div class="quotation-mark text-right">&rdquo;</div>
</blockquote>
<div class="clearfix"></div>
<div class="visible-print-block">
<p>See more at http://www.fiftyshadesgenerator.com</p>
</div>
<div class="text-center">
<button id="generate-button" class="btn btn-primary hidden-print">Generate more</button>
</div>
</div>
</div>
</article>

<div class="row hidden-print">
<div class="col-sm-8">
<section>
<h2>What is this?</h2>
<p>The Fifty Shades Generator is a breakthrough in erotic fiction. At the click of a button, it generates world-class literature based on a pre-defined vocabulary.</p>
<p>Traditionally, print and web designers had to make use of placeholder text known as Lorem Ipsum. It consists of meaningless Latin, though recently there have been great developments in the field such as <a href="http://baconipsum.com/">Bacon Ipsum</a>, <a href="http://hipsteripsum.me/">Hipster Ipsum</a> and <a href="http://slipsum.com/">Samuel L Ipsum</a>. Now, creatives can excite clients in more ways than one with Fifty Shades of Grey-inspired filler text.</p>
<p>Fledgling authors! Spice up your otherwise lacklustre novel with graphic sex scenes guaranteed to get your readers hot under the collar, and slightly sick in their mouths. If you end up winning a big literary award, we'll split the prize money 50/50, yeah? Wire transfer is fine.</p>
</section>

<section>
<h2>Acknowledgements</h2>
<p>You can probably imagine what kind of language is thrown around an all-male office of web designers but even that wasn't enough for this site. We had to scoured the Web looking for even smuttier terms to enrich the Fifty Shades Generator. The real goldmine was <a href="http://twitter.com/50shadesofshit">@50shadesofshit</a> which had us chortling like loonies with every new tweet. A hilarious thread on <a href="http://www.arrse.co.uk/">ARRSE</a> (british ARmy Rumour SErvice) was a source of many of the similes we use. <a href="http://www.thestudentroom.co.uk/">The Student Room</a> and <a href="http://uk.answers.yahoo.com/">Yahoo Answers</a> also seem to have a healthy number of dirty-minded scholars.</p>
</section>
</div>

<div class="col-sm-4">
<aside>
<h2>Share</h2>
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.fiftyshadesgenerator.com&amp;send=false&amp;layout=standard&amp;width=220&amp;show_faces=false&amp;action=like&amp;colorscheme=dark&amp;font&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:220px; height:40px;" allowTransparency="true"></iframe>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.fiftyshadesgenerator.com" data-text="Hilariously filthy erotic fiction at the click of a button" data-via="50ShadesGen" data-size="large" data-related="50shadesgen" data-hashtags="filthyshades" data-dnt="true">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

<p>Tweet us your favourite euphemisms and similes; the more distasteful, the better! We'll retweet anything we add to the vocabulary.</p>

<a class="twitter-timeline" data-dnt="true" href="https://twitter.com/50ShadesGen" data-widget-id="366591308250378240" data-tweet-limit="3" data-chrome="nofooter transparent noscrollbar">Tweets by @50ShadesGen</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</aside>
</div>
</div>
</main>

<footer class="hidden-print">
<p class="text-muted">&copy; Timed Slimer Productions 2015 - Not affiliated with any authors, publishers or moviemakers.</p>
</footer>
</div>

<script type="text/javascript" src="scripts.js"></script>
</body>
</html>
31 changes: 31 additions & 0 deletions src/js/events.js
@@ -0,0 +1,31 @@
// Listen for a ready DOM.
if (document.readyState != 'loading'){
init();
} else if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', init());
} else {
document.attachEvent('onreadystatechange', function () {
if (document.readyState != 'loading')
init();
});
}

// Update the text and register a generate button click listener.
function init() {
update_text();

// Listen for generate button clicks.
var button = document.getElementById('generate-button');

if (button.addEventListener) {
button.addEventListener('click', function () {
update_text();
return false;
});
} else {
button.attachEvent('onclick', function () {
update_text();
return false;
});
}
}
9 changes: 9 additions & 0 deletions src/js/ga.js
@@ -0,0 +1,9 @@
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33661234-1']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

0 comments on commit 649286f

Please sign in to comment.