Private
Public Access
1
0

Compare commits

..

17 Commits
slack ... 0.4.0

Author SHA1 Message Date
0effd8ab8d change session driver to REDIS 2017-01-03 16:11:19 +01:00
e387e21b34 add created, updated field to db && improve graph design 2017-01-03 13:10:43 +01:00
039c29674a cache setup && optimalize for google pagespeed && optimalize all images 2016-12-22 11:49:07 +01:00
ef89f7df09 improve graph design on homepage && add footer and techs && add official pages 2016-12-21 18:46:32 +01:00
4d5a9b978b bugfix mine websocket periodic mysql calling 2016-12-21 16:16:16 +01:00
ccfb621c2b bugfix hwioauth remember me && centralize hwioauth and facebook settings 2016-12-21 16:15:25 +01:00
1e2a231c6c centralize jquery && bugfix mysql auto-termination problem w/ user auth 2016-12-18 19:51:41 +01:00
bcc9671895 release beta4 2016-12-14 15:50:48 +01:00
6d125f2dab gitignore npm debug log 2016-12-11 18:26:23 +01:00
664ef5b424 add english lang everywhere && add snowfall && add centralized version nbr && improve stylesheet && slack integration 2016-12-11 18:25:19 +01:00
68c6a277ba bugfix #30 && random bg in game 2016-12-11 17:43:31 +01:00
875d2d71db add google analytics and facebook scripts && improve url share method w/ fb && enforce https in prod 2016-12-11 15:10:25 +01:00
c0d75e43f3 reg and login buttons on index && remove list method && facebook centralize 2016-12-10 14:43:28 +01:00
6dc59549ef redesign user frontend 2016-12-08 14:35:28 +01:00
aed5eaf3ab mods for performance; one js.min file on prod 2016-11-30 21:24:51 +01:00
f44bc58df2 improve webpack config for prod compile #23 2016-11-30 20:48:17 +01:00
50b3663889 ssl handling #22 && reconnection issues #20, #21 2016-11-30 20:15:56 +01:00
113 changed files with 2558 additions and 477 deletions

2
.gitignore vendored
View File

@@ -36,3 +36,5 @@ phpunit-report/*
nohup.out nohup.out
src/Mine/SeekerBundle/Resources/public/js/index.js src/Mine/SeekerBundle/Resources/public/js/index.js
src/Mine/SeekerBundle/Resources/public/js/index.min.js
npm-debug.log

View File

@@ -19,7 +19,17 @@ This is a Symfony 3 project w/ React JS in standalone mode and w/ WebSocket.
2.) React JS WebPack watch generator w/ babel presets: es2015, react 2.) React JS WebPack watch generator w/ babel presets: es2015, react
$ webpack -p --config=webpack-prod.config.js
PROD
$ webpack --progress --colors --watch -d $ webpack --progress --colors --watch -d
DEV
-d --> Debugger; If you write this line somewhere: debugger; -d --> Debugger; If you write this line somewhere: debugger;
The browser will stop the code here!!! The browser will stop the code here!!!
3.) Connect to Prod
ssh xxsvci@laszlolang.com -i ~/.ssh/id_rsa_laszlolang

View File

@@ -24,6 +24,7 @@ class AppKernel extends Kernel
new Gos\Bundle\PubSubRouterBundle\GosPubSubRouterBundle(), new Gos\Bundle\PubSubRouterBundle\GosPubSubRouterBundle(),
new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(), new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
new Snc\RedisBundle\SncRedisBundle(), new Snc\RedisBundle\SncRedisBundle(),
new CL\Bundle\SlackBundle\CLSlackBundle(),
new Jotunheimr\AdminBundle\JotunheimrAdminBundle(), new Jotunheimr\AdminBundle\JotunheimrAdminBundle(),
new Jotunheimr\UserBundle\JotunheimrUserBundle(), new Jotunheimr\UserBundle\JotunheimrUserBundle(),

View File

@@ -2,12 +2,31 @@
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="Cache-control" content="max-age=1209600;public">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}Welcome!{% endblock %}</title> <meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="keywords" content="game,mineseeker,mine,seeker,laszlolang.com">
<meta name="robots" content="index,follow">
<meta name="revisit-after" content="2 days">
<meta name="resource-type" content="document">
<meta name="country" content="Hungary">
<meta name="description" content="This is a new minesweeper, multiplayer game.">
<meta name="content-language" content="hu,hun,hungarian">
{% include '@MineSeeker/Recent/favicon.html.twig' %}
<meta property="fb:app_id" content="{{ facebook_api }}">
{% block metas %}{% endblock %}
<title>MineSeeker{% block title %}{% endblock %}</title>
{% block stylesheets %}{% endblock %} {% block stylesheets %}{% endblock %}
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}"/> {% include '@MineSeeker/Recent/google-analytics.html.twig' %}
</head> </head>
<body> <body>
<div id="fb-root"></div>
{% block bodyTop %}{% endblock %}
<header> <header>
{% block header %}{% endblock %} {% block header %}{% endblock %}
</header> </header>
@@ -18,6 +37,15 @@
{% block footer %}{% endblock %} {% block footer %}{% endblock %}
</footer> </footer>
{% block javascripts %}{% endblock %} {% block javascripts %}
{% javascripts filter='?uglifyjs2'
'@JotunheimrAdminBundle/Resources/public/js/vendor/plugins/jQuery/jquery-3.0.0.min.js'
'@JotunheimrAdminBundle/Resources/public/js/vendor/plugins/jQuery/jquery-migrate-3.0.0.min.js'
'@JotunheimrAdminBundle/Resources/public/js/vendor/bootstrap/js/bootstrap.min.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{% include '@MineSeeker/Recent/facebook.html.twig' %}
{% endblock %}
</body> </body>
</html> </html>

View File

@@ -28,10 +28,10 @@ framework:
trusted_hosts: ~ trusted_hosts: ~
trusted_proxies: ~ trusted_proxies: ~
session: session:
# http://symfony.com/doc/current/reference/configuration/framework.html#handler-id # http://symfony.com/doc/current/reference/configuration/framework.html#handler-id
# handler_id: session.handler.native_file # handler_id: session.handler.native_file
# save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%"
handler_id: session.handler.pdo handler_id: session.handler.pdo
save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%"
fragments: ~ fragments: ~
http_method_override: true http_method_override: true
assets: ~ assets: ~
@@ -40,6 +40,11 @@ framework:
twig: twig:
debug: "%kernel.debug%" debug: "%kernel.debug%"
strict_variables: "%kernel.debug%" strict_variables: "%kernel.debug%"
globals:
version: "0.37.18 (beta7)"
facebook_api: "%facebook.api%"
facebook_scope: "%facebook.scope%"
facebook_api_version: "%facebook.version%"
# Doctrine Configuration # Doctrine Configuration
doctrine: doctrine:
@@ -68,6 +73,7 @@ assetic:
debug: "%kernel.debug%" debug: "%kernel.debug%"
use_controller: "%kernel.debug%" use_controller: "%kernel.debug%"
bundles: ~ bundles: ~
node: /usr/bin/nodejs
filters: filters:
cssrewrite: ~ cssrewrite: ~
uglifyjs2: uglifyjs2:
@@ -79,5 +85,23 @@ assetic:
# FOS User Configuration # FOS User Configuration
fos_user: fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel' db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: main firewall_name: secured_area
user_class: Jotunheimr\UserBundle\Entity\User user_class: Jotunheimr\UserBundle\Entity\User
# Facebook OAuth
hwi_oauth:
firewall_names: [secured_area]
resource_owners:
facebook:
type: facebook
client_id: "%facebook.api%"
client_secret: "%facebook.api-secret%"
scope: "%facebook.scope%"
options:
display: popup
auth_type: rerequest
csrf: true
# Slack integration
cl_slack:
api_token: xoxp-107639806167-107029084564-115427085733-cccaa4f96c89c87ce680c7f22acfd001

View File

@@ -32,16 +32,9 @@ monolog:
type: console type: console
channels: [!event, !doctrine] channels: [!event, !doctrine]
# Facebook OAuth parameters:
hwi_oauth: facebook.api: 320599508311862
firewall_names: [secured_area] facebook.api-secret: 18d4f48cdd274bccee2678e5eff3f557
resource_owners: facebook.version: 'v2.8'
facebook: facebook.scope: 'public_profile,email,user_friends'
type: facebook mineseeker.websocket: 6450
client_id: 320599508311862
client_secret: 18d4f48cdd274bccee2678e5eff3f557
scope: "public_profile,email"
options:
display: popup
auth_type: rerequest
csrf: true

View File

@@ -23,16 +23,9 @@ monolog:
console: console:
type: console type: console
# Facebook OAuth parameters:
hwi_oauth: facebook.api: 320597498312063
firewall_names: [secured_area] facebook.api-secret: c751bec8a3c5313ff2e5a83769bf1109
resource_owners: facebook.version: 'v2.8'
facebook: facebook.scope: 'public_profile,email,user_friends'
type: facebook mineseeker.websocket: 8080
client_id: 320597498312063
client_secret: c751bec8a3c5313ff2e5a83769bf1109
scope: "public_profile,email"
options:
display: popup
auth_type: rerequest
csrf: true

View File

@@ -2,9 +2,12 @@
parameters: parameters:
database_host: 127.0.0.1 database_host: 127.0.0.1
database_port: null database_port: null
database_name: xxsvci_mineseeker # database_name: xxsvci_mineseeker
database_user: xxsvci_mine # database_user: xxsvci_mine
database_password: "XTw#8qC$faa*" # database_password: "XTw#8qC$faa*"
database_name: mine
database_user: root
database_password: "bazmeg"
mailer_transport: smtp mailer_transport: smtp
mailer_host: 127.0.0.1 mailer_host: 127.0.0.1
mailer_user: null mailer_user: null

View File

@@ -12,3 +12,4 @@ _errors:
_main: _main:
resource: routing.yml resource: routing.yml
schemes: [http]

View File

@@ -21,13 +21,19 @@ security:
login_path: /login login_path: /login
failure_path: /login failure_path: /login
use_forward: false use_forward: false
oauth_user_provider: oauth_user_provider:
service: my.custom.user_provider service: jotun.user_provider
remember_me:
secret: "%secret%"
lifetime: 604800
path: /
domain: ~
user_provider: fos_userbundle
form_login: form_login:
provider: fos_userbundle provider: fos_userbundle
csrf_token_generator: security.csrf.token_manager csrf_token_generator: security.csrf.token_manager
default_target_path: / default_target_path: /
remember_me: true
logout: logout:
path: /logout path: /logout
target: / target: /

View File

@@ -34,7 +34,8 @@
"symfony/assetic-bundle": "^2.8", "symfony/assetic-bundle": "^2.8",
"predis/predis": "^1.0", "predis/predis": "^1.0",
"snc/redis-bundle": "^2.0", "snc/redis-bundle": "^2.0",
"hwi/oauth-bundle": "^0.5.1" "hwi/oauth-bundle": "^0.5.1",
"cleentfaar/slack-bundle": "^0.20.1"
}, },
"require-dev": { "require-dev": {
"sensio/generator-bundle": "^3.0", "sensio/generator-bundle": "^3.0",

597
composer.lock generated
View File

@@ -4,9 +4,122 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "9ab894ab9dec6a53088c8bea70e8ee9a", "hash": "8325ddf53babcbda387208723c05a0f0",
"content-hash": "06afd75cc129d2765a6803d384805417", "content-hash": "d9f2a2a5e6279269f9f7c2cc1fe0573a",
"packages": [ "packages": [
{
"name": "cleentfaar/slack",
"version": "0.20.1",
"source": {
"type": "git",
"url": "https://github.com/cleentfaar/slack.git",
"reference": "ba7073cb79ccea423cd68f6a69096384a730a013"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cleentfaar/slack/zipball/ba7073cb79ccea423cd68f6a69096384a730a013",
"reference": "ba7073cb79ccea423cd68f6a69096384a730a013",
"shasum": ""
},
"require": {
"doctrine/collections": "^1.2",
"ext-curl": "*",
"guzzlehttp/guzzle": "^6.0",
"jms/serializer": "^1.0",
"php": ">=5.5",
"symfony/event-dispatcher": "^2.3|^3.0",
"symfony/yaml": "^2.3|^3.0"
},
"require-dev": {
"mockery/mockery": "^0.9",
"phpunit/phpunit": "^4.7",
"symfony/var-dumper": "^2.3|^3.0"
},
"suggest": {
"cleentfaar/slack-bundle": "For easy integration with your Symfony projects",
"cleentfaar/slack-cli": "Command-line application for interacting with the Slack API"
},
"type": "library",
"autoload": {
"psr-4": {
"CL\\Slack\\": "src/CL/Slack/",
"CL\\Slack\\Test\\": "tests/src/CL/Slack/Test/",
"CL\\Slack\\Tests\\": "tests/src/CL/Slack/Tests/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Cas Leentfaar",
"email": "info@casleentfaar.com",
"homepage": "https://github.com/cleentfaar"
}
],
"description": "Access your Slack Team's API through PHP objects",
"homepage": "http://cleentfaar.github.io/slack/",
"keywords": [
"chat",
"slack",
"slack api"
],
"time": "2016-05-30 21:02:28"
},
{
"name": "cleentfaar/slack-bundle",
"version": "0.20.1",
"source": {
"type": "git",
"url": "https://github.com/cleentfaar/CLSlackBundle.git",
"reference": "f9fec94912a845f44d8de686ed06925168c1fc5b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cleentfaar/CLSlackBundle/zipball/f9fec94912a845f44d8de686ed06925168c1fc5b",
"reference": "f9fec94912a845f44d8de686ed06925168c1fc5b",
"shasum": ""
},
"require": {
"cleentfaar/slack": "~0.20",
"php": ">=5.5",
"symfony/framework-bundle": "^2.3|^3.0"
},
"require-dev": {
"matthiasnoback/symfony-config-test": "^0.2",
"matthiasnoback/symfony-dependency-injection-test": "^0.7",
"phpunit/phpunit": "^4.0|^5.0"
},
"suggest": {
"cleentfaar/slack-cli": "Command-line application for interacting with the Slack API"
},
"type": "symfony-bundle",
"autoload": {
"psr-4": {
"CL\\Bundle\\SlackBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Cas Leentfaar",
"email": "info@casleentfaar.com",
"homepage": "https://github.com/cleentfaar"
}
],
"description": "This bundle provides integration with the Slack API library, allowing you to interact with the Slack API from within your Symfony projects",
"keywords": [
"api",
"bundle",
"slack",
"symfony"
],
"time": "2016-05-30 22:12:25"
},
{ {
"name": "doctrine/annotations", "name": "doctrine/annotations",
"version": "v1.2.7", "version": "v1.2.7",
@@ -1560,6 +1673,177 @@
"abandoned": "guzzle/guzzle", "abandoned": "guzzle/guzzle",
"time": "2014-05-01 21:36:02" "time": "2014-05-01 21:36:02"
}, },
{
"name": "guzzlehttp/guzzle",
"version": "6.2.2",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/ebf29dee597f02f09f4d5bbecc68230ea9b08f60",
"reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60",
"shasum": ""
},
"require": {
"guzzlehttp/promises": "^1.0",
"guzzlehttp/psr7": "^1.3.1",
"php": ">=5.5"
},
"require-dev": {
"ext-curl": "*",
"phpunit/phpunit": "^4.0",
"psr/log": "^1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "6.2-dev"
}
},
"autoload": {
"files": [
"src/functions_include.php"
],
"psr-4": {
"GuzzleHttp\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "Guzzle is a PHP HTTP client library",
"homepage": "http://guzzlephp.org/",
"keywords": [
"client",
"curl",
"framework",
"http",
"http client",
"rest",
"web service"
],
"time": "2016-10-08 15:01:37"
},
{
"name": "guzzlehttp/promises",
"version": "1.3.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "2693c101803ca78b27972d84081d027fca790a1e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/2693c101803ca78b27972d84081d027fca790a1e",
"reference": "2693c101803ca78b27972d84081d027fca790a1e",
"shasum": ""
},
"require": {
"php": ">=5.5.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Promise\\": "src/"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "Guzzle promises library",
"keywords": [
"promise"
],
"time": "2016-11-18 17:47:58"
},
{
"name": "guzzlehttp/psr7",
"version": "1.3.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/5c6447c9df362e8f8093bda8f5d8873fe5c7f65b",
"reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
"psr/http-message": "~1.0"
},
"provide": {
"psr/http-message-implementation": "1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "PSR-7 message implementation",
"keywords": [
"http",
"message",
"stream",
"uri"
],
"time": "2016-06-24 23:00:38"
},
{ {
"name": "hwi/oauth-bundle", "name": "hwi/oauth-bundle",
"version": "0.5.1", "version": "0.5.1",
@@ -1810,6 +2094,167 @@
], ],
"time": "2014-01-12 16:20:24" "time": "2014-01-12 16:20:24"
}, },
{
"name": "jms/metadata",
"version": "1.6.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/metadata.git",
"reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/metadata/zipball/6a06970a10e0a532fb52d3959547123b84a3b3ab",
"reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"doctrine/cache": "~1.0",
"symfony/cache": "~3.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5.x-dev"
}
},
"autoload": {
"psr-0": {
"Metadata\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Class/method/property metadata management in PHP",
"keywords": [
"annotations",
"metadata",
"xml",
"yaml"
],
"time": "2016-12-05 10:18:33"
},
{
"name": "jms/parser-lib",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/parser-lib.git",
"reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d",
"reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d",
"shasum": ""
},
"require": {
"phpoption/phpoption": ">=0.9,<2.0-dev"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-0": {
"JMS\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache2"
],
"description": "A library for easily creating recursive-descent parsers.",
"time": "2012-11-18 18:08:43"
},
{
"name": "jms/serializer",
"version": "1.4.2",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/serializer.git",
"reference": "f39d8b4660d5cef43b0c3265ce642173d9b2c58b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/serializer/zipball/f39d8b4660d5cef43b0c3265ce642173d9b2c58b",
"reference": "f39d8b4660d5cef43b0c3265ce642173d9b2c58b",
"shasum": ""
},
"require": {
"doctrine/annotations": "^1.0",
"doctrine/instantiator": "^1.0.3",
"jms/metadata": "~1.1",
"jms/parser-lib": "1.*",
"php": ">=5.5.0",
"phpcollection/phpcollection": "~0.1",
"phpoption/phpoption": "^1.1"
},
"conflict": {
"twig/twig": "<1.12"
},
"require-dev": {
"doctrine/orm": "~2.1",
"doctrine/phpcr-odm": "^1.3|^2.0",
"ext-pdo_sqlite": "*",
"jackalope/jackalope-doctrine-dbal": "^1.1.5",
"phpunit/phpunit": "^4.8|^5.0",
"propel/propel1": "~1.7",
"symfony/filesystem": "^2.1",
"symfony/form": "~2.1",
"symfony/translation": "^2.1",
"symfony/validator": "^2.2",
"symfony/yaml": "^2.1",
"twig/twig": "~1.12|~2.0"
},
"suggest": {
"symfony/yaml": "Required if you'd like to serialize data to YAML format."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"psr-0": {
"JMS\\Serializer": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache2"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.",
"homepage": "http://jmsyst.com/libs/serializer",
"keywords": [
"deserialization",
"jaxb",
"json",
"serialization",
"xml"
],
"time": "2016-11-13 10:20:11"
},
{ {
"name": "kriswallsmith/assetic", "name": "kriswallsmith/assetic",
"version": "v1.3.2", "version": "v1.3.2",
@@ -2172,6 +2617,104 @@
], ],
"time": "2016-10-17 15:23:22" "time": "2016-10-17 15:23:22"
}, },
{
"name": "phpcollection/phpcollection",
"version": "0.5.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/php-collection.git",
"reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6",
"reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6",
"shasum": ""
},
"require": {
"phpoption/phpoption": "1.*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.4-dev"
}
},
"autoload": {
"psr-0": {
"PhpCollection": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache2"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "General-Purpose Collection Library for PHP",
"keywords": [
"collection",
"list",
"map",
"sequence",
"set"
],
"time": "2015-05-17 12:39:23"
},
{
"name": "phpoption/phpoption",
"version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/php-option.git",
"reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/php-option/zipball/94e644f7d2051a5f0fcf77d81605f152eecff0ed",
"reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "4.7.*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3-dev"
}
},
"autoload": {
"psr-0": {
"PhpOption\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache2"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Option Type for PHP",
"keywords": [
"language",
"option",
"php",
"type"
],
"time": "2015-07-25 16:39:46"
},
{ {
"name": "predis/predis", "name": "predis/predis",
"version": "v1.1.1", "version": "v1.1.1",
@@ -2268,6 +2811,56 @@
], ],
"time": "2016-08-06 20:24:11" "time": "2016-08-06 20:24:11"
}, },
{
"name": "psr/http-message",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"time": "2016-08-06 14:39:51"
},
{ {
"name": "psr/log", "name": "psr/log",
"version": "1.0.2", "version": "1.0.2",

View File

@@ -9,9 +9,12 @@ hwi_oauth_login:
facebook_login: facebook_login:
path: /login/check-facebook path: /login/check-facebook
defaults: { _remember_me: on }
google_login: google_login:
path: /login/check-google path: /login/check-google
defaults: { _remember_me: on }
github_login: github_login:
path: /login/check-github path: /login/check-github
defaults: { _remember_me: on }

View File

@@ -1,4 +1,4 @@
services: services:
my.custom.user_provider: jotun.user_provider:
class: Jotunheimr\UserBundle\Security\Core\User\MyFOSUBUserProvider class: Jotunheimr\UserBundle\Security\Core\User\MyFOSUBUserProvider
arguments: ['@fos_user.user_manager', { facebook: facebookId }, '@doctrine.orm.entity_manager'] arguments: ['@fos_user.user_manager', { facebook: facebookId }, '@doctrine.orm.entity_manager']

View File

@@ -28,109 +28,367 @@
box-sizing: border-box; box-sizing: border-box;
} }
main { .ac-custom {
background: url('/bundles/mineseeker/images/homepage/header.jpg') no-repeat center center;
background-size: cover;
position: fixed;
width: 100%; width: 100%;
height: 100%;
} }
main .wrapper { header section .form-check {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
main .wrapper .form-container {
background: #ffffff;
display: table; display: table;
padding: 15px; position: relative;
}
main .wrapper .form-container h1 {
font: normal 32px Arial, Helvetica, sans-serif;
text-align: center;
padding: 0;
margin: 0 0 15px 0;
}
main .wrapper .form-container h1.sub-title {
margin-top: 15px;
}
main .wrapper .form-container h2 {
font: normal 18px Arial, Helvetica, sans-serif;
text-align: center;
margin: 20px 0; margin: 20px 0;
} }
main .wrapper .form-container .form-input { header section h1 {
background: #cbcbc8; margin: 10px 0;
min-width: 300px; }
border: 0;
padding: 15px;
header section .input-submit button,
header section .input-submit button:hover,
header section .form-input,
header section .form-input:focus,
header section .form-input:hover {
-webkit-transition: all 250ms ease-in-out; -webkit-transition: all 250ms ease-in-out;
-moz-transition: all 250ms ease-in-out;
-o-transition: all 250ms ease-in-out;
transition: all 250ms ease-in-out; transition: all 250ms ease-in-out;
} }
main .wrapper .form-container .form-input:focus { header section .input-submit button {
background: #e2e2de; background: #83aed9;
-webkit-transition: all 250ms ease-in-out;
transition: all 250ms ease-in-out;
}
main .wrapper .form-container .form-input.form-username {
margin-bottom: 5px;
}
main .wrapper .form-container .form-check {
display: table; display: table;
position: relative; font: bold 32px 'Rajdhani', sans-serif;
margin: 20px auto 0 auto; text-transform: uppercase;
} text-decoration: none;
width: 500px;
main .wrapper .form-container .input-submit { border: 1px solid #658fb8;
color: #FFFFFF;
padding: 25px 150px;
margin-top: 20px; margin-top: 20px;
-webkit-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
-webkit-border-radius: 3px;
border-radius: 3px;
} }
main .wrapper .form-container button, header section .input-submit button:hover {
main .wrapper .form-container .fb-login { background: #86b5e1;
-webkit-box-shadow: 0 7px 15px rgba(0, 0, 0, 0.2);
box-shadow: 0 7px 15px rgba(0, 0, 0, 0.2);
}
header section .form-input {
display: block; display: block;
background: #7dadcf; width: 500px;
font: bold 22px 'Rajdhani', sans-serif;
border: 1px solid #dddddd;
color: #000000;
padding: 15px;
margin-bottom: 10px;
-webkit-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
}
header section .form-input:focus,
header section .form-input:hover {
-webkit-box-shadow: 0 7px 10px rgba(0, 0, 0, 0.1);
box-shadow: 0 7px 10px rgba(0, 0, 0, 0.1);
}
header section .failure {
background: #f00;
position: relative;
border: 3px solid #fff;
font: bold 16px 'Rajdhani', sans-serif;
color: #FFFFFF;
padding: 10px;
margin: 30px 0 10px 0;
-webkit-border-radius: 5px;
border-radius: 5px;
}
header section .failure:after,
header section .failure:before {
content: " ";
position: absolute;
bottom: 100%;
left: 50px;
height: 0;
width: 0;
border: solid transparent;
pointer-events: none;
}
header section .failure:after {
border-color: rgba(0, 0, 0, 0);
border-bottom-color: #f00;
border-width: 20px;
margin-left: -20px;
}
header section .failure:before {
border-color: rgba(255, 255, 255, 0);
border-bottom-color: #ffffff;
border-width: 26px;
margin-left: -26px;
}
header section .failure ul {
display: inline-block;
list-style: none;
padding: 0;
margin: 0 10px 0 0;
}
header section h3.or {
font: bold 16px 'Rajdhani', sans-serif;
text-transform: uppercase;
color: #a1a1a1;
margin: 20px 0;
}
header section #id_welcome {
display: flex;
flex-direction: row;
margin-bottom: 115px;
}
header section #id_welcome > div {
padding-right: 20px;
}
header section #id_welcome img {
width: 100px;
border: 5px solid #414040;
-webkit-border-radius: 50%;
border-radius: 50%;
}
header section .buttons,
header section form {
z-index: 2;
}
header section div.buttons > a.fb-login,
header section div.buttons > a.slack-login {
position: relative;
display: block;
width: 500px;
height: 93px;
padding: 25px 0 25px 150px;
margin-bottom: 10px;
overflow: hidden;
cursor: pointer;
-webkit-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
}
header section div.buttons > a.fb-login:hover,
header section div.buttons > a.slack-login:hover {
text-decoration: none;
-webkit-box-shadow: 0 7px 10px rgba(0, 0, 0, 0.1);
box-shadow: 0 7px 10px rgba(0, 0, 0, 0.1);
}
header section div.buttons > a.fb-login i,
header section div.buttons > a.slack-login i {
position: absolute;
font-size: 130px;
top: 0;
left: 15px;
}
header section div.buttons > a.fb-login {
background: #5975b1;
border: 1px solid #50649f;
}
header section div.buttons > a.fb-login:hover {
background: #42598c;
color: #FFFFFF;
}
header section div.buttons > a.slack-login {
background: #FFFFFF;
border: 1px solid #5c3a58;
color: #5c3a58;
}
header section div.buttons > a.slack-login:hover {
background: #e6e6e6;
color: #5c3a58;
}
header section .failure-main {
background: #f00;
max-width: 500px;
border: 3px solid #fff;
font: bold 16px 'Rajdhani', sans-serif;
color: #FFFFFF;
padding: 10px;
margin: 0 0 20px 0;
-webkit-border-radius: 5px;
border-radius: 5px;
}
main div.txt {
width: 100%; width: 100%;
border: 0; max-width: 1000px;
font-family: 'Rajdhani', sans-serif;
color: #414040;
margin: 50px auto 0 auto;
}
main div.txt h2 {
margin: 0 0 50px 0;
}
main div.txt p {
font: normal 16px 'Rajdhani', sans-serif;
}
main div.txt li {
font: normal 16px 'Rajdhani', sans-serif;
padding-left: 10px;
margin-left: 50px;
}
main .technologies {
text-align: center; text-align: center;
padding: 20px;
-webkit-transition: all 250ms ease-in-out;
transition: all 250ms ease-in-out;
} }
main .wrapper .form-container .fb-login { main .technologies img {
background: #3b5998; display: inline-block;
width: 90%;
max-width: 100px;
margin: 20px;
} }
main .wrapper .form-container button:focus, main .technologies h1 {
main .wrapper .form-container button:hover, font-weight: bold;
main .wrapper .form-container .fb-login:focus,
main .wrapper .form-container .fb-login:hover {
background: #6fa0c3;
-webkit-transition: all 250ms ease-in-out;
transition: all 250ms ease-in-out;
} }
main .wrapper .form-container button i, footer {
main .wrapper .form-container .fb-login i { background: #414040;
font-size: 32px; width: 100%;
font-weight: bolder; min-height: 50px;
color: #ffffff; margin-top: 50px;
} }
footer nav {
display: block;
text-align: center;
}
footer nav ul {
display: inline-block;
list-style: none;
padding: 0;
margin: 0;
}
footer nav ul li {
display: inline-block;
font: bold 16px 'Rajdhani', sans-serif;
color: #FFFFFF;
}
footer nav ul li:nth-child(even) {
width: 50px;
text-align: center;
}
footer nav ul li a {
text-align: center;
line-height: 50px;
color: #FFFFFF;
}
footer nav ul li a:hover {
color: #FFFFFF;
}
@media screen and (max-width: 1100px) {
header section #id_welcome {
align-items: center;
justify-content: center;
margin-top: 50px;
}
header section .form-input,
header section .form-check {
margin-left: auto;
margin-right: auto;
}
header section .input-submit button {
margin: 0 auto;
}
header section > div {
width: 100%;
}
header section div.buttons > a.fb-login,
header section div.buttons > a.slack-login {
margin: 0 auto;
}
main div.txt {
padding: 0 20px;
}
}
@media screen and (max-width: 550px) {
header section #id_welcome {
display: block;
}
header section {
padding: 20px;
}
header section .form-input {
width: 100%;
margin-left: auto;
margin-right: auto;
}
header section .form-check {
margin: 20px auto;
}
header section .input-submit button {
width: 100%;
}
header section div.buttons > a.fb-login,
header section div.buttons > a.slack-login {
width: 100%;
}
header section div.buttons > a.fb-login span,
header section div.buttons > a.slack-login span {
display: none;
}
footer nav ul li {
display: block;
}
footer nav ul li:nth-child(even) {
display: none;
}
}

View File

@@ -2,52 +2,114 @@
{% trans_default_domain 'FOSUserBundle' %} {% trans_default_domain 'FOSUserBundle' %}
{% block title %} - Sign up{% endblock %}
{% block fos_user_content %} {% block fos_user_content %}
<div class="wrapper"> <section class="header-content">
<div class="form-container"> <div class="logo">
<h1> Sign up </h1> <a href="{{ path('MineSeekerBundle_homepage') }}" target="_self">
<div class="db"> <img src="{{ asset('bundles/mineseeker/images/mine-logo-txt.png') }}" alt="MineSeeker Logo w/ Txt"
<form action="{{ path('fos_user_registration_register') }}" border="0"/>
method="post"> </a>
<div> </div>
{{ form_widget(form.email, {'attr': {'placeholder': 'Email', 'class': 'form-input form-username'}}) }} <h1> Sign up </h1>
{{ form_errors(form.email) }} <div class="db">
</div> <form action="{{ path('fos_user_registration_register') }}"
method="post">
{{ form_widget(form._token) }}
<div> {% if form_errors(form) is not empty %}
{{ form_widget(form.username, {'attr': {'placeholder': 'Username ', 'class': 'form-input form-username'}}) }} <div class="failure-main">
{{ form_errors(form.username) }} <i class="fa fa-exclamation-circle"></i> {{ form_errors(form) }}
</div> </div>
{% endif %}
<div> <div>
{{ form_widget(form.plainPassword.first, {'attr': {'placeholder': 'Password', 'class': 'form-input form-username'}}) }} {{ form_widget(form.email, {'attr': {'placeholder': 'Email', 'class': 'form-input form-username'}}) }}
{{ form_errors(form.plainPassword.first) }} {% if form_errors(form.email) is not empty %}
</div> <div class="failure">
<i class="fa fa-exclamation-circle"></i> {{ form_errors(form.email) }}
</div>
{% endif %}
</div>
<div> <div>
{{ form_widget(form.plainPassword.second, {'attr': {'placeholder': 'Repeat password', 'class': 'form-input'}}) }} {{ form_widget(form.username, {'attr': {'placeholder': 'Username ', 'class': 'form-input form-username'}}) }}
{{ form_errors(form.plainPassword.second) }} {% if form_errors(form.username) is not empty %}
</div> <div class="failure">
<i class="fa fa-exclamation-circle"></i> {{ form_errors(form.username) }}
</div>
{% endif %}
</div>
<div class="input-submit"> <div>
<button type="submit" id="_submit" name="_submit"> {{ form_widget(form.plainPassword.first, {'attr': {'placeholder': 'Password', 'class': 'form-input form-username'}}) }}
<i class="fa fa-check"></i> {% if form_errors(form.plainPassword.first) is not empty %}
</button> <div class="failure">
</div> <i class="fa fa-exclamation-circle"></i> {{ form_errors(form.plainPassword.first) }}
</form> </div>
</div> {% endif %}
<h2><u><b>or</b></u> enter w/ your Facebook's e-mail</h2> </div>
<div class="fb">
{% include('@JotunheimrUser/Social/facebook.html.twig') %} <div>
</div> {{ form_widget(form.plainPassword.second, {'attr': {'placeholder': 'Repeat password', 'class': 'form-input'}}) }}
{% if form_errors(form.plainPassword.second) is not empty %}
<div class="failure">
<i class="fa fa-exclamation-circle"></i> {{ form_errors(form.plainPassword.second) }}
</div>
{% endif %}
</div>
<div class="input-submit">
<button type="submit" id="_submit" name="_submit">
<i class="fa fa-check"></i>
</button>
</div>
</form>
</div>
<h3 class="or">or login <u>w/ one click</u></h3>
<div class="buttons">
{% include('@JotunheimrUser/Social/facebook.html.twig') %}
{#<a class="slack-login"#}
{#href="https://slack.com/oauth/authorize?scope=identity.basic,identity.email,identity.team,identity.avatar&client_id=107639806167.106953365090&redirect_uri=http://mine.dev">#}
{#<i class="fa fa-slack"></i><span>w/ Slack</span>#}
{#</a>#}
</div>
<img src="{{ asset('bundles/mineseeker/images/mine-logo-logo.png') }}" alt="MineSeeker Logo" border="0"/>
</section>
{% endblock fos_user_content %}
{% block body %}
<div class="txt">
<div class="technologies">
<h1>Used technologies</h1>
<img src="{{ asset('bundles/mineseeker/images/technologies/websocket.png') }}" alt="Used Websocket" border="0"/>
<img src="{{ asset('bundles/mineseeker/images/technologies/react.png') }}" alt="Used React.js" border="0"/>
<img src="{{ asset('bundles/mineseeker/images/technologies/symfony.png') }}" alt="Used Symfony" border="0"/>
<img src="{{ asset('bundles/mineseeker/images/technologies/jquery.png') }}" alt="Used jQuery" border="0"/>
<img src="{{ asset('bundles/mineseeker/images/technologies/lets-encrypt.png') }}" alt="Used Let's Encrypt" border="0"/>
</div> </div>
</div> </div>
{% endblock fos_user_content %} {% endblock %}
{% block footer %}
<nav>
<ul>
<li><a href="{{ path('MineSeekerBundle_homepage') }}">Homepage</a></li>
<li>&middot;</li>
<li><a href="{{ path('MineSeekerBundle_terms') }}">Terms of Use</a></li>
<li>&middot;</li>
<li><a href="{{ path('MineSeekerBundle_privacy') }}">Privacy Policy</a></li>
<li>&middot;</li>
<li><a href="{{ path('MineSeekerBundle_contact') }}">Contact</a></li>
</ul>
</nav>
{% endblock %}
{% block javascripts %} {% block javascripts %}
{{ parent() }} {{ parent() }}
{% javascripts {% javascripts filter='?uglifyjs2'
'@JotunheimrUserBundle/Resources/public/js/register.js' %} '@JotunheimrUserBundle/Resources/public/js/register.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script> <script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %} {% endjavascripts %}
@@ -56,7 +118,7 @@
{% block stylesheets %} {% block stylesheets %}
{{ parent() }} {{ parent() }}
{% stylesheets filter='cssrewrite' {% stylesheets filter='?uglifycss'
'@JotunheimrUserBundle/Resources/public/css/font-awesome/css/font-awesome.min.css' '@JotunheimrUserBundle/Resources/public/css/font-awesome/css/font-awesome.min.css'
'@JotunheimrUserBundle/Resources/public/css/layout.css' %} '@JotunheimrUserBundle/Resources/public/css/layout.css' %}
<link rel="stylesheet" media="screen" href="{{ asset_url }}"/> <link rel="stylesheet" media="screen" href="{{ asset_url }}"/>

View File

@@ -2,55 +2,96 @@
{% trans_default_domain 'FOSUserBundle' %} {% trans_default_domain 'FOSUserBundle' %}
{% block title %} - Sign in{% endblock %}
{% block fos_user_content %} {% block fos_user_content %}
{% if error %} {% if error %}
{{ error.messageKey|trans(error.messageData, 'security') }} {{ error.messageKey|trans(error.messageData, 'security') }}
{% endif %} {% endif %}
<div class="wrapper"> <section class="header-content">
<div class="form-container"> <div class="logo">
<h1>Sign in</h1> <a href="{{ path('MineSeekerBundle_homepage') }}" target="_self">
<div class="db"> <img src="{{ asset('bundles/mineseeker/images/mine-logo-txt.png') }}" alt="MineSeeker Logo w/ Txt"
<form action="{{ path("fos_user_security_check") }}" method="post" border="0"/>
class="ac-custom ac-checkbox ac-boxfill"> </a>
<input type="hidden" name="_csrf_token" value="{{ csrf_token }}"/> </div>
<h1>Sign in</h1>
<form action="{{ path("fos_user_security_check") }}" method="post"
class="ac-custom ac-checkbox ac-boxfill">
<div> {% if csrf_token %}
<input type="text" id="username" name="_username" value="{{ last_username }}" <input type="hidden" name="_csrf_token" value="{{ csrf_token }}"/>
class="form-input form-username" {% endif %}
placeholder="Username or Email"/>
</div>
<div> {% if error %}
<input type="password" id="password" name="_password" <div class="failure-main">
class="form-input" <i class="fa fa-exclamation-circle"></i> <strong>Login error!</strong> {{ error.messageKey|trans({}, 'messages') }}
placeholder="Password"/> </div>
</div> {% endif %}
<div class="form-check"> <input type="text" id="username" name="_username" value="{{ last_username }}"
<input type="checkbox" id="remember-me" name="_remember_me" value="on"/> class="form-input form-username"
<label for="remember-me">{{ 'security.login.remember_me'|trans }}</label> placeholder="Username or Email"/>
</div>
<div class="input-submit"> <input type="password" id="password" name="_password"
<button type="submit" id="_submit" name="_submit"> class="form-input"
<i class="fa fa-check"></i> placeholder="Password"/>
</button>
</div> <div class="form-check">
</form> <input type="checkbox" id="remember-me" name="_remember_me" value="on"/>
<label for="remember-me">{{ 'security.login.remember_me'|trans }}</label>
</div> </div>
<h2><u><b>or</b></u> enter w/ your Facebook's e-mail</h2>
<div class="fb"> <div class="input-submit">
{% include('@JotunheimrUser/Social/facebook.html.twig') %} <button type="submit" id="_submit" name="_submit">
<i class="fa fa-check"></i>
</button>
</div> </div>
</form>
<h3 class="or">or login <u>w/ one click</u></h3>
<div class="buttons">
{% include('@JotunheimrUser/Social/facebook.html.twig') %}
{#<a class="slack-login"#}
{#href="https://slack.com/oauth/authorize?scope=identity.basic,identity.email,identity.team,identity.avatar&client_id=107639806167.106953365090&redirect_uri=http://mine.dev">#}
{#<i class="fa fa-slack"></i><span>w/ Slack</span>#}
{#</a>#}
</div>
<img src="{{ asset('bundles/mineseeker/images/mine-logo-logo.png') }}" alt="MineSeeker Logo" border="0"/>
</section>
{% endblock fos_user_content %}
{% block body %}
<div class="txt">
<div class="technologies">
<h1>Used technologies</h1>
<img src="{{ asset('bundles/mineseeker/images/technologies/websocket.png') }}" alt="Used Websocket" border="0"/>
<img src="{{ asset('bundles/mineseeker/images/technologies/react.png') }}" alt="Used React.js" border="0"/>
<img src="{{ asset('bundles/mineseeker/images/technologies/symfony.png') }}" alt="Used Symfony" border="0"/>
<img src="{{ asset('bundles/mineseeker/images/technologies/jquery.png') }}" alt="Used jQuery" border="0"/>
<img src="{{ asset('bundles/mineseeker/images/technologies/lets-encrypt.png') }}" alt="Used Let's Encrypt" border="0"/>
</div> </div>
</div> </div>
{% endblock fos_user_content %} {% endblock %}
{% block footer %}
<nav>
<ul>
<li><a href="{{ path('MineSeekerBundle_homepage') }}">Homepage</a></li>
<li>&middot;</li>
<li><a href="{{ path('MineSeekerBundle_terms') }}">Terms of Use</a></li>
<li>&middot;</li>
<li><a href="{{ path('MineSeekerBundle_privacy') }}">Privacy Policy</a></li>
<li>&middot;</li>
<li><a href="{{ path('MineSeekerBundle_contact') }}">Contact</a></li>
</ul>
</nav>
{% endblock %}
{% block javascripts %} {% block javascripts %}
{{ parent() }} {{ parent() }}
{% javascripts {% javascripts filter='?uglifyjs2'
'@JotunheimrUserBundle/Resources/public/js/register.js' '@JotunheimrUserBundle/Resources/public/js/register.js'
'@JotunheimrUserBundle/Resources/public/js/svgcheckbox.js' %} '@JotunheimrUserBundle/Resources/public/js/svgcheckbox.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script> <script type="text/javascript" src="{{ asset_url }}"></script>
@@ -60,7 +101,7 @@
{% block stylesheets %} {% block stylesheets %}
{{ parent() }} {{ parent() }}
{% stylesheets filter='cssrewrite' {% stylesheets filter='?uglifycss'
'@JotunheimrUserBundle/Resources/public/css/font-awesome/css/font-awesome.min.css' '@JotunheimrUserBundle/Resources/public/css/font-awesome/css/font-awesome.min.css'
'@JotunheimrUserBundle/Resources/public/css/svgcheckbox.css' %} '@JotunheimrUserBundle/Resources/public/css/svgcheckbox.css' %}
<link rel="stylesheet" media="screen" href="{{ asset_url }}"/> <link rel="stylesheet" media="screen" href="{{ asset_url }}"/>

View File

@@ -1,36 +1,3 @@
<script> <a id="fbLogin" class="fb-login">
window.fbAsyncInit = function () { <i class="fa fa-facebook"></i><span>w/ Facebook</span>
FB.init({ </a>
appId: '320599508311862',
xfbml: true,
version: 'v2.8'
});
};
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {
return;
}
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
function fbLogin() {
FB.getLoginStatus(function (response) {
if (response.status === 'connected') {
document.location = "{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}";
} else {
FB.login(function (response) {
if (response.authResponse) {
document.location = "{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}";
}
}, {scope: 'email'});
}
});
}
</script>
<a class="fb-login" href="#" onclick="fbLogin();"><i class="fa fa-facebook"></i></a>

View File

@@ -1,53 +1,57 @@
<!doctype html> {% extends '::base.html.twig' %}
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{% block title %}{{ project_name }} Admin - Login{% endblock %}</title>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
{% block stylesheets %}
{% stylesheets filter='cssrewrite'
'@JotunheimrUserBundle/Resources/public/css/layout.css'
'@JotunheimrAdminBundle/Resources/public/js/vendor/bootstrap/css/bootstrap.min.css' %}
<link rel="stylesheet" media="screen" href="{{ asset_url }}"/>
{% endstylesheets %}
{% endblock %}
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}"/>
<link href="https://fonts.googleapis.com/css?family=Gloria+Hallelujah" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body> {% block stylesheets %}
{{ parent() }}
{% if app.request.hasPreviousSession %} {% stylesheets filter='?uglifycss'
{% for type, messages in app.session.flashbag.all() %} '@JotunheimrAdminBundle/Resources/public/js/vendor/bootstrap/css/bootstrap.min.css'
{% for message in messages %} '@MineSeekerBundle/Resources/public/css/style.homepage.css'
<div class="flash-{{ type }}"> '@JotunheimrUserBundle/Resources/public/css/layout.css' %}
{{ message }} <link rel="stylesheet" media="screen" href="{{ asset_url }}"/>
</div> {% endstylesheets %}
{% endfor %}
{% endfor %}
{% endif %}
<main> <link href="https://fonts.googleapis.com/css?family=Rajdhani:300,400,500,600,700&amp;subset=latin-ext"
{% block fos_user_content %}{% endblock fos_user_content %} rel="stylesheet">
<canvas id="demo-canvas"></canvas>
</main>
{% block javascripts %}
{% javascripts
'@JotunheimrAdminBundle/Resources/public/js/vendor/plugins/jQuery/jquery-3.0.0.min.js'
'@JotunheimrAdminBundle/Resources/public/js/vendor/plugins/jQuery/jquery-migrate-3.0.0.min.js'
'@JotunheimrAdminBundle/Resources/public/js/vendor/bootstrap/js/bootstrap.min.js'
'@JotunheimrUserBundle/Resources/public/js/circle.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock %} {% endblock %}
</body> {% block bodyTop %}
</html> {% if app.request.hasPreviousSession %}
{% for type, messages in app.session.flashbag.all() %}
{% for message in messages %}
<div class="flash-{{ type }}">
{{ message }}
</div>
{% endfor %}
{% endfor %}
{% endif %}
{% endblock %}
{% block header %}
{% block fos_user_content %}{% endblock fos_user_content %}
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/JQuery-Snowfall/1.7.4/snowfall.jquery.min.js"
type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$(document).snowfall({deviceorientation: true, round: true, minSize: 5, maxSize: 8});
$('#fbLogin').length && $('#fbLogin').on('click', function () {
FB.getLoginStatus(function (response) {
if (response.status === 'connected') {
document.location = "{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}";
} else {
FB.login(function (response) {
if (response.authResponse) {
document.location = "{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}";
}
}, {scope: '{{ facebook_scope }}'});
}
});
});
});
</script>
{% endblock %}

View File

@@ -74,8 +74,8 @@ class MyFOSUBUserProvider extends BaseFOSUBProvider
$user->setFacebookId($response->getUsername()); $user->setFacebookId($response->getUsername());
$user->setEmail($response->getEmail()); $user->setEmail($response->getEmail());
$user->setEmailCanonical($response->getEmail()); $user->setEmailCanonical($response->getEmail());
$user->setUsername($this->slugify($response->getRealName())); $user->setUsername($this->slug($response->getRealName()));
$user->setUsernameCanonical($this->slugify($response->getRealName())); $user->setUsernameCanonical($this->slug($response->getRealName()));
$user->setRealName($response->getRealName()); $user->setRealName($response->getRealName());
$user->setNickName($response->getNickname()); $user->setNickName($response->getNickname());
if ($empty) { if ($empty) {
@@ -88,25 +88,11 @@ class MyFOSUBUserProvider extends BaseFOSUBProvider
} }
/** /**
* @param $text * @param $string
* @return mixed|string * @return string
*/ */
private function slugify($text) private function slug($string)
{ {
$text = preg_replace('#[^\\pL\d]+#u', '-', $text); return strtolower(trim(preg_replace('~[^0-9a-z]+~i', '-', html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities($string, ENT_QUOTES, 'UTF-8')), ENT_QUOTES, 'UTF-8')), '-'));
$text = trim($text, '-');
if (function_exists('iconv')) {
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
}
$text = strtolower($text);
$text = preg_replace('#[^-\w]+#', '', $text);
if (empty($text)) {
return 'n-a';
}
return $text;
} }
} }

View File

@@ -2,24 +2,70 @@
namespace Mine\SeekerBundle\Controller; namespace Mine\SeekerBundle\Controller;
//use CL\Slack\Payload\ChatPostMessagePayload;
//use CL\Slack\Payload\UsersListPayload;
//use CL\Slack\Transport\ApiClient;
use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class GameController extends Controller class GameController extends Controller
{ {
public function indexAction() public function indexAction()
{ {
// $apiClient = new ApiClient('xoxp-107639806167-107029084564-115427085733-cccaa4f96c89c87ce680c7f22acfd001');
//
// $usersListPayload = new UsersListPayload();
// $usersList = $apiClient->send($usersListPayload);
//
// dump($usersList);
//
// $payload = new ChatPostMessagePayload();
// $payload->setChannel('#general');
// $payload->setAsUser(true);
// $payload->setText('Hello world!');
// $response = $apiClient->send($payload);
// if ($response->isOk()) {
// dump('bazmeg');
// } else {
// dump($response->getError());
// dump($response->getErrorExplanation());
// }
return $this->render('MineSeekerBundle:Game:index.html.twig'); return $this->render('MineSeekerBundle:Game:index.html.twig');
} }
public function playAction() public function playAction(Request $request)
{ {
return $this->render('MineSeekerBundle:Game:play.html.twig', array( return $this->render('MineSeekerBundle:Game:play.html.twig', array(
'env' => $this->container->getParameter('kernel.environment') 'env' => $this->container->getParameter('kernel.environment'),
'ssl' => $request->isSecure() ? 'true' : 'false'
)); ));
} }
public function listAction() public function slackAction(Request $request)
{ {
return $this->render('MineSeekerBundle:Game:list.html.twig');
}
public function privacyAction()
{
return $this->render('MineSeekerBundle:Official:privacy.html.twig');
}
public function termsAction()
{
return $this->render('MineSeekerBundle:Official:terms.html.twig');
}
public function contactAction()
{
return $this->render('MineSeekerBundle:Official:contact.html.twig');
}
public function landingAction()
{
return $this->render('MineSeekerBundle:Official:landing.html.twig');
} }
} }

View File

@@ -74,6 +74,13 @@ class Gamer
*/ */
private $userAgent; private $userAgent;
/**
* @var \DateTime
*
* @ORM\Column(name="conn_timestamp", type="datetime", nullable=false)
*/
private $connTimestamp;
/** /**
* Get id * Get id
@@ -180,4 +187,28 @@ class Gamer
{ {
return $this->userAgent; return $this->userAgent;
} }
/**
* Set connTimestamp
*
* @param \DateTime $connTimestamp
*
* @return Gamer
*/
public function setConnTimestamp($connTimestamp)
{
$this->connTimestamp = $connTimestamp;
return $this;
}
/**
* Get connTimestamp
*
* @return \DateTime
*/
public function getConnTimestamp()
{
return $this->connTimestamp;
}
} }

View File

@@ -74,6 +74,13 @@ class Gamer
*/ */
private $userAgent; private $userAgent;
/**
* @var \DateTime
*
* @ORM\Column(name="conn_timestamp", type="datetime", nullable=false)
*/
private $connTimestamp;
/** /**
* Get id * Get id
@@ -180,4 +187,28 @@ class Gamer
{ {
return $this->userAgent; return $this->userAgent;
} }
/**
* Set connTimestamp
*
* @param \DateTime $connTimestamp
*
* @return Gamer
*/
public function setConnTimestamp($connTimestamp)
{
$this->connTimestamp = $connTimestamp;
return $this;
}
/**
* Get connTimestamp
*
* @return \DateTime
*/
public function getConnTimestamp()
{
return $this->connTimestamp;
}
} }

View File

@@ -105,6 +105,20 @@ class PlayedGame
*/ */
private $resign; private $resign;
/**
* @var \DateTime
*
* @ORM\Column(name="created", type="datetime", nullable=true)
*/
private $created;
/**
* @var \DateTime
*
* @ORM\Column(name="updated", type="datetime", nullable=true)
*/
private $updated;
/** /**
* @var Step * @var Step
* *
@@ -429,4 +443,52 @@ class PlayedGame
{ {
return $this->resign; return $this->resign;
} }
/**
* Set created
*
* @param \DateTime $created
*
* @return PlayedGame
*/
public function setCreated($created)
{
$this->created = $created;
return $this;
}
/**
* Get created
*
* @return \DateTime
*/
public function getCreated()
{
return $this->created;
}
/**
* Set updated
*
* @param \DateTime $updated
*
* @return PlayedGame
*/
public function setUpdated($updated)
{
$this->updated = $updated;
return $this;
}
/**
* Get updated
*
* @return \DateTime
*/
public function getUpdated()
{
return $this->updated;
}
} }

View File

@@ -105,6 +105,20 @@ class PlayedGame
*/ */
private $resign; private $resign;
/**
* @var \DateTime
*
* @ORM\Column(name="created", type="datetime", nullable=true)
*/
private $created;
/**
* @var \DateTime
*
* @ORM\Column(name="updated", type="datetime", nullable=true)
*/
private $updated;
/** /**
* @var Step * @var Step
* *
@@ -405,4 +419,28 @@ class PlayedGame
{ {
return $this->step; return $this->step;
} }
/**
* Set resign
*
* @param string $resign
*
* @return PlayedGame
*/
public function setResign($resign)
{
$this->resign = $resign;
return $this;
}
/**
* Get resign
*
* @return string
*/
public function getResign()
{
return $this->resign;
}
} }

View File

@@ -49,6 +49,13 @@ class Step
*/ */
private $playedGame; private $playedGame;
/**
* @var \DateTime
*
* @ORM\Column(name="created", type="datetime", nullable=true)
*/
private $created;
/** /**
* Get id * Get id
@@ -155,4 +162,28 @@ class Step
{ {
return $this->wBomb; return $this->wBomb;
} }
/**
* Set created
*
* @param \DateTime $created
*
* @return Step
*/
public function setCreated($created)
{
$this->created = $created;
return $this;
}
/**
* Get created
*
* @return \DateTime
*/
public function getCreated()
{
return $this->created;
}
} }

View File

@@ -49,6 +49,13 @@ class Step
*/ */
private $playedGame; private $playedGame;
/**
* @var \DateTime
*
* @ORM\Column(name="created", type="datetime", nullable=true)
*/
private $created;
/** /**
* Get id * Get id

View File

@@ -0,0 +1,36 @@
<?php
namespace Mine\SeekerBundle\Periodic;
use Gos\Bundle\WebSocketBundle\Periodic\PdoPeriodicPing;
use Gos\Bundle\WebSocketBundle\Periodic\PeriodicInterface;
use PDO;
class MinePeriodic implements PeriodicInterface
{
/** @var PdoPeriodicPing */
private $ping;
public function __construct(PdoPeriodicPing $ping)
{
$this->ping = $ping;
}
/**
* This function is executed every 5 seconds.
*
* For more advanced functionality, try injecting a Topic Service to perform actions on your connections every x seconds.
*/
public function tick()
{
$this->ping->tick();
}
/**
* {@inheritdoc}
*/
public function getTimeout()
{
return 300;
}
}

View File

@@ -1,19 +1,14 @@
# PDO Session Handler Configuration !!!!! --> moved to main config.yml
#framework:
# session:
# handler_id: session.handler.pdo
# Doctrine cache --> instead of PREDIS (gos_web_socket > client > storage > driver) # Doctrine cache --> instead of PREDIS (gos_web_socket > client > storage > driver)
#doctrine_cache: doctrine_cache:
# providers: providers:
# redis_cache: redis_cache:
# redis: redis:
# host: localhost host: localhost
# port: 6379 port: 6379
# database: 3 database: 3
# websocket_cache_client: websocket_cache_client:
# type: redis type: redis
# alias: gos_web_socket.client_storage.driver.redis alias: gos_web_socket.client_storage.driver.redis
# SNC # SNC
snc_redis: snc_redis:
@@ -32,7 +27,7 @@ snc_redis:
gos_web_socket: gos_web_socket:
server: server:
host: 0.0.0.0 host: 0.0.0.0
port: 6450 port: "%mineseeker.websocket%"
router: router:
resources: resources:
- "@MineSeekerBundle/Resources/config/pubsub/routing.yml" - "@MineSeekerBundle/Resources/config/pubsub/routing.yml"
@@ -41,4 +36,7 @@ gos_web_socket:
session_handler: "@session.handler.pdo" session_handler: "@session.handler.pdo"
storage: storage:
driver: "@gos_web_socket.client_storage.driver.predis" driver: "@gos_web_socket.client_storage.driver.predis"
decorator: "@gos_web_socket.client_storage.doctrine.decorator" ttl: 28800 #(optionally) time to live if you use redis driver
prefix: client #(optionally) prefix if you use redis driver, create key "client:1" instead key "1"
periodic:
- "@mineseeker.periodic"

View File

@@ -1,16 +1,39 @@
MineSeekerBundle_homepage: MineSeekerBundle_homepage:
path: / path: /
defaults: { _controller: MineSeekerBundle:Game:index } defaults: { _controller: MineSeekerBundle:Game:index }
schemes: [https]
MineSeekerBundle_gamePlay: MineSeekerBundle_gamePlay:
path: /play path: /play
defaults: { _controller: MineSeekerBundle:Game:play } defaults: { _controller: MineSeekerBundle:Game:play }
schemes: [https]
MineSeekerBundle_gamePlayWId: MineSeekerBundle_gamePlayWId:
path: /play/{gameAssoc} path: /play/{gameAssoc}
defaults: { _controller: MineSeekerBundle:Game:play } defaults: { _controller: MineSeekerBundle:Game:play }
schemes: [https]
MineSeekerBundle_gameList: MineSeekerBundle_slack:
path: /list path: /slack
defaults: { _controller: MineSeekerBundle:Game:list } defaults: { _controller: MineSeekerBundle:Game:slack }
schemes: [https]
MineSeekerBundle_terms:
path: /terms-of-service
defaults: { _controller: MineSeekerBundle:Game:terms }
schemes: [https]
MineSeekerBundle_privacy:
path: /privacy-policy
defaults: { _controller: MineSeekerBundle:Game:privacy }
schemes: [https]
MineSeekerBundle_contact:
path: /contact
defaults: { _controller: MineSeekerBundle:Game:contact }
schemes: [https]
MineSeekerBundle_landing:
path: /landing-page
defaults: { _controller: MineSeekerBundle:Game:landing }
schemes: [https]

View File

@@ -1,5 +1,4 @@
services: services:
pdo: pdo:
class: PDO class: PDO
arguments: arguments:
@@ -20,11 +19,12 @@ services:
arguments: arguments:
- "@snc_redis.cache" - "@snc_redis.cache"
# config.yml --> gos_web_socket > storage > client > decorator mineseeker.periodic:
gos_web_socket.client_storage.doctrine.decorator: class: Mine\SeekerBundle\Periodic\MinePeriodic
class: Gos\Bundle\WebSocketBundle\Client\Driver\DoctrineCacheDriverDecorator tags:
- { name: gos_web_socket.periodic }
arguments: arguments:
- "@doctrine_cache.providers.doctrine.orm.default_result_cache" ping: '@gos_web_socket.pdo.periodic_ping'
mineseeker.topic_sample_service: mineseeker.topic_sample_service:
class: Mine\SeekerBundle\Topic\MineseekerTopic class: Mine\SeekerBundle\Topic\MineseekerTopic

View File

@@ -1,9 +1,3 @@
@import url('https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700|Ravi+Prakash&subset=latin-ext');
/*
font-family: 'Ravi Prakash', cursive;
font-family: 'Open Sans Condensed', sans-serif;
*/
* { * {
outline: none; outline: none;
padding: 0; padding: 0;
@@ -11,59 +5,93 @@ font-family: 'Open Sans Condensed', sans-serif;
} }
html, body { html, body {
background: #2C3E50; background: #ffffff;
display: block; display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
header { header {
background: rgba(255, 255, 255, 0.7) url('/bundles/mineseeker/images/homepage/header.jpg') no-repeat; background: #d1e8ff;
background-size: cover;
position: relative; position: relative;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
width: 100%; width: 100%;
height: 100%; height: 950px;
color: #ffffff; color: #ffffff;
overflow: hidden; overflow: hidden;
} }
header h1 { header section {
display: block; display: flex;
font: normal 72px 'Ravi Prakash', cursive; align-items: flex-start;
text-align: center; justify-content: flex-start;
line-height: 20px; flex-direction: column;
color: #ffa800; max-width: 1300px;
width: 100%;
height: 100%;
padding: 20px;
margin: 0 auto;
}
header section div.logo img {
width: 350px;
margin: 50px 0;
}
header section div.logo a {
display: block;
}
header section > img {
position: absolute;
width: 1300px;
height: 1300px;
right: -20%;
top: -10%;
z-index: 1;
}
header section > div {
z-index: 2; z-index: 2;
} }
header h3 { header section h1 {
display: block; font: bold 40px 'Rajdhani', sans-serif;
font: normal 32px 'Open Sans Condensed', sans-serif; color: #434242;
text-align: center; margin-bottom: 100px;
color: #ffcd02;
z-index: 2;
} }
header > a { header section h2 {
background: #e8e8e8; font: normal 32px 'Rajdhani', sans-serif;
color: #434242;
margin-top: 100px;
}
header section h3 {
display: block; display: block;
font: bold 22px 'Open Sans Condensed', sans-serif; font: bold 16px 'Rajdhani', sans-serif;
color: #434242;
margin-top: 10px;
}
header section h3 img {
width: 16px;
}
header section div.buttons > a {
background: #69788e;
display: table;
font: bold 32px 'Rajdhani', sans-serif;
text-transform: uppercase; text-transform: uppercase;
text-decoration: none; text-decoration: none;
color: #2C3E50; border: 5px solid #57667b;
padding: 10px 70px; color: #FFFFFF;
margin-top: 20px; padding: 25px 150px;
margin-bottom: 20px;
z-index: 2; -webkit-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 3px 5px rgba(0, 0, 0, 0.75);
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.75);
-webkit-border-radius: 3px; -webkit-border-radius: 3px;
border-radius: 3px; border-radius: 3px;
-webkit-transition: all 250ms ease-in-out; -webkit-transition: all 250ms ease-in-out;
@@ -72,36 +100,87 @@ header > a {
transition: all 250ms ease-in-out; transition: all 250ms ease-in-out;
} }
header > a:hover { header section div.buttons > a:hover {
background: #ffffff; background: #57667b;
-webkit-box-shadow: 0 7px 10px rgba(0, 0, 0, 0.75); -webkit-box-shadow: 0 7px 15px rgba(0, 0, 0, 0.2);
box-shadow: 0 7px 10px rgba(0, 0, 0, 0.75); box-shadow: 0 7px 15px rgba(0, 0, 0, 0.2);
-webkit-transition: all 250ms ease-in-out; -webkit-transition: all 250ms ease-in-out;
-moz-transition: all 250ms ease-in-out; -moz-transition: all 250ms ease-in-out;
-o-transition: all 250ms ease-in-out; -o-transition: all 250ms ease-in-out;
transition: all 250ms ease-in-out; transition: all 250ms ease-in-out;
} }
header > img { header section div.buttons > a.small {
position: absolute; background: #83aed9;
width: 50%; display: inline-block;
max-width: 1000px; font: bold 22px 'Rajdhani', sans-serif;
bottom: -25%; border: 1px solid #6890ba;
color: #FFFFFF;
padding: 10px;
-webkit-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
-webkit-transition: all 250ms ease-in-out;
-moz-transition: all 250ms ease-in-out;
-o-transition: all 250ms ease-in-out;
transition: all 250ms ease-in-out;
z-index: 1;
} }
@media screen and (max-width: 1500px) { header section div.buttons > a.small:hover {
header > img { background: #86b5e1;
width: 60%; border: 1px solid #658fb8;
bottom: -40%; color: #FFFFFF;
-webkit-box-shadow: 0 7px 15px rgba(0, 0, 0, 0.2);
box-shadow: 0 7px 15px rgba(0, 0, 0, 0.2);
-webkit-transition: all 250ms ease-in-out;
-moz-transition: all 250ms ease-in-out;
-o-transition: all 250ms ease-in-out;
transition: all 250ms ease-in-out;
}
@media screen and (max-width: 1100px) {
header section {
align-items: center;
justify-content: center;
text-align: center;
}
header section div.buttons > a {
margin: 0 auto 20px auto;
}
header section h1 {
margin-bottom: 20px;
}
header section div.logo img {
margin-bottom: 0;
}
header section > img {
display: none;
} }
} }
@media screen and (max-width: 1500px) { @media screen and (max-width: 500px) {
header > img { /*header {*/
width: 70%; /*min-height: 100%;*/
bottom: -20%; /*height: auto;*/
/*}*/
header section {
width: auto;
} }
}
header section div.logo img {
width: 100%;
}
header section div.buttons > a {
display: block;
padding: 25px 5px;
}
}

View File

@@ -96,51 +96,37 @@ main {
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window h1 { #mine-wrapper .game-wrapper .game-overlay .game-overlay-window h1 {
font-weight: bold; font-weight: bold;
font-size: 32px; font-size: 26px;
} }
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window h2 { #mine-wrapper .game-wrapper .game-overlay .game-overlay-window h2 {
font-size: 18px; font-size: 18px;
} }
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window h3 {
font-size: 16px;
color: #386e8c;
}
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window .clippy { #mine-wrapper .game-wrapper .game-overlay .game-overlay-window .clippy {
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; width: 100%;
margin-bottom: 10px;
} }
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window .clippy input { #mine-wrapper .game-wrapper .game-overlay .game-overlay-window .clippy input {
border: 0; border: 0;
height: 40px; height: 40px;
width: 90%; width: 100%;
padding: 0 20px; padding: 0 20px;
-webkit-border-top-left-radius: 3px; -webkit-border-radius: 3px;
border-top-left-radius: 3px; border-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
border-bottom-left-radius: 3px;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075); -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075);
} }
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window .clippy button {
border: 0;
width: 10%;
height: 40px;
cursor: pointer;
-webkit-border-top-right-radius: 3px;
border-top-right-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
border-bottom-right-radius: 3px;
}
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window .clippy button img {
width: 15px;
height: 15px;
}
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window a { #mine-wrapper .game-wrapper .game-overlay .game-overlay-window a {
background: #d8e3ea; background: #d8e3ea;
display: inline-table; display: inline-table;
@@ -326,7 +312,6 @@ main {
color: #fdf612; color: #fdf612;
} }
#mine-wrapper .game-wrapper .users .user-container .user-control { #mine-wrapper .game-wrapper .users .user-container .user-control {
background: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.5) 0%, rgba(125, 185, 232, 0) 100%); background: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.5) 0%, rgba(125, 185, 232, 0) 100%);
background: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.5) 0%, rgba(125, 185, 232, 0) 100%); background: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.5) 0%, rgba(125, 185, 232, 0) 100%);
@@ -734,7 +719,7 @@ main {
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 642px; width: 643px;
border: 1px solid #cac3e5; border: 1px solid #cac3e5;
cursor: none; cursor: none;
@@ -973,3 +958,70 @@ main {
#mine-wrapper .grid .field-wrapper .field img { #mine-wrapper .grid .field-wrapper .field img {
width: 80%; width: 80%;
} }
.back-from-game {
display: inline-block;
position: fixed;
top: 20px;
left: 20px;
-ms-transform: scale(1); /* IE 9 */
-webkit-transform: scale(1); /* Safari */
transform: scale(1);
-webkit-transition: all 250ms cubic-bezier(.17, .67, .83, .67);
transition: all 250ms cubic-bezier(.17, .67, .83, .67);
}
.back-from-game img {
width: 100px;
}
.back-from-game:hover {
-ms-transform: scale(1.2); /* IE 9 */
-webkit-transform: scale(1.2); /* Safari */
transform: scale(1.2);
-webkit-transition: all 250ms cubic-bezier(.17, .67, .83, .67);
transition: all 250ms cubic-bezier(.17, .67, .83, .67);
}
@media screen and (max-width: 900px) {
#mine-wrapper .game-wrapper .users {
visibility: hidden;
display: none;
}
#mine-wrapper {
display: block;
width: 100%;
}
#mine-wrapper .game-wrapper {
width: 100%;
flex-direction: column-reverse;
}
#mine-wrapper .grid-container {
width: 100%;
padding: 0;
}
#mine-wrapper .grid {
width: 100%;
}
#mine-wrapper .grid .field-wrapper {
width: 6.25%;
}
#mine-wrapper .grid .field-wrapper > img.field-target {
width: 105%;
top: -2.5%;
left: -2.5%;
}
#mine-wrapper .grid .field-wrapper .field {
width: 100%;
height: auto;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#2d89ef</TileColor>
</tile>
</msapplication>
</browserconfig>

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,17 @@
{
"name": "",
"icons": [
{
"src": "\/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image\/png"
},
{
"src": "\/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image\/png"
}
],
"theme_color": "#ffffff",
"display": "standalone"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -0,0 +1,75 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.11, written by Peter Selinger 2001-2013
</metadata>
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M3149 4510 c-26 -4 -56 -13 -67 -19 -33 -18 -103 -102 -185 -222 -68
-101 -77 -119 -77 -159 1 -142 80 -271 198 -322 116 -50 347 -94 452 -86 74 5
110 35 141 117 32 85 61 236 62 331 2 76 -1 91 -26 138 -53 101 -159 181 -277
210 -66 16 -169 22 -221 12z m276 -59 c105 -47 168 -125 145 -181 -37 -89
-235 -64 -347 44 -44 44 -53 58 -53 88 0 22 7 41 20 53 41 37 146 35 235 -4z"/>
<path d="M1178 4417 c-157 -54 -300 -205 -353 -373 -17 -56 -18 -62 -2 -123
10 -35 54 -138 100 -229 91 -183 96 -188 210 -223 52 -16 87 -20 155 -17 119
5 161 27 288 153 112 111 186 207 239 306 44 84 46 128 7 190 -63 99 -318 303
-409 328 -64 18 -162 13 -235 -12z m127 -62 c96 -95 -122 -346 -299 -345 -86
1 -116 43 -90 130 20 68 114 168 196 210 81 40 157 42 193 5z"/>
<path d="M2420 4340 c-129 -12 -283 -44 -412 -87 -144 -47 -145 -48 -108 -101
16 -24 30 -48 32 -53 2 -6 34 2 73 17 215 81 317 99 551 98 l191 0 36 55 37
56 -31 6 c-56 12 -274 17 -369 9z"/>
<path d="M2555 4120 c-88 -4 -185 -12 -215 -19 -61 -13 -117 -43 -127 -67 -9
-23 34 -62 112 -101 89 -45 136 -82 160 -127 35 -64 4 -80 -316 -159 -276 -69
-430 -121 -572 -194 -240 -123 -414 -296 -503 -502 l-27 -62 24 -102 c19 -79
24 -130 24 -227 0 -140 -13 -182 -75 -253 l-32 -37 17 -103 c9 -56 23 -128 31
-161 8 -32 13 -60 10 -63 -6 -6 -74 209 -83 260 -3 21 -9 36 -12 35 -76 -35
-110 -56 -110 -68 -1 -44 121 -361 165 -427 l14 -23 48 34 c150 107 343 155
485 122 91 -21 167 -61 287 -152 170 -128 330 -299 395 -419 30 -57 33 -130 9
-201 -13 -39 -13 -48 -2 -55 18 -12 216 -11 318 1 47 6 131 20 187 31 l103 22
-6 66 c-5 56 -3 76 15 115 73 166 393 468 593 561 28 13 82 29 120 36 68 12
94 10 248 -18 23 -4 30 3 72 84 77 147 142 343 166 505 9 56 8 58 -24 89 -71
69 -157 283 -190 471 -13 75 -14 102 -4 154 20 105 86 199 199 285 l34 25 -53
80 c-29 43 -73 104 -98 134 -53 64 -194 210 -203 210 -3 0 -14 -29 -23 -64
-23 -82 -76 -168 -124 -198 -34 -21 -48 -23 -172 -23 -114 1 -153 5 -248 29
-63 15 -140 39 -173 51 -154 61 -237 173 -269 363 -6 39 -13 71 -13 70 -1 -1
-74 -4 -162 -8z m-585 -1285 c190 -109 351 -204 359 -211 13 -12 9 -20 -26
-61 -219 -261 -623 -198 -754 117 -19 45 -23 74 -23 160 -1 94 2 111 26 164
27 56 29 58 50 44 13 -8 178 -104 368 -213z m1648 67 c38 -279 -183 -517 -465
-499 -129 8 -251 73 -322 172 l-31 44 42 25 c24 13 196 113 383 220 l340 196
22 -48 c13 -27 27 -76 31 -110z"/>
<path d="M972 3323 c-39 -86 -102 -262 -102 -287 0 -9 110 -42 115 -33 1 1 14
40 29 87 15 47 47 127 72 179 24 52 42 96 39 99 -4 4 -104 42 -111 42 0 0 -19
-39 -42 -87z"/>
<path d="M4094 3357 c-62 -46 -102 -96 -130 -162 -41 -99 26 -390 126 -548 38
-60 79 -73 177 -56 79 14 214 59 294 99 91 47 159 172 159 295 -1 97 -52 235
-120 317 -37 45 -100 63 -286 83 -77 8 -144 15 -150 15 -7 0 -38 -19 -70 -43z
m535 -162 c74 -85 82 -272 14 -347 -9 -10 -30 -18 -49 -18 -113 0 -169 280
-77 382 27 31 76 23 112 -17z"/>
<path d="M695 2915 c-122 -26 -146 -36 -183 -73 -79 -79 -109 -201 -78 -322
36 -141 68 -166 269 -220 106 -28 118 -30 149 -17 58 25 116 75 145 124 26 45
28 55 27 153 0 180 -48 339 -106 359 -41 14 -149 13 -223 -4z m-128 -140 c97
-68 42 -354 -61 -316 -76 28 -86 226 -16 301 32 34 46 37 77 15z"/>
<path d="M4290 2500 c-14 -4 -41 -8 -61 -9 -41 -1 -49 -12 -49 -69 0 -128 -88
-443 -165 -592 -8 -16 -15 -31 -15 -34 0 -7 102 -78 106 -74 16 16 118 251
142 328 49 153 100 462 76 459 -5 -1 -20 -5 -34 -9z"/>
<path d="M1355 1779 c-42 -10 -188 -79 -218 -103 -37 -29 -166 -427 -174 -537
-5 -73 -4 -79 31 -145 90 -170 264 -315 432 -359 116 -30 277 -12 354 39 61
41 191 168 270 263 88 106 131 185 137 251 4 42 0 54 -37 112 -50 77 -256 285
-355 358 -38 29 -101 69 -140 89 -65 34 -77 37 -165 40 -52 1 -113 -2 -135 -8z
m-35 -711 c188 -57 343 -239 290 -339 -34 -63 -168 -66 -290 -8 -136 66 -230
171 -230 259 0 36 5 52 24 69 43 40 115 47 206 19z"/>
<path d="M3530 1767 c-76 -32 -149 -81 -256 -169 -162 -135 -324 -331 -324
-392 0 -101 135 -290 328 -461 119 -105 160 -120 317 -119 125 0 195 21 302
90 113 72 247 235 278 339 21 67 0 171 -83 410 l-68 198 -64 38 c-105 64 -163
82 -275 86 -87 3 -107 1 -155 -20z m481 -703 c52 -26 62 -81 27 -152 -32 -67
-116 -144 -204 -187 -62 -31 -91 -39 -152 -43 -88 -6 -133 12 -153 60 -35 84
79 232 233 303 101 46 185 53 249 19z"/>
<path d="M2855 984 c-121 -27 -308 -37 -438 -25 -67 7 -140 16 -162 21 -45 10
-49 8 -93 -54 l-32 -44 67 -15 c199 -45 524 -48 712 -8 51 11 95 22 97 24 5 5
-74 112 -84 113 -4 1 -34 -5 -67 -12z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 KiB

After

Width:  |  Height:  |  Size: 388 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 321 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 450 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -4,6 +4,7 @@ import MineSeeker from './mine-seeker/app';
ReactDOM.render( ReactDOM.render(
<MineSeeker env={document.getElementById('mine-wrapper').dataset.env} <MineSeeker env={document.getElementById('mine-wrapper').dataset.env}
gameId={document.getElementById('mine-wrapper').dataset.gameId}/>, gameId={document.getElementById('mine-wrapper').dataset.gameId}
ssl={document.getElementById('mine-wrapper').dataset.ssl}/>,
document.getElementById('mine-wrapper') document.getElementById('mine-wrapper')
); );

View File

@@ -11,13 +11,15 @@ class MineSeeker extends React.Component {
this.state = { this.state = {
env: props.env, env: props.env,
ssl: props.ssl,
gameInherited: props.gameId !== '', gameInherited: props.gameId !== '',
gameAssoc: gameAssoc, gameAssoc: gameAssoc,
channel: channel, channel: channel,
session: null, session: null,
createGrid: false, createGrid: false,
stepCache: [], stepCache: [],
disconnect: false connectionLost: false,
end: false
} }
} }
@@ -30,7 +32,24 @@ class MineSeeker extends React.Component {
return text; return text;
} }
/** STEP */ currectGridSize() {
let $field = $('#mine-wrapper .grid');
$field.height($field.width());
$field = $('#mine-wrapper .grid .field-wrapper');
$field.height($field.width());
$('#mine-wrapper .grid .field-wrapper .field')
.height($field.width())
.css('line-height', ($field.width() - 2) + 'px');
}
/**
* STEP
*
* @param coords
* @returns {{red: *, blue: *}}
*/
makePointsCalcAndStep(coords) { makePointsCalcAndStep(coords) {
let users = this.refs.gridControl.refs.userControl, let users = this.refs.gridControl.refs.userControl,
activePlayer = users.state.activePlayer ? 'blue' : 'red', activePlayer = users.state.activePlayer ? 'blue' : 'red',
@@ -51,7 +70,38 @@ class MineSeeker extends React.Component {
return {red: redPoints, blue: bluePoints}; return {red: redPoints, blue: bluePoints};
} }
/** THE END */ /**
* START
*
* @param payload
*/
makeGameStart(payload) {
/** every time the blue starts */
this.refs.gridControl.refs.userControl.setState({activePlayer: 1});
/** Set up player names w/ server data */
this.refs.gridControl.refs.userControl.refs.red.setState({
name: payload.users.red !== '' ? payload.users.red : payload.users.redAnon,
});
this.refs.gridControl.refs.userControl.refs.blue.setState({
name: payload.users.blue !== '' ? payload.users.blue : payload.users.blueAnon,
desc: this.refs.gridControl.state.webPlayer === 'blue'
? this.refs.gridControl.state.desc.you
: this.refs.gridControl.state.desc.buddy,
active: true,
});
this.refs.gridControl.setState({overlay: false});
}
/**
* THE END
*
* @param bluePoints
* @param redPoints
* @param resign
*/
makeGameEndIfItEnds(bluePoints, redPoints, resign = false) { makeGameEndIfItEnds(bluePoints, redPoints, resign = false) {
let redWins = redPoints > 25, let redWins = redPoints > 25,
blueWins = bluePoints > 25; blueWins = bluePoints > 25;
@@ -86,10 +136,13 @@ class MineSeeker extends React.Component {
: "You WIN!" : "You WIN!"
}); });
this.setState({end: true});
this.makeGameEndIfItEnds(0, 0, true); this.makeGameEndIfItEnds(0, 0, true);
} }
clickResign() { clickResign() {
/** PUBLISH */
this.state.session.publish(this.state.channel, { this.state.session.publish(this.state.channel, {
'resign': this.refs.gridControl.refs.userControl.state.activePlayer ? 'blue' : 'red' 'resign': this.refs.gridControl.refs.userControl.state.activePlayer ? 'blue' : 'red'
}); });
@@ -119,13 +172,34 @@ class MineSeeker extends React.Component {
} }
} }
/**
* @see https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus
* @see https://developers.facebook.com/docs/sharing/reference/send-dialog
* @see https://developers.facebook.com/docs/plugins/share-button/
*/
clickFBShare() {
let display = 'popup';
FB.getLoginStatus(function (response) {
display = response.status === 'connected'
? 'dialog'
: 'popup';
});
FB.ui({
method: 'send',
display: display,
link: window.location.href + '/' + this.state.gameAssoc,
});
}
wInit(session, gridServer, gridClient) { wInit(session, gridServer, gridClient) {
this.setState({session: session}); this.setState({session: session});
/** save session to GridControl */ /** save session to GridControl */
/** render grid fields - #12 */ /** render grid fields - @see #12 */
this.refs.gridControl.setState({ this.refs.gridControl.setState({
grid: this.state.gameInherited ? JSON.parse(Base64.decode(gridServer)) : gridClient, grid: this.state.gameInherited ? gridServer : gridClient,
channel: this.state.channel, channel: this.state.channel,
desc: { desc: {
buddy: <div> buddy: <div>
@@ -143,53 +217,51 @@ class MineSeeker extends React.Component {
overlaySubTitle: this.state.gameAssoc overlaySubTitle: this.state.gameAssoc
? ?
<div> <div>
<h3>Share this unique link w/ your opponent</h3>
<div className="clippy"> <div className="clippy">
<input id="foo" <input id="foo"
defaultValue={window.location.href + '/' + this.state.gameAssoc}/> defaultValue={window.location.href + '/' + this.state.gameAssoc}/>
<button className="btn">
<img src="/bundles/mineseeker/images/clippy.svg" alt="Copy to clipboard"/>
</button>
</div> </div>
{this.state.env !== 'dev' &&
<a onClick={this.clickFBShare.bind(this)}>Share in Facebook message</a>
}
{this.state.env === 'dev' &&
<a href={"/play/" + this.state.gameAssoc} target="_blank">Play w/ me!</a> <a href={"/play/" + this.state.gameAssoc} target="_blank">Play w/ me!</a>
}
</div> </div>
: '', : '',
renderGridFields: this.state.gameAssoc renderGridFields: this.state.gameAssoc
}); });
} }
wSubscribe(payload) { wSubscribe(payload, rpcUsers = null) {
this.state.env === 'dev' && console.info( this.state.env === 'dev' && console.info(
(typeof payload.user !== 'undefined' ? payload.user : 'user') + " has been subscribed to the channel!" (typeof payload.user !== 'undefined' ? payload.user : 'user') + " has been subscribed to the channel!"
); );
if (!this.state.disconnect) { let firstUser = !rpcUsers;
/** setup the web player */
null === this.refs.gridControl.state.webPlayer && this.refs.gridControl.setState({
webPlayer: payload.user === payload.users.blue || payload.user === payload.users.blueAnon
? 'blue'
: 'red'
});
/** every user has been came */ this.refs.gridControl.state.webPlayer === null && this.refs.gridControl.setState({
if (payload.userCnt === 2) { webPlayer: payload.user === payload.users.blue ||
/** every time the blue starts */ (
this.refs.gridControl.refs.userControl.setState({activePlayer: 1}); firstUser && payload.users.blueAnon !== '' ||
!firstUser && (rpcUsers.blueAnon === '' && rpcUsers.blue === '')
)
? 'blue' : 'red'
});
/** Set up player names w/ server data */ /** rwd */
this.refs.gridControl.refs.userControl.refs.red.setState({ (900 > $(document).width()) && this.currectGridSize();
name: payload.users.red !== '' ? payload.users.red : payload.users.redAnon,
});
this.refs.gridControl.refs.userControl.refs.blue.setState({ /** every user has been came */
name: payload.users.blue !== '' ? payload.users.blue : payload.users.blueAnon, if (
desc: this.refs.gridControl.state.webPlayer === 'blue' payload.userCnt === 2 &&
? this.refs.gridControl.state.desc.you (
: this.refs.gridControl.state.desc.buddy, !this.state.connectionLost ||
active: true, this.state.connectionLost && false === this.refs.gridControl.refs.userControl.state.activePlayer && !this.state.end
}); )
) {
this.refs.gridControl.setState({overlay: false}); this.makeGameStart(payload);
}
} }
} }
@@ -226,7 +298,7 @@ class MineSeeker extends React.Component {
} }
/** Connect - Subscribe */ /** Connect - Subscribe */
subscribe() { subscribe(rpcUsers = null) {
this.state.session.subscribe( this.state.session.subscribe(
this.state.channel, this.state.channel,
(uri, payload, log) => { (uri, payload, log) => {
@@ -238,30 +310,31 @@ class MineSeeker extends React.Component {
this.wTopic(payload); this.wTopic(payload);
} else { } else {
if (isNotUnsubscribe) { if (isNotUnsubscribe) {
this.wSubscribe(payload); this.wSubscribe(payload, rpcUsers);
} else { } else {
this.wUnsubscribe(payload); this.wUnsubscribe(payload);
} }
} }
/** RECONNECTION */ /** RECONNECTION */
if (payload.userCnt === 2 && this.state.disconnect) { if (payload.userCnt === 2 && this.state.connectionLost) {
this.state.env === 'dev' && console.info('Reconnection process'); this.state.env === 'dev' && console.info('Reconnection process');
/** PUBLISH */
let cache = this.state.stepCache; let cache = this.state.stepCache;
cache.forEach((item) => this.state.session.publish(this.state.channel, item)); cache.forEach((item) => this.state.session.publish(this.state.channel, item));
this.setState({disconnect: false, stepCache: []}); this.setState({connectionLost: false, stepCache: []});
} }
}); });
} }
/** after rendering */ connectWithWebsocket() {
componentDidMount() {
/** Create Websocket w/ Bahnhof.js */ /** Create Websocket w/ Bahnhof.js */
let websocket = WS.connect( let websocket = WS.connect(
this.state.env === 'dev' this.state.env === 'dev'
? "ws://mine.dev:6450" ? "ws://mine.dev:6450"
: "ws://www.mineseeker.ninja:6450" // : (this.state.ssl === 'true' ? "wss" : "ws") + "://" + window.location.hostname + ":6450/"
: (this.state.ssl === 'true' ? "wss" : "ws") + "://www.mineseeker.ninja:6450/"
); );
/** /**
@@ -271,7 +344,7 @@ class MineSeeker extends React.Component {
websocket.on("socket/connect", (session) => { websocket.on("socket/connect", (session) => {
this.state.env === 'dev' && console.info("Successfully connected to the Server!"); this.state.env === 'dev' && console.info("Successfully connected to the Server!");
if (!this.state.disconnect) { if (!this.state.connectionLost) {
let gridClient = this.state.gameInherited || new Grid().state.grid; let gridClient = this.state.gameInherited || new Grid().state.grid;
/** /**
@@ -284,11 +357,26 @@ class MineSeeker extends React.Component {
this.state.gameInherited ? this.state.gameAssoc : [Base64.encode(JSON.stringify(gridClient)), this.state.gameAssoc] this.state.gameInherited ? this.state.gameAssoc : [Base64.encode(JSON.stringify(gridClient)), this.state.gameAssoc]
) )
.then( .then(
(gridServer) => { (data) => {
this.state.env === 'dev' && console.info("Grid has been created! Return w/ gameAssoc."); this.state.env === 'dev' && console.info('RPC has been called');
this.wInit(session, gridServer, gridClient); let serverData = data[0] !== true
this.subscribe(); ? JSON.parse(Base64.decode(data))
: data;
/** Check the grid if the user is inherited @see #30 */
if ((this.state.gameInherited && null !== serverData.grid) || !this.state.gameInherited) {
this.wInit(session, serverData.grid, gridClient);
this.subscribe(this.state.gameInherited && serverData.users);
} else {
this.refs.gridControl.setState({
overlay: true,
overlayTitle: "This channel does not exists!",
overlaySubTitle: <a href={"/play"} target="_self">Restart game!</a>
});
console.error("This channel does not exists!");
}
}, },
(error, desc) => this.state.env === 'dev' && console.error(["RPC Error", error, desc]) (error, desc) => this.state.env === 'dev' && console.error(["RPC Error", error, desc])
); );
@@ -304,10 +392,19 @@ class MineSeeker extends React.Component {
*/ */
websocket.on("socket/disconnect", (error) => { websocket.on("socket/disconnect", (error) => {
this.state.env === 'dev' && console.error("Disconnected for " + error.reason + " with code " + error.code); this.state.env === 'dev' && console.error("Disconnected for " + error.reason + " with code " + error.code);
this.setState({disconnect: true});
error.code === 6 && this.setState({connectionLost: true});
error.code === 3 && setTimeout(function () {
this.componentDidMount();
}.bind(this), 500);
}); });
} }
/** After rendering */
componentDidMount() {
this.connectWithWebsocket();
}
/** /**
* Cache the steps unless reconnection * Cache the steps unless reconnection
* *
@@ -344,7 +441,7 @@ class MineSeeker extends React.Component {
}; };
/** PUBLISH */ /** PUBLISH */
!this.state.disconnect !this.state.connectionLost
? this.state.session.publish(this.state.channel, dataPack) ? this.state.session.publish(this.state.channel, dataPack)
: this.cachePublish(dataPack); : this.cachePublish(dataPack);
} }

View File

@@ -1,15 +1,117 @@
{% extends "::base.html.twig" %} {% extends "@MineSeeker/layout.html.twig" %}
{% block title %} - The Game{% endblock %}
{% block metas %}
<meta property="og:url" content="{{ url('MineSeekerBundle_homepage') }}"/>
<meta property="og:type" content="website"/>
<meta property="og:title" content="MineSeeker"/>
<meta property="og:description" content="A multiplayer minesweeper game"/>
<meta property="og:image"
content="{{ app.request.getSchemeAndHttpHost() }}{{ asset('bundles/mineseeker/images/mine-1600x627.png') }}"/>
{% endblock %}
{% block header %} {% block header %}
<h1>MineSeeker</h1> <section class="header-content">
<h3>version 1.0a</h3> <div class="logo">
<a href="{{ path('MineSeekerBundle_gamePlay') }}">Play now</a> <a href="{{ path('MineSeekerBundle_homepage') }}" target="_self">
<img src="{{ asset('bundles/mineseeker/images/homepage/mineseeker-2.png') }}" alt="" border="0"> <img src="{{ asset('bundles/mineseeker/images/mine-logo-txt.png') }}" alt="MineSeeker Logo w/ Txt"
border="0"/>
</a>
</div>
<div>
<div id="id_welcome"{% if app.user.facebookId is defined and app.user.facebookId is not null %} style="margin-bottom:50px"{% endif %}>
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
{% if app.user.facebookId is not null %}
<div>
<img src="http://graph.facebook.com/{{ app.user.facebookId }}/picture?type=square&width=100&height=100"
alt="Facebook profile" border="0"/>
</div>
{% endif %}
<div>
<h2{% if app.user.facebookId is defined and app.user.facebookId is not null %} style="margin-top:0"{% endif %}>
Hello, {{ app.user.realName is not null ? app.user.realName : app.user.username }}!
</h2>
<h1>Let's play!! :D</h1>
</div>
{% else %}
<div>
<h2>A minesweeper game rethought...</h2>
<h1>...and you can play w/o register!!</h1>
</div>
{% endif %}
</div>
<div class="buttons">
<a href="{{ path('MineSeekerBundle_gamePlay') }}">Play NOW!</a>
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
<a href="{{ path('fos_user_security_logout') }}" class="small">
{{ 'layout.logout'|trans({}, 'FOSUserBundle') }}
</a>
{% else %}
<a href="{{ path('fos_user_registration_register') }}" class="small">Sign up</a> &middot;
<a href="{{ path('fos_user_security_login') }}" class="small">Sign in</a>
{% endif %}
</div>
<h3>
version {{ version }} &middot; MineSeeker&copy;{{ "now"|date("Y") }} &middot; <a
href="http://www.laszlolang.com">www.laszlolang.com</a>
</h3>
</div>
<img src="{{ asset('bundles/mineseeker/images/mine-logo-logo.png') }}" alt="MineSeeker Logo" border="0"/>
</section>
{% endblock %}
{% block body %}
<div class="txt">
<div class="technologies">
<h1>Used technologies</h1>
<img src="{{ asset('bundles/mineseeker/images/technologies/websocket.png') }}" alt="Used Websocket"
border="0"/>
<img src="{{ asset('bundles/mineseeker/images/technologies/react.png') }}" alt="Used React.js" border="0"/>
<img src="{{ asset('bundles/mineseeker/images/technologies/symfony.png') }}" alt="Used Symfony" border="0"/>
<img src="{{ asset('bundles/mineseeker/images/technologies/jquery.png') }}" alt="Used jQuery" border="0"/>
<img src="{{ asset('bundles/mineseeker/images/technologies/lets-encrypt.png') }}" alt="Used Let's Encrypt"
border="0"/>
</div>
</div>
{% endblock %}
{% block footer %}
<nav>
<ul>
<li><a href="{{ path('MineSeekerBundle_homepage') }}">Homepage</a></li>
<li>&middot;</li>
<li><a href="{{ path('MineSeekerBundle_terms') }}">Terms of Use</a></li>
<li>&middot;</li>
<li><a href="{{ path('MineSeekerBundle_privacy') }}">Privacy Policy</a></li>
<li>&middot;</li>
<li><a href="{{ path('MineSeekerBundle_contact') }}">Contact</a></li>
</ul>
</nav>
{% endblock %} {% endblock %}
{% block stylesheets %} {% block stylesheets %}
{% stylesheets filter='cssrewrite' {{ parent() }}
'@MineSeekerBundle/Resources/public/css/style.homepage.css' %}
<link href="https://fonts.googleapis.com/css?family=Rajdhani:300,400,500,600,700&amp;subset=latin-ext"
rel="stylesheet">
{% stylesheets filter='?uglifycss'
'@JotunheimrAdminBundle/Resources/public/js/vendor/bootstrap/css/bootstrap.min.css'
'@MineSeekerBundle/Resources/public/css/style.homepage.css'
'@JotunheimrUserBundle/Resources/public/css/layout.css' %}
<link rel="stylesheet" media="screen" href="{{ asset_url }}" type="text/css"/> <link rel="stylesheet" media="screen" href="{{ asset_url }}" type="text/css"/>
{% endstylesheets %} {% endstylesheets %}
{% endblock %} {% endblock %}
{% block javascripts %}
{{ parent() }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/JQuery-Snowfall/1.7.4/snowfall.jquery.min.js"
type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$(document).snowfall({deviceorientation: true, round: true, minSize: 5, maxSize: 8});
});
</script>
{% endblock %}

Some files were not shown because too many files have changed in this diff Show More