Compare commits

...

10 Commits

Author SHA1 Message Date
79225b5133 Update website 2016-04-25 22:15:23 +02:00
Patrick Schönfeld
cbf1da2413 Add 'Dream' as subgenre 2014-09-27 14:19:06 +02:00
Maximilian Gaß
d261ca6cc8 Remove CNAME 2012-07-01 16:29:33 +02:00
Maximilian Gaß
7b6c4bed82 Add missing var statements 2012-03-26 22:10:13 +02:00
Maximilian Gaß
52660fb962 Add CNAME file for GitHub Pages 2012-03-22 20:29:36 +01:00
Maximilian Gaß
b9cc313471 Port to JavaScript
CoffeeScript is not worth the extra hassle for such a simple piece of
software
2012-03-22 20:26:32 +01:00
Maximilian Gaß
5ca92c6914 Tweak design, new font 2011-11-10 21:55:56 +01:00
Maximilian Gaß
f60d547ea0 Rewrite in CoffeeScript 2011-10-09 20:20:58 +02:00
Maximilian Gaß
ee39c1daee fix github link 2011-09-20 20:57:20 +02:00
Maximilian Gaß
7584406952 ghosthacking.net -> mxey.net 2011-09-20 20:57:12 +02:00
4 changed files with 263 additions and 285 deletions

200
genregen.js Normal file
View File

@ -0,0 +1,200 @@
var genres = [
'Aggrotech',
'Ambient',
'Beat',
'Bluegrass',
'Blues',
'Chiptune',
'Core',
'Country',
'Cumbia',
'Dance',
'Dancehall',
'Drum and Bass',
'Dub',
'Dubstep',
'EBM',
'Flamenco',
'Grunge',
'Goa',
'Gospel',
'Hardstyle',
'Hip-hop',
'House',
'Humppa',
'Industrial',
'Jazz',
'Metal',
'Oi!',
'Polka',
'Pop',
'Punk',
'Rap',
'Rave',
'Reggae',
'Rockabilly',
'Samba',
'Schranz',
'Ska',
'Soul',
'Techhouse',
'Techno',
'Tekkno',
'Trance',
'Triphop',
'Twostep',
'Western',
];
var subgenres = [
'30s',
'40s',
'50s',
'60s',
'70s',
'80s',
'Acid',
'Alternative',
'Ambient',
'Anatolian',
'Arena',
'Art',
'Australian',
'Australian',
'Avantgarde',
'Balearic',
'Balkan',
'Battle',
'Black',
'Body',
'Bossa nova',
'Brit',
'Celtic',
'Chinese',
'Christian',
'Comedy',
'Conscious',
'Cow',
'Crust',
'Dark',
'Death',
'Dirty',
'Doom',
'Drone',
'Dream',
'East Coast',
'Electroclash',
'Electronic',
'Emo',
'Euro',
'Experimental',
'Extreme',
'Flower',
'Folk',
'Free',
'Freestyle',
'Fucking',
'Fun',
'Funk',
'Fusion',
'Future',
'Gangsta',
'Garage',
'Ghetto',
'Glam',
'Gospel',
'Gothic',
'Grind',
'Groove',
'Happy',
'Hard',
'Hardcore',
'Harmonica',
'Handsup',
'Heavy',
'Horror',
'Indian',
'Indie',
'Independent',
'Industrial',
'Instrumental',
'Latin',
'Lounge',
'Mainstream',
'Medieval',
'Melodic',
'Minimal',
'Neo',
'New age',
'Ninja',
'Nintendo',
'Noise',
'Nu',
'Pagan',
'Pirate',
'Post',
'Power',
'Progressive',
'Psychedelic',
'Skate',
'Sludge',
'Southern',
'Space',
'Speed',
'Stoner',
'Street',
'Sunshine',
'Surf',
'Swedish',
'Swing',
'Symphonic',
'Synth',
'Teutonic',
'Traditional',
'Trash',
'Viking',
'Vocal',
'Wave',
'West Coast',
'World',
];
var cities = [
'Berlin',
'Bakersfield',
'Detroit',
'Frankfurt',
'Gothenburg',
'Ibiza',
'London',
'New Orleans',
'Rio',
'Rotterdam',
'San Francisco',
];
function rand_choose(array) {
return array[Math.floor(Math.random() * array.length)];
}
function chance(percent) {
return Math.floor(Math.random() * 100) < percent;
}
function generate_genre() {
var parts = [];
if (chance(20)) parts.push(rand_choose(cities));
if (chance(70)) parts.push(rand_choose(subgenres));
parts.push(rand_choose(subgenres));
parts.push(rand_choose(genres));
var genre = parts.join(' ');
$('#genre a').text(genre);
return $('title').text('Listen to ' + genre);
}
$(document).ready(function() {
$('#genre a').click(generate_genre);
generate_genre();
});

285
gg.pl
View File

@ -1,285 +0,0 @@
#!/usr/bin/env perl
use Mojolicious::Lite;
use Data::Random qw(rand_enum);
my @genres = (
'Aggrotech',
'Ambient',
'Beat',
'Bluegrass',
'Blues',
'Chiptune',
'Core',
'Country',
'Cumbia',
'Dance',
'Dancehall',
'Drum and Bass',
'Dub',
'Dubstep',
'EBM',
'Flamenco',
'Grunge',
'Goa',
'Gospel',
'Hardstyle',
'Hip-hop',
'House',
'Humppa',
'Industrial',
'Jazz',
'Metal',
'Oi!',
'Polka',
'Pop',
'Punk',
'Rap',
'Rave',
'Reggae',
'Rockabilly',
'Samba',
'Schranz',
'Ska',
'Soul',
'Techhouse',
'Techno',
'Tekkno',
'Trance',
'Triphop',
'Twostep',
'Western',
);
my @subgenres = (
'30s',
'40s',
'50s',
'60s',
'70s',
'80s',
'Acid',
'Alternative',
'Ambient',
'Anatolian',
'Arena',
'Art',
'Australian',
'Australian',
'Avantgarde',
'Balearic',
'Balkan',
'Battle',
'Black',
'Body',
'Bossa nova',
'Brit',
'Celtic',
'Chinese',
'Christian',
'Comedy',
'Conscious',
'Cow',
'Crust',
'Dark',
'Death',
'Dirty',
'Doom',
'Drone',
'East Coast',
'Electroclash',
'Electronic',
'Emo',
'Euro',
'Experimental',
'Extreme',
'Flower',
'Folk',
'Free',
'Freestyle',
'Fucking',
'Fun',
'Funk',
'Fusion',
'Future',
'Gangsta',
'Garage',
'Ghetto',
'Glam',
'Gospel',
'Gothic',
'Grind',
'Groove',
'Happy',
'Hard',
'Hardcore',
'Harmonica',
'Handsup',
'Heavy',
'Horror',
'Indian',
'Indie',
'Independent',
'Industrial',
'Instrumental',
'Latin',
'Lounge',
'Mainstream',
'Medieval',
'Melodic',
'Minimal',
'Neo',
'New age',
'Ninja',
'Nintendo',
'Noise',
'Nu',
'Pagan',
'Pirate',
'Post',
'Power',
'Progressive',
'Psychedelic',
'Skate',
'Sludge',
'Southern',
'Space',
'Speed',
'Stoner',
'Street',
'Sunshine',
'Surf',
'Swedish',
'Swing',
'Symphonic',
'Synth',
'Teutonic',
'Traditional',
'Trash',
'Viking',
'Vocal',
'Wave',
'West Coast',
'World',
);
my @cities = (
'Berlin',
'Bakersfield',
'Detroit',
'Frankfurt',
'Gothenburg',
'Ibiza',
'London',
'New Orleans',
'Rio',
'Rotterdam',
'San Francisco',
);
sub chance {
my ($percent) = @_;
return int(rand 101) <= $percent;
}
sub generate {
my @genre;
push @genre, rand_enum(set => \@cities) if chance 10;
push @genre, rand_enum(set => \@subgenres) if chance 70;
push @genre, rand_enum(set => \@subgenres);
push @genre, rand_enum(set => \@genres);
return join ' ', @genre;
}
get '/' => sub {
my ($self) = @_;
$self->render('index', genre => generate());
};
get '/plain' => sub {
my ($self) = @_;
$self->render(text => generate());
};
app->start;
__DATA__
@@ index.html.ep
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>
Listen to <%= $genre %>
</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>
<body>
<div id="title"> Listen to </div>
<div id="genre"> <a href="/"><%= $genre %></a> </div>
<div id="twitter">
<a href="http://twitter.com/share" class="twitter-share-button"
data-text="I listen to <%= $genre %> data-count="horizontal">
Tweet
</a>
<script type="text/javascript"
src="http://platform.twitter.com/widgets.js"> </script>
<br />
</div>
<div id="impressum">
Created by
<a href="http://www.thehappy.de/~xeno/"> xeno </a>
and
<a href="http://ghosthacking.net"> mxey </a>
|
<a href="htts://github.com/mxey/genregenerator"> fork me on github </a>
</div>
</body>
</html>
@@ style.css
* {
margin: 0px;
padding: 0px;
}
body, html {
font-family: sans-serif;
text-align: center;
}
#title {
margin-top: 50px;
font-size: 50px;
}
#genre {
margin-top: 50px;
font-size: 50px;
font-weight: bold;
color: #666;
}
#twitter {
margin-top: 80px;
margin-left: 18px;
}
#impressum {
margin-top: 5px;
font-size: 10px;
color: #999;
}
a {
color: #666;
text-decoration: none;
}

26
index.html Normal file
View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<title> </title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link href='http://fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="style.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="genregen.js"></script>
</head>
<body>
<div id="title"> Listen to </div>
<div id="genre"> <a href="javascript:void(0)"></a> </div>
<div id="impressum">
Created by
<a href="http://stefanritter.net"> xeno </a>
and
<a href="http://mxey.net"> mxey </a>
|
<a href="https://github.com/mxey/genregenerator"> fork me on github </a>
</div>
</body>
</html>

37
style.css Normal file
View File

@ -0,0 +1,37 @@
* {
margin: 0px;
padding: 0px;
}
body, html {
font-family: 'PT Sans Narrow', sans-serif;
text-align: center;
}
#title {
margin-top: 50pt;
font-size: 40pt;
}
#genre {
margin-top: 40px;
font-size: 60pt;
font-weight: bold;
color: #666;
}
#twitter {
margin-top: 80px;
margin-left: 18px;
}
#impressum {
margin-top: 14pt;
font-size: 14pt;
color: #999;
}
a {
color: #666;
text-decoration: none;
}