diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Vagrantfile.example b/Vagrantfile.example index 52ffdf1096..a2a4f4b635 100644 --- a/Vagrantfile.example +++ b/Vagrantfile.example @@ -8,7 +8,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provider "virtualbox" do |v| v.memory = 768 v.cpus = 1 - v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"] end config.vm.box = "thepeopleseason/habitrpg" config.ssh.forward_agent = true @@ -16,5 +15,5 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.hostname = "habitrpg" config.vm.network "forwarded_port", guest: 3000, host: 3000, auto_correct: true config.vm.usable_port_range = (3000..3050) - config.vm.provision :shell, :path => "vagrant.sh" + config.vm.provision :shell, :path => "vagrant_scripts/vagrant.sh" end diff --git a/vagrant.sh b/vagrant.sh deleted file mode 100644 index ceb1e9ab38..0000000000 --- a/vagrant.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env bash -# -# Habitica provisioning script - -# function for autostart -function autostart_habitrpg { - update_config=$'Please update config.json with your values\nfor ADMIN_EMAIL, SMTP_USER, SMTP_PASS and SMTP_SERVICE,\nthen run "vagrant reload --provision"' - - # check if config.json exists, then check if the defaults are still in place - if [ -e config.json ]; - then - if grep -Fq 'ADMIN_EMAIL": "you@yours.com' config.json; - then - echo "$update_config"; - exit; - else - npm start - fi - else - cp config.json.example config.json; - echo "$update_config"; - exit; - fi -} - -# Main provisioning -echo Setting up Habitica... -echo cd /vagrant >> /home/vagrant/.bashrc -# Needed for running e2e tests -echo export DISPLAY=:99 >> /home/vagrant/.bashrc - -# Prevent warnings: "dpkg-preconfigure: unable to re-open stdin ..." -export DEBIAN_FRONTEND=noninteractive - -echo Updating repositories... -apt-get update -qq - -echo Installing Unix build tools - needed for node-gyp to use make... -apt-get install -qq build-essential - -echo Installing GraphicsMagick - provides gm and convert... -apt-get install -qq graphicsmagick - -echo Installing phantomjs and dependency... -apt-get install -qq libicu48 - -echo Installing requirements for grunt-spritesmith... -apt-get install -qq pkg-config libcairo2-dev libjpeg-dev - -# Import MongoDB public GPG key -# http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ -apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 - -# Create a list file for MongoDB -echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list - -echo Installing Mongodb... -apt-get update -apt-get install mongodb-10gen -apt-get install -y mongodb-org=2.6.4 mongodb-org-server=2.6.4 mongodb-org-shell=2.6.4 mongodb-org-mongos=2.6.4 mongodb-org-tools=2.6.4 - -echo Installing Git... -apt-get install -qq git - -echo Installing npm... -apt-get install -qq python-software-properties -echo Adding repository node.js... -apt-add-repository -y ppa:chris-lea/node.js -echo Updating repositories... -apt-get update -qq -echo Installing node.js -apt-get install -qq nodejs -echo Updating npm... -npm install -g npm -echo Installing Xvfb... -apt-get install -qq xvfb -echo Installing Java7... -apt-get install -qq openjdk-7-jre -echo Downloading Firefox... -wget http://sourceforge.net/projects/ubuntuzilla/files/mozilla/apt/pool/main/f/firefox-mozilla-build/firefox-mozilla-build_40.0.3-0ubuntu1_amd64.deb/download -O firefox.deb >/dev/null 2>&1 -echo Installing Firefox... -dpkg -i firefox.deb -rm firefox.deb - -cd /vagrant - -echo Installing gulp/bower... -npm install -g gulp grunt-cli bower - -echo Installing Habitica -npm install --no-bin-links - -echo Installing Bower packages -sudo -H -u vagrant bower --config.interactive=false install -f - -## # echo Seeding Mongodb... -## node ./src/seed.js -## no longer required - see comments in src/seed.js - -# Uncomment both lines to autostart the habitica server when provisioning -# echo Starting Habitica server... -# autostart_habitrpg - diff --git a/vagrant_scripts/install_gcc.sh b/vagrant_scripts/install_gcc.sh new file mode 100755 index 0000000000..1eba4372c7 --- /dev/null +++ b/vagrant_scripts/install_gcc.sh @@ -0,0 +1,13 @@ +echo Adding PPA repository for gcc... +add-apt-repository ppa:ubuntu-toolchain-r/test +apt-get update -qq + +echo Installing gcc 4.8... +apt-get install -qq gcc-4.8 g++-4.8 + +update-alternatives --remove-all gcc +update-alternatives --remove-all g++ +update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20 +update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20 +update-alternatives --config gcc +update-alternatives --config g++ diff --git a/vagrant_scripts/install_mongo.sh b/vagrant_scripts/install_mongo.sh new file mode 100755 index 0000000000..4b0e244c32 --- /dev/null +++ b/vagrant_scripts/install_mongo.sh @@ -0,0 +1,11 @@ +# Import MongoDB public GPG key +# http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 + +# Create a list file for MongoDB +echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list + +apt-get update +apt-get install mongodb-10gen +apt-get install -y mongodb-org=2.6.4 mongodb-org-server=2.6.4 mongodb-org-shell=2.6.4 mongodb-org-mongos=2.6.4 mongodb-org-tools=2.6.4 + diff --git a/vagrant_scripts/install_node.sh b/vagrant_scripts/install_node.sh new file mode 100755 index 0000000000..a420e7bdf1 --- /dev/null +++ b/vagrant_scripts/install_node.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +echo Installing nvm... +curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.1/install.sh | NVM_DIR="/home/vagrant/.nvm" PROFILE="/home/vagrant/.profile" bash +echo "source /home/vagrant/.nvm/nvm.sh" >> /home/vagrant/.profile +echo "nvm install" >> /home/vagrant/.profile + +chown -R vagrant:vagrant /home/vagrant/.nvm + +source /home/vagrant/.profile + +echo Setting up node... +cd /vagrant +nvm install +nvm use +nvm alias default current + +echo Update npm... +npm install -g npm@3 + +echo Installing global modules... +npm install -g gulp bower grunt-cli mocha diff --git a/vagrant_scripts/install_sprite_dependencies.sh b/vagrant_scripts/install_sprite_dependencies.sh new file mode 100755 index 0000000000..631a813c96 --- /dev/null +++ b/vagrant_scripts/install_sprite_dependencies.sh @@ -0,0 +1,8 @@ +echo Installing GraphicsMagick - provides gm and convert... +apt-get install -qq graphicsmagick + +echo Installing phantomjs and dependency... +apt-get install -qq libicu48 + +echo Installing requirements for grunt-spritesmith... +apt-get install -qq pkg-config libcairo2-dev libjpeg-dev diff --git a/vagrant_scripts/install_test_dependencies.sh b/vagrant_scripts/install_test_dependencies.sh new file mode 100755 index 0000000000..f722397d64 --- /dev/null +++ b/vagrant_scripts/install_test_dependencies.sh @@ -0,0 +1,9 @@ +echo Installing Xvfb... +apt-get install -qq xvfb +echo Installing Java7... +apt-get install -qq openjdk-7-jre +echo Downloading Firefox... +wget http://sourceforge.net/projects/ubuntuzilla/files/mozilla/apt/pool/main/f/firefox-mozilla-build/firefox-mozilla-build_40.0.3-0ubuntu1_amd64.deb/download -O firefox.deb >/dev/null 2>&1 +echo Installing Firefox... +dpkg -i firefox.deb +rm firefox.deb diff --git a/vagrant_scripts/vagrant.sh b/vagrant_scripts/vagrant.sh new file mode 100644 index 0000000000..a53b97bad4 --- /dev/null +++ b/vagrant_scripts/vagrant.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +# +# Habitica provisioning script + +# function for autostart +function autostart_habitrpg { + update_config=$'Please update config.json with your values\nfor ADMIN_EMAIL, SMTP_USER, SMTP_PASS and SMTP_SERVICE,\nthen run "vagrant reload --provision"' + + # check if config.json exists, then check if the defaults are still in place + if [ -e config.json ]; + then + if grep -Fq 'ADMIN_EMAIL": "you@yours.com' config.json; + then + echo "$update_config"; + exit; + else + npm start + fi + else + cp config.json.example config.json; + echo "$update_config"; + exit; + fi +} + +# Main provisioning +echo Setting up Habitica... +echo cd /vagrant >> /home/vagrant/.bashrc +# Needed for running e2e tests +echo export DISPLAY=:99 >> /home/vagrant/.bashrc + +# Prevent warnings: "dpkg-preconfigure: unable to re-open stdin ..." +export DEBIAN_FRONTEND=noninteractive + +echo Updating repositories... +apt-get update -qq + +echo Installing Unix build tools - needed for node-gyp to use make... +apt-get install -qq build-essential + +echo Installing python sofrware properties... +apt-get install -qq python-software-properties + +echo Installing sprite dependencies... +/vagrant/vagrant_scripts/install_sprite_dependencies.sh + +echo Installing Mongodb... +/vagrant/vagrant_scripts/install_mongo.sh + +echo Installing gcc... +/vagrant/vagrant_scripts/install_gcc.sh + +echo Installing Git... +apt-get install -qq git + +echo Installing curl... +apt-get install -qq curl + +echo Installing test dependencies... +/vagrant/vagrant_scripts/install_gcc.sh + +echo Installing ntp... +apt-get install -qq ntp + +echo Installing nvm, node and global node modules... +/vagrant/vagrant_scripts/install_node.sh + +echo All done! run npm install to install the required node modules and then npm start to start the server + +# Uncomment both lines to autostart the habitica server when provisioning +# echo Starting Habitica server... +# autostart_habitrpg + diff --git a/website/public/css/avatar.styl b/website/public/css/avatar.styl index 13bd58246d..690dc1bb79 100644 --- a/website/public/css/avatar.styl +++ b/website/public/css/avatar.styl @@ -11,11 +11,22 @@ future re: pets and whatnot, this is just temporary. // see http://stackoverflow.com/questions/24166568/set-bootstrap-modal-body-height-by-percentage .profile-modal - .modal-dialog,.modal-content - height: 96% + .modal-dialog + height: 100% + width: auto + max-width: 920px + margin: 0 auto + padding: 10px + @media screen and (min-width:768px) + padding: 30px 10px + .modal-content + height: 100% .modal-body - max-height: calc(100% - 150px) //100% = dialog height, 150px = header + footer + max-height: calc(100% - 137px) // 100% = dialog height, 137px = header (70px) + footer (67px) overflow-y: scroll + .modal-footer + margin: 0 + padding: 16px 20px .herobox // Base styles diff --git a/website/public/css/index.styl b/website/public/css/index.styl index 382d4838b7..4936ea8264 100644 --- a/website/public/css/index.styl +++ b/website/public/css/index.styl @@ -198,10 +198,9 @@ a.label .markdown-preview markdown code white-space inherit -// By default everything should render as pixelart, except images from img tags (which tend to be things like gravatars, -// screenshots and so on) +// By default everything should render as pixelart * image-rendering: pixelated -.img-rendering-auto, .emoji +.img-rendering-auto, .img-rendering-auto *, .emoji image-rendering: auto diff --git a/website/views/static/front.jade b/website/views/static/front.jade index 926f0d6172..d5405d260c 100644 --- a/website/views/static/front.jade +++ b/website/views/static/front.jade @@ -84,7 +84,7 @@ html(ng-app='habitrpg', ng-controller='RootCtrl') h4= env.t('joinOthers', {userCount:'900,000'}) small button#play-btn.btn.btn-primary.btn-lg.gamifybutton(ng-click='playButtonClick()')= env.t('free') - .presslogos.text-center + .presslogos.text-center.img-rendering-auto = env.t('featuredIn') br img(src='https://d2afqr2xdmyzvu.cloudfront.net/front/images/presslogos/lifehacker.png')