Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasbynens committed Mar 21, 2016
0 parents commit d673031
Show file tree
Hide file tree
Showing 22 changed files with 1,770 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
indent_style = tab
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[{README.md,package.json,.travis.yml}]
indent_style = space
indent_size = 2
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
dist

# Installed npm modules
node_modules

# Folder view configuration files
.DS_Store
Desktop.ini

# Thumbnail cache files
._*
Thumbs.db

# Files that might appear on external disks
.Spotlight-V100
.Trashes
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: node_js
after_success:
- "scripts/travis/auto-deploy.sh"
git:
depth: 1
branches:
only:
- master
env:
global:
secure: "wKIDiTzMadGINGEt4Tf9yzALBjGzJEmWDmcGgMIGGO2oh/y6hsqge7HbQ+wWngXf/YD/AmCBSU1P6NEQs/qsg7HSfUrwTcHG9xwKzn5hV0KfSLVujFLPUBIDUl4K1dHlubSE358UNwgnE3MsFg+j+Z7gLqOaYwSNb0csH8+QHspv4EN7sqw3jzsHGOhtk6LJHXfKB6ENA4prhF9HluXjA3jbMCy+u4GwPS2NR8S0kZE2NKJKi/mPhOoVhc2elz047E49+eDf/Yca7LRDfVBbCrAdObEz6xkuCrahLLkwAmW9Snex+3XkG0PUqs7S+0X/gM0GzF/1zhGOTsTNiL8gF1e0yP5sj3ph49UG/VHwFoPQrlyrPQHgykZ3PIGfszqeQy1Czyixv7IAOBc8kSu65JXhZL7wKt8X7G7/zXmhiEv+YbDwpZr61A7TuC3Iae0+WZZ9cxeMLUXFDa2cFBQ2CnL24SCOQPjO1+L6+v+BPr+3gRSqJlqK+jIxcK9Xc2iIj8p4zpw1yhxA/7pDAYdURJa6d/eNiqCpUAjIvnK4pDX/+iiwFgbz+9qQA6uZUEF96ObgzpKY6FZZp+jq1m8l3+EHrw1scNBvZCi/hshskz6i25mDh8tMU9+gvnRqUSsZF2+m5NIyfxSR/Gq5XxvRiZ4if+40p1AOzt+WtLLZmQk="
20 changes: 20 additions & 0 deletions LICENSE-MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright Mathias Bynens <https://mathiasbynens.be/>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Online Tibia map viewer [![Build status](https://travis-ci.org/tibiamaps/tibia-map.svg)](https://travis-ci.org/tibiamaps/tibia-map)

This is an online Tibia map viewer that uses the data from the [tibia-map-data](https://github.com/tibiamaps/tibia-map-data) project.

## Maintainer

| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
|---|
| [Mathias Bynens](https://mathiasbynens.be/) |
70 changes: 70 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
'use strict';

const del = require('del');
const gulp = require('gulp');

const autoprefixer = require('gulp-autoprefixer');
const cleanCSS = require('gulp-clean-css');
const concat = require('gulp-concat');
const imagemin = require('gulp-imagemin');
const replace = require('gulp-replace');
const uglify = require('gulp-uglify');

gulp.task('clean', function() {
del('dist/*');
});

gulp.task('html', function() {
gulp.src([
'src/index.html',
'src/small.html'
])
.pipe(replace(/\.\.\/dist\//g, ''))
.pipe(gulp.dest('./dist/'));
});

gulp.task('css', function() {
gulp.src([
'src/_css/leaflet.css',
'src/_css/leaflet.coordinates.css',
'node_modules/leaflet-fullscreen/dist/leaflet.fullscreen.css',
'src/_css/map.css'
])
.pipe(concat('map.css'))
.pipe(autoprefixer()) // This (also) removes unneeded prefixes.
.pipe(cleanCSS())
.pipe(gulp.dest('./dist/'));
});

gulp.task('js', function() {
gulp.src([
'src/_js/leaflet.js',
'src/_js/leaflet.coordinates.js',
'src/_js/leaflet.crosshairs.js',
'node_modules/leaflet-fullscreen/dist/Leaflet.fullscreen.min.js',
'src/_js/map.js'
])
.pipe(concat('map.js'))
.pipe(uglify())
.pipe(gulp.dest('./dist/'));
});

gulp.task('img', function() {
gulp.src([
'node_modules/leaflet-fullscreen/dist/*.png',
'src/_css/*.png'
])
.pipe(imagemin({
'optimizationLevel': 7
}))
.pipe(gulp.dest('./dist/'));
});

gulp.task('copy', function() {
gulp.src(
'src/favicon.ico'
)
.pipe(gulp.dest('./dist/'));
});

gulp.task('default', ['clean', 'html', 'css', 'js', 'img', 'copy']);
21 changes: 21 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"private": true,
"dependencies": {
"leaflet-fullscreen": "^1.0.1"
},
"devDependencies": {
"@alrra/travis-scripts": "^2.0.0",
"del": "^2.2.0",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.1.0",
"gulp-clean-css": "^2.0.3",
"gulp-concat": "^2.6.0",
"gulp-imagemin": "^2.4.0",
"gulp-replace": "^0.5.4",
"gulp-uglify": "^1.5.1"
},
"scripts": {
"test": "gulp",
"build": "gulp"
}
}
31 changes: 31 additions & 0 deletions scripts/travis/auto-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

declare -r PRIVATE_KEY_FILE_NAME='github-deploy-key';

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Decrypt the file containing the private key.

openssl aes-256-cbc \
-K $encrypted_10cf0f97a88f_key \
-iv $encrypted_10cf0f97a88f_iv \
-in "$(dirname "$BASH_SOURCE")/${PRIVATE_KEY_FILE_NAME}.enc" \
-out ~/.ssh/$PRIVATE_KEY_FILE_NAME -d;

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Enable SSH authentication.

chmod 600 ~/.ssh/$PRIVATE_KEY_FILE_NAME;
echo 'Host github.com' >> ~/.ssh/config;
echo " IdentityFile ~/.ssh/${PRIVATE_KEY_FILE_NAME}" >> ~/.ssh/config;

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Update the content on the `gh-pages` branch.

$(npm bin)/update-branch --commands 'npm run build' \
--commit-message "Update gh-pages @ ${TRAVIS_COMMIT}" \
--directory 'dist' \
--distribution-branch 'gh-pages' \
--source-branch 'master';
Binary file added scripts/travis/github-deploy-key.enc
Binary file not shown.
Binary file added src/_css/layers-2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/_css/layers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions src/_css/leaflet.coordinates.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.leaflet-control-coordinates {
background-color: #D8D8D8;
background-color: rgba(255, 255, 255, .8);
cursor: pointer;
}
.leaflet-control-coordinates,
.leaflet-control-coordinates .uiElement input {
border-radius: 5px;
}
.leaflet-control-coordinates .uiElement {
margin: 4px;
}
.leaflet-control-coordinates .uiElement .labelFirst {
margin-right: 4px;
}
.leaflet-control-coordinates .uiHidden {
display: none;
}
Loading

0 comments on commit d673031

Please sign in to comment.