diff --git a/game_sudoku/README.rst b/game_sudoku/README.rst new file mode 100644 index 000000000..06082ea2b --- /dev/null +++ b/game_sudoku/README.rst @@ -0,0 +1,20 @@ +Odoo Games - Sudoku v10 +======================= + The classic Sudoku game involves a grid of 81 squares. The grid is divided into nine blocks, +each containing nine squares. + The rules of the game are simple: +Each of the nine blocks has to contain all the numbers 1-9 within its squares. Each number can +only appear once in a row, column or box. + You can select the squares by clicking. Enter the numbers. + +Space button is use to erase the entry. + +Features +======== + +* We can play SUDOKU Game. +* Play only By the approval of HR Manager. + +Credits +======= +Nikhil Krishnan @ cybrosys, nikhil@cybrosys.in \ No newline at end of file diff --git a/game_sudoku/__init__.py b/game_sudoku/__init__.py new file mode 100644 index 000000000..db6e2e68e --- /dev/null +++ b/game_sudoku/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Nikhil krishnan() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +import models diff --git a/game_sudoku/__manifest__.py b/game_sudoku/__manifest__.py new file mode 100644 index 000000000..097112bae --- /dev/null +++ b/game_sudoku/__manifest__.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Nikhil krishnan() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +{ + 'name': 'Odoo Games - Sudoku', + 'version': '10.0.1.0.0', + 'summary': """Sudoku Game.""", + 'description': """We can play SUDOKU.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'http://www.cybrosys.com', + 'category': '', + 'depends': ['base', 'hr'], + 'license': 'LGPL-3', + 'data': [ + 'security/security_data.xml', + 'security/ir.model.access.csv', + 'views/game_approve_sequence.xml', + 'views/game_template.xml', + 'views/main_menu.xml', + 'views/sudoku_menu.xml', + ], + 'demo': [], + 'qweb': [ + "static/src/xml/sudoku.xml", + "static/src/xml/game.xml", + ], + 'images': ['static/description/banner.jpg'], + 'installable': True, + 'auto_install': False, +} diff --git a/game_sudoku/models/__init__.py b/game_sudoku/models/__init__.py new file mode 100644 index 000000000..b2afdd8b7 --- /dev/null +++ b/game_sudoku/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Nikhil krishnan() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +import game + diff --git a/game_sudoku/models/game.py b/game_sudoku/models/game.py new file mode 100644 index 000000000..8b8f50f04 --- /dev/null +++ b/game_sudoku/models/game.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Nikhil krishnan() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +from datetime import datetime +from odoo import models, fields, api + + +class EntertainmentGames(models.Model): + _name = 'employee.game.approve' + _inherit = ['ir.needaction_mixin'] + _order = 'sequence desc' + + name = fields.Char(string='Name', related='employee_id.name') + approve_datetime = fields.Datetime(string='Datetime', readonly=1) + employee_id = fields.Many2one('hr.employee', string='Employee', required=True) + user_id = fields.Many2one('res.users', string='User') + department_id = fields.Many2one('hr.department', string='Department', related='employee_id.department_id') + game_user = fields.Boolean(string='Is Game User') + state = fields.Selection([ + ('draft', 'Requested'), + ('approve', 'Approved'), + ('cancel', 'Cancelled'), + ], string='Status', readonly=True, copy=False, default='draft') + sequence = fields.Integer('Sequence') + + @api.model + def _needaction_domain_get(self): + return [('state', '=', 'draft')] + + def create_employee_game_approve(self, empl_id, user): + rec = self.search([('employee_id', '=', empl_id)]) + if rec: + seq = self.env['ir.sequence'].next_by_code('employee.game') + rec.write({'sequence': seq, 'state': 'draft', 'approve_datetime': datetime.now()}) + else: + vals = { + 'employee_id': empl_id, + 'user_id': user, + 'approve_datetime': datetime.now(), + 'sequence': self.env['ir.sequence'].next_by_code('employee.game') + } + self.create(vals) + + def approve(self): + group_game_approve = self.env.ref('game_sudoku.odoo_gamer_group', False) + group_game_approve.write({'users': [(4, self.user_id.id)]}) + + group_game_req = self.env.ref('game_sudoku.odoo_gamer_approve_req', False) + group_game_req.write({'users': [(3, self.user_id.id)]}) + + return self.write({'game_user': True, 'state': 'approve'}) + + def cancel(self): + group_game_approve = self.env.ref('game_sudoku.odoo_gamer_group', False) + group_game_approve.write({'users': [(3, self.user_id.id)]}) + + group_game_req = self.env.ref('game_sudoku.odoo_gamer_approve_req', False) + group_game_req.write({'users': [(4, self.user_id.id)]}) + + return self.write({'game_user': False, 'state': 'cancel'}) diff --git a/game_sudoku/security/ir.model.access.csv b/game_sudoku/security/ir.model.access.csv new file mode 100644 index 000000000..e4a1c9915 --- /dev/null +++ b/game_sudoku/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink + +access_game_gamer,employee.game.approve.user,game_sudoku.model_employee_game_approve,base.group_user,1,1,1,0 +access_game_gamer_manager,employee.game.approve.manager,game_sudoku.model_employee_game_approve,hr.group_hr_manager,1,1,1,1 diff --git a/game_sudoku/security/security_data.xml b/game_sudoku/security/security_data.xml new file mode 100644 index 000000000..5a6b4f142 --- /dev/null +++ b/game_sudoku/security/security_data.xml @@ -0,0 +1,26 @@ + + + + + Game + 10 + + + + + Odoo Gamer + + + + + Odoo Game Request + + + + + + + + + + diff --git a/game_sudoku/static/description/Game Request.png b/game_sudoku/static/description/Game Request.png new file mode 100644 index 000000000..f98af56af Binary files /dev/null and b/game_sudoku/static/description/Game Request.png differ diff --git a/game_sudoku/static/description/Just wait for approval.png b/game_sudoku/static/description/Just wait for approval.png new file mode 100644 index 000000000..410f2f4ec Binary files /dev/null and b/game_sudoku/static/description/Just wait for approval.png differ diff --git a/game_sudoku/static/description/Level.png b/game_sudoku/static/description/Level.png new file mode 100644 index 000000000..512e1ee5d Binary files /dev/null and b/game_sudoku/static/description/Level.png differ diff --git a/game_sudoku/static/description/May i play.png b/game_sudoku/static/description/May i play.png new file mode 100644 index 000000000..df84a5e2a Binary files /dev/null and b/game_sudoku/static/description/May i play.png differ diff --git a/game_sudoku/static/description/Sudoku.png b/game_sudoku/static/description/Sudoku.png new file mode 100644 index 000000000..f88651465 Binary files /dev/null and b/game_sudoku/static/description/Sudoku.png differ diff --git a/game_sudoku/static/description/banner.jpg b/game_sudoku/static/description/banner.jpg new file mode 100644 index 000000000..0fd479eb1 Binary files /dev/null and b/game_sudoku/static/description/banner.jpg differ diff --git a/game_sudoku/static/description/color code.png b/game_sudoku/static/description/color code.png new file mode 100644 index 000000000..d0e8465d0 Binary files /dev/null and b/game_sudoku/static/description/color code.png differ diff --git a/game_sudoku/static/description/cybro_logo.png b/game_sudoku/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/game_sudoku/static/description/cybro_logo.png differ diff --git a/game_sudoku/static/description/icon.png b/game_sudoku/static/description/icon.png new file mode 100644 index 000000000..e34faf824 Binary files /dev/null and b/game_sudoku/static/description/icon.png differ diff --git a/game_sudoku/static/description/index.html b/game_sudoku/static/description/index.html new file mode 100644 index 000000000..ba975e9d9 --- /dev/null +++ b/game_sudoku/static/description/index.html @@ -0,0 +1,192 @@ +
+
+

Odoo Games - Sudoku

+

Brain-Teaser game.!!

+

Cybrosys Technologies

+
+

Features:

+
    +
  •    We can play SUDOKU.
  • +
  •    Play only By the approval of HR Manager.
  • + +
+
+
+
+ +
+
+

How to start the game.?

+
+
+
+ +
+
+
+

+ To start playing the game, user should click the button () + for send a request. +

+
+
+

+ Wait for the approval of HR manager. +

+
+ +
+

+ A record is generated. And from the record the HR manager can give approval to play the game. +

+
+
+
+
+ +
+
+

Admin, please check with the user form to enable the option " Odoo Game Request".

+
+
+
+ +
+
+
+
+ Admin can directly give the permission to play the game. Just enable "Odoo Gamer" +

Ps:- if we directly give permission to play game, don't forget to remove Odoo Game Request"

+
+
+
+ +
+
+

Approve the game request by HR Manager

+
+
+
+ +
+
+
+

+ HR managers can see this request from the menu "Game Request" under Game. +

+

+ We can see 2 buttons here. +

+ 1.This icon( ) for approve the request +

+

+ 2. This icon () for avoid/cancel the request +

+

+

+ We can easily identify the states of the request by color. + +

    +
  • Red is in draft state.
  • +
+
    +
  • Green is in approve state.
  • +
+
    +
  • Grey is in cancel state.
  • +
+

+
+
+
+ +
+
+ +
+
+
+ +
+
+

SUDOKU

+
+ Click on the "New Game" button to start the game. +
+
+
+
+ +
+
+
+
+ Select your level of game. +
+
+
+
+ +
+
+
+
+ Let's play..!! +

+ The classic Sudoku game involves a grid of 81 squares. + The grid is divided into nine blocks, each containing nine squares. +

The rules of the game are simple:

+ each of the nine blocks should contain all the numbers 1-9 within its squares. + Each number can appear only once in a row, column or box. +

+

You can select the squares by clicking. Read the numbers from key boards.

+

Space button can be used to erase the entry.

+
+
+
+
+ +
+
+
+
+
+ +
+
+

WON the game

+
+
+
+ +
+
+
+
+
+ +
+

Need Any Help?

+ +
diff --git a/game_sudoku/static/description/sudoku 1.png b/game_sudoku/static/description/sudoku 1.png new file mode 100644 index 000000000..79a109806 Binary files /dev/null and b/game_sudoku/static/description/sudoku 1.png differ diff --git a/game_sudoku/static/description/user group.png b/game_sudoku/static/description/user group.png new file mode 100644 index 000000000..7a642d908 Binary files /dev/null and b/game_sudoku/static/description/user group.png differ diff --git a/game_sudoku/static/description/won.png b/game_sudoku/static/description/won.png new file mode 100644 index 000000000..a6beedf63 Binary files /dev/null and b/game_sudoku/static/description/won.png differ diff --git a/game_sudoku/static/src/css/sudoku.css b/game_sudoku/static/src/css/sudoku.css new file mode 100644 index 000000000..8e060911f --- /dev/null +++ b/game_sudoku/static/src/css/sudoku.css @@ -0,0 +1,283 @@ + +.o_entertainment_games_req_footer{ + display:none; +} +.sudokupage +{ + height: 650px; + width:100%; + background-color: #CDD5F4; +} +.sudokupage1 +{ + height: auto; + width:25%; + float: left; + margin-top: 250px; +} +.sudokupage2 +{ + height: 650px; + width:55%; + float: left; + background-color: #CDD5F4; +} +.sudokupage2 h3 +{ + color: red; + font-size: 28px; +} +.sudokupage2 h4 +{ + color: red; + font-size: 20px; +} +.sudokupage3 +{ + height: auto; + width:20%; + float:right; + background-color: #CDD5F4; +} + +.sudokunewbutton { + border-radius: 4px; + background-color: #4CAF50; + border: none; + color: #FFFFFF; + text-align: center; + font-size: 22px; + padding: 15px; + width: 170px; + height:55px; + transition: all 0.5s; + cursor: pointer; + margin: 5px; +} + +.sudokulevelbutton { + border-radius: 3px; + background-color: #4CAF50; + border: none; + color: #FFFFFF; + text-align: center; + font-size: 22px; + padding: 15px; + width: 170px; + height:55px; + transition: all 0.5s; + cursor: pointer; + margin: 5px; +} +.sudokulevelbuttonreset { + border-radius: 3px; + display: none; + background-color: #4CAF50; + border: none; + color: #FFFFFF; + text-align: center; + font-size: 22px; + padding: 15px; + width: 170px; + height:55px; + transition: all 0.5s; + cursor: pointer; + margin: 5px; +} +.sudokulevelbuttoncheck { + border-radius: 3px; + display: none; + background-color: #4CAF50; + border: none; + color: #FFFFFF; + text-align: center; + font-size: 22px; + padding: 15px; + width: 170px; + height:55px; + transition: all 0.5s; + cursor: pointer; + margin: 5px; +} +.sudokulevelbuttoncheckback { + border-radius: 3px; + display: none; + background-color: #4CAF50; + border: none; + color: #FFFFFF; + text-align: center; + font-size: 22px; + padding: 15px; + width: 170px; + height:55px; + transition: all 0.5s; + cursor: pointer; + margin: 5px; +} +.sudokulevelbuttonsolve { + border-radius: 3px; + display: none; + background-color: #4CAF50; + border: none; + color: #FFFFFF; + text-align: center; + font-size: 22px; + padding: 15px; + width: 170px; + height:55px; + transition: all 0.5s; + cursor: pointer; + margin: 5px; +} +.sudokulevelbutton1 { + border-radius: 3px; + background-color: #00b3b3; + border: none; + color: #FFFFFF; + text-align: center; + font-size: 22px; + padding: 15px; + width: 170px; + height:55px; + transition: all 0.5s; + cursor: pointer; + margin: 5px; +} +.sudokulevelbutton2 { + border-radius: 3px; + background-color: #00b3b3; + border: none; + color: #FFFFFF; + text-align: center; + font-size: 22px; + padding: 15px; + width: 170px; + height:55px; + transition: all 0.5s; + cursor: pointer; + margin: 5px; +} +.sudokulevelbutton3 { + border-radius: 3px; + background-color: #00b3b3; + border: none; + color: #FFFFFF; + text-align: center; + font-size: 22px; + padding: 15px; + width: 170px; + height:55px; + transition: all 0.5s; + cursor: pointer; + margin: 5px; +} + +.sudokulevelselection { + display: none; + position: fixed; + z-index: 1; + padding-top: 100px; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; /* Enable scroll if needed */ + background-color: rgb(0,0,0); /* Fallback color */ + background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ +} + + +.sudokulevelselection-content { + position: relative; + background-color: #fefefe; + margin: auto; + padding: 0; + border: 1px solid #888; + width: 80%; + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19); + -webkit-animation-name: animatetop; + -webkit-animation-duration: 0.4s; + animation-name: animatetop; + animation-duration: 0.4s +} + +@-webkit-keyframes animatetop { + from {top:-300px; opacity:0} + to {top:0; opacity:1} +} + +@keyframes animatetop { + from {top:-300px; opacity:0} + to {top:0; opacity:1} +} + + +.sudokulevelselectionclose { + color: white; + float: right; + font-size: 28px; + font-weight: bold; +} + +.sudokulevelselection:hover, +.sudokulevelselection:focus { + color: #000; + text-decoration: none; + cursor: pointer; +} + +.sudokulevelselection-header { + padding: 2px 16px; + background-color: #5cb85c; + color: white; +} + +.sudokulevelselection-body {padding: 2px 16px;} + +.sudokulevelselection-footer { + padding: 2px 16px; + background-color: #5cb85c; + color: white; +} + +table.sudoright td {width: 50px; height:80px; +font-weight: bold; +text-align: center +} +table.sudoright { +margin-top: 120px; +} +table.sudoku td {width: 55px; height:55px; +border-width: 1px; +border-style: solid; +border-color: black; +font-weight: bold; +text-align: center +} +table.sudoku { +border-width: 3px; +border-style: solid; +border-color:black; +} +table.sudoku td[id^=cell_0] {border-bottom-width: 3px;border-bottom-style: double;} +table.sudoku td[id^=cell_1] {border-bottom-width: 3px;border-bottom-style: double;} +table.sudoku td[id^=cell_2] {border-bottom-width: 3px} +table.sudoku td[id^=cell_3] {border-bottom-width: 3px;border-bottom-style: double;} +table.sudoku td[id^=cell_4] {border-bottom-width: 3px;border-bottom-style: double;} +table.sudoku td[id^=cell_5] {border-bottom-width: 3px} +table.sudoku td[id^=cell_6] {border-bottom-width: 3px;border-bottom-style: double;} +table.sudoku td[id^=cell_7] {border-bottom-width: 3px;border-bottom-style: double;} +table.sudoku td[id$=_0] {border-right-width: 3px;border-right-style: double;} +table.sudoku td[id$=_1] {border-right-width: 3px;border-right-style: double;} +table.sudoku td[id$=_2] {border-right-width: 3px} +table.sudoku td[id$=_3] {border-right-width: 3px;border-right-style: double;} +table.sudoku td[id$=_4] {border-right-width: 3px;border-right-style: double;} +table.sudoku td[id$=_5] {border-right-width: 3px} +table.sudoku td[id$=_6] {border-right-width: 3px;border-right-style: double;} +table.sudoku td[id$=_7] {border-right-width: 3px;border-right-style: double;} +td.selected {background-color: rgb(100%, 70%, 0%)} +td.tofill {color: blue;background-color: #f2ffde } +td.filled {color: blue;background-color: #c0ff96} +td.green{color:green;background-color: #fff} +td.red{color:red;background-color:#FC9E9E;border-color: red;border-width: 1.5px} +td.notfill {color: green;font-style:bold;background-color: #cac5c3;} \ No newline at end of file diff --git a/game_sudoku/static/src/img/application-switcher-bg.jpg b/game_sudoku/static/src/img/application-switcher-bg.jpg new file mode 100644 index 000000000..b42f07885 Binary files /dev/null and b/game_sudoku/static/src/img/application-switcher-bg.jpg differ diff --git a/game_sudoku/static/src/js/game.js b/game_sudoku/static/src/js/game.js new file mode 100644 index 000000000..8af1ad333 --- /dev/null +++ b/game_sudoku/static/src/js/game.js @@ -0,0 +1,49 @@ +odoo.define('game_sudoku.models_entertainment_game', function (require) { +"use strict"; + +var core = require('web.core'); +var Model = require('web.Model'); +var Widget = require('web.Widget'); + +var QWeb = core.qweb; +var _t = core._t; + +var MyGame = Widget.extend({ + events: { + "click .o_entertainment_games_log_in_icon": function() { + this.$('.o_entertainment_games_log_in_icon').attr("disabled", "disabled"); + this.$('.o_entertainment_games_req_footer').css('display', 'block'); + this.game_request(); + }, + }, + game_request: function(){ + new Model("employee.game.approve") + .call("create_employee_game_approve", [1, this.employee.id, this.user]) + }, + + start: function () { + var self = this; + + var hr_employee = new Model('hr.employee'); + hr_employee.query(['attendance_state', 'name']) + .filter([['user_id', '=', self.session.uid]]) + .all() + .then(function (res) { + if (_.isEmpty(res) ) { + self.$('.o_hr_attendance_employee').append(_t("Error : Could not find employee linked to user")); + return; + } + self.employee = res[0]; + self.user = self.session.uid + self.$el.html(QWeb.render("EntertainmentGamesMainMenu", {widget: self})); + }); + + return this._super.apply(this, arguments); + }, +}); + +core.action_registry.add('entertainment_games_my_game', MyGame); + +return MyGame; + +}); \ No newline at end of file diff --git a/game_sudoku/static/src/js/sudoku.js b/game_sudoku/static/src/js/sudoku.js new file mode 100644 index 000000000..582a9f399 --- /dev/null +++ b/game_sudoku/static/src/js/sudoku.js @@ -0,0 +1,1004 @@ +var maxAttempts=100; +var globb; +var check = 0 +var selected_cell_id; +var current_cell = null; +var sudokuboard = new Array(9); +var orginalboard = new Array(9); +var board = new Array(9); +Puzzle=new Array(9); +maxAttempts=100; +var thisCol; +var thisRow; +var subMat; +var time=0; +var checkit=0; + +odoo.define('game_sudoku.models_sudoku_game', function (require) { +"use strict"; + +var core = require('web.core'); +var Model = require('web.Model'); +var Widget = require('web.Widget'); + +var QWeb = core.qweb; +var _t = core._t; + +var Sudoku = Widget.extend({ + events: { + "click .sudokunewbutton": function() { + $('.sudokulevelselection').css('display', 'block'); + }, + "click .sudokulevelbutton1": function() { + this.newgame(); + this.level(45); + checkit = 1; + $('.sudokulevelselection').css('display', 'none'); + $('.sudokulevelbuttoncheck').css('display', 'block'); + $('.sudokulevelbuttoncheckback').css('display', 'none'); + $('.sudokulevelbuttonreset').css('display', 'block'); + $('.sudokulevelbuttoncheck').css('display', 'block'); + $('.sudokulevelbuttonsolve').css('display', 'block'); + }, + "click .sudokulevelbutton2": function() { + this.newgame(); + this.level(35); + checkit = 1; + $('.sudokulevelselection').css('display', 'none'); + $('.sudokulevelbuttoncheck').css('display', 'block'); + $('.sudokulevelbuttoncheckback').css('display', 'none'); + $('.sudokulevelbuttonreset').css('display', 'block'); + $('.sudokulevelbuttoncheck').css('display', 'block'); + $('.sudokulevelbuttonsolve').css('display', 'block'); + }, + "click .sudokulevelbutton3": function() { + this.newgame(); + this.level(25); + checkit = 1; + $('.sudokulevelselection').css('display', 'none'); + $('.sudokulevelbuttoncheck').css('display', 'block'); + $('.sudokulevelbuttoncheckback').css('display', 'none'); + $('.sudokulevelbuttonreset').css('display', 'block'); + $('.sudokulevelbuttoncheck').css('display', 'block'); + $('.sudokulevelbuttonsolve').css('display', 'block'); + }, + "click .sudokulevelselectionclose": function() { + $('.sudokulevelselection').css('display', 'none'); + }, + "click .sudokulevelbuttonreset": function() { + $('.sudokulevelbuttoncheck').css('display', 'block'); + $('.sudokulevelbuttoncheckback').css('display', 'none'); + this.rese(); + }, + "click .sudokulevelbuttoncheck": function() { + this.check(); + $('.sudokulevelbuttoncheck').css('display', 'none'); + $('.sudokulevelbuttoncheckback').css('display', 'block'); + }, + "click .sudokulevelbuttoncheckback": function() { + this.checkback(); + $('.sudokulevelbuttoncheck').css('display', 'block'); + $('.sudokulevelbuttoncheckback').css('display', 'none'); + }, + "click .sudokulevelbuttonsolve": function() { + this.show_lost(); + this.solve(); + }, + "click #cell_0_0": function() { + var cell = document.getElementById('cell_0_0'); + var cell_id = "#cell_0_0"; + this.selectCell(cell, cell_id) + }, + "click #cell_0_1": function() { + + var cell = document.getElementById('cell_0_1'); + var cell_id = "#cell_0_1"; + this.selectCell(cell, cell_id) + }, + "click #cell_0_2": function() { + + var cell = document.getElementById('cell_0_2'); + var cell_id = "#cell_0_2"; + this.selectCell(cell, cell_id) + }, + "click #cell_0_3": function() { + + var cell = document.getElementById('cell_0_3'); + var cell_id = "#cell_0_3"; + this.selectCell(cell, cell_id) + }, + "click #cell_0_4": function() { + + var cell = document.getElementById('cell_0_4'); + var cell_id = "#cell_0_4"; + this.selectCell(cell, cell_id) + }, + "click #cell_0_5": function() { + + var cell = document.getElementById('cell_0_5'); + var cell_id = "#cell_0_5"; + this.selectCell(cell, cell_id) + }, + "click #cell_0_6": function() { + + var cell = document.getElementById('cell_0_6'); + var cell_id = "#cell_0_6"; + this.selectCell(cell, cell_id) + }, + "click #cell_0_7": function() { + + var cell = document.getElementById('cell_0_7'); + var cell_id = "#cell_0_7"; + this.selectCell(cell, cell_id) + }, + "click #cell_0_8": function() { + + var cell = document.getElementById('cell_0_8'); + var cell_id = "#cell_0_8"; + this.selectCell(cell, cell_id) + }, + "click #cell_1_0": function() { + + var cell = document.getElementById('cell_1_0'); + var cell_id = "#cell_1_0"; + this.selectCell(cell, cell_id) + }, + "click #cell_1_1": function() { + + var cell = document.getElementById('cell_1_1'); + var cell_id = "#cell_1_1"; + this.selectCell(cell, cell_id) + }, + "click #cell_1_2": function() { + + var cell = document.getElementById('cell_1_2'); + var cell_id = "#cell_1_2"; + this.selectCell(cell, cell_id) + }, + "click #cell_1_3": function() { + + var cell = document.getElementById('cell_1_3'); + var cell_id = "#cell_1_3"; + this.selectCell(cell, cell_id) + }, + "click #cell_1_4": function() { + + var cell = document.getElementById('cell_1_4'); + var cell_id = "#cell_1_4"; + this.selectCell(cell, cell_id) + }, + "click #cell_1_5": function() { + + var cell = document.getElementById('cell_1_5'); + var cell_id = "#cell_1_5"; + this.selectCell(cell, cell_id) + }, + "click #cell_1_6": function() { + + var cell = document.getElementById('cell_1_6'); + var cell_id = "#cell_1_6"; + this.selectCell(cell, cell_id) + }, + "click #cell_1_7": function() { + + var cell = document.getElementById('cell_1_7'); + var cell_id = "#cell_1_7"; + this.selectCell(cell, cell_id) + }, + "click #cell_1_8": function() { + + var cell = document.getElementById('cell_1_8'); + var cell_id = "#cell_1_8"; + this.selectCell(cell, cell_id) + }, + "click #cell_2_0": function() { + + var cell = document.getElementById('cell_2_0'); + var cell_id = "#cell_2_0"; + this.selectCell(cell, cell_id) + }, + "click #cell_2_1": function() { + + var cell = document.getElementById('cell_2_1'); + var cell_id = "#cell_2_1"; + this.selectCell(cell, cell_id) + }, + "click #cell_2_2": function() { + + var cell = document.getElementById('cell_2_2'); + var cell_id = "#cell_2_2"; + this.selectCell(cell, cell_id) + }, + "click #cell_2_3": function() { + + var cell = document.getElementById('cell_2_3'); + var cell_id = "#cell_2_3"; + this.selectCell(cell, cell_id) + }, + "click #cell_2_4": function() { + + var cell = document.getElementById('cell_2_4'); + var cell_id = "#cell_2_4"; + this.selectCell(cell, cell_id) + }, + "click #cell_2_5": function() { + + var cell = document.getElementById('cell_2_5'); + var cell_id = "#cell_2_5"; + this.selectCell(cell, cell_id) + }, + "click #cell_2_6": function() { + + var cell = document.getElementById('cell_2_6'); + var cell_id = "#cell_2_6"; + this.selectCell(cell, cell_id) + }, + "click #cell_2_7": function() { + + var cell = document.getElementById('cell_2_7'); + var cell_id = "#cell_2_7"; + this.selectCell(cell, cell_id) + }, + "click #cell_2_8": function() { + + var cell = document.getElementById('cell_2_8'); + var cell_id = "#cell_2_8"; + this.selectCell(cell, cell_id) + }, + "click #cell_3_0": function() { + + var cell = document.getElementById('cell_3_0'); + var cell_id = "#cell_3_0"; + this.selectCell(cell, cell_id) + }, + "click #cell_3_1": function() { + + var cell = document.getElementById('cell_3_1'); + var cell_id = "#cell_3_1"; + this.selectCell(cell, cell_id) + }, + "click #cell_3_2": function() { + + var cell = document.getElementById('cell_3_2'); + var cell_id = "#cell_3_2"; + this.selectCell(cell, cell_id) + }, + "click #cell_3_3": function() { + + var cell = document.getElementById('cell_3_3'); + var cell_id = "#cell_3_3"; + this.selectCell(cell, cell_id) + }, + "click #cell_3_4": function() { + + var cell = document.getElementById('cell_3_4'); + var cell_id = "#cell_3_4"; + this.selectCell(cell, cell_id) + }, + "click #cell_3_5": function() { + + var cell = document.getElementById('cell_3_5'); + var cell_id = "#cell_3_5"; + this.selectCell(cell, cell_id) + }, + "click #cell_3_6": function() { + + var cell = document.getElementById('cell_3_6'); + var cell_id = "#cell_3_6"; + this.selectCell(cell, cell_id) + }, + "click #cell_3_7": function() { + + var cell = document.getElementById('cell_3_7'); + var cell_id = "#cell_3_7"; + this.selectCell(cell, cell_id) + }, + "click #cell_3_8": function() { + + var cell = document.getElementById('cell_3_8'); + var cell_id = "#cell_3_8"; + this.selectCell(cell, cell_id) + }, + "click #cell_4_0": function() { + + var cell = document.getElementById('cell_4_0'); + var cell_id = "#cell_4_0"; + this.selectCell(cell, cell_id) + }, + "click #cell_4_1": function() { + + var cell = document.getElementById('cell_4_1'); + var cell_id = "#cell_4_1"; + this.selectCell(cell, cell_id) + }, + "click #cell_4_2": function() { + + var cell = document.getElementById('cell_4_2'); + var cell_id = "#cell_4_2"; + this.selectCell(cell, cell_id) + }, + "click #cell_4_3": function() { + + var cell = document.getElementById('cell_4_3'); + var cell_id = "#cell_4_3"; + this.selectCell(cell, cell_id) + }, + "click #cell_4_4": function() { + + var cell = document.getElementById('cell_4_4'); + var cell_id = "#cell_4_4"; + this.selectCell(cell, cell_id) + }, + "click #cell_4_5": function() { + + var cell = document.getElementById('cell_4_5'); + var cell_id = "#cell_4_5"; + this.selectCell(cell, cell_id) + }, + "click #cell_4_6": function() { + + var cell = document.getElementById('cell_4_6'); + var cell_id = "#cell_4_6"; + this.selectCell(cell, cell_id) + }, + "click #cell_4_7": function() { + + var cell = document.getElementById('cell_4_7'); + var cell_id = "#cell_4_7"; + this.selectCell(cell, cell_id) + }, + "click #cell_4_8": function() { + + var cell = document.getElementById('cell_4_8'); + var cell_id = "#cell_4_8"; + this.selectCell(cell, cell_id) + }, + "click #cell_5_0": function() { + + var cell = document.getElementById('cell_5_0'); + var cell_id = "#cell_5_0"; + this.selectCell(cell, cell_id) + }, + "click #cell_5_1": function() { + + var cell = document.getElementById('cell_5_1'); + var cell_id = "#cell_5_1"; + this.selectCell(cell, cell_id) + }, + "click #cell_5_2": function() { + + var cell = document.getElementById('cell_5_2'); + var cell_id = "#cell_5_2"; + this.selectCell(cell, cell_id) + }, + "click #cell_5_3": function() { + + var cell = document.getElementById('cell_5_3'); + var cell_id = "#cell_5_3"; + this.selectCell(cell, cell_id) + }, + "click #cell_5_4": function() { + + var cell = document.getElementById('cell_5_4'); + var cell_id = "#cell_5_4"; + this.selectCell(cell, cell_id) + }, + "click #cell_5_5": function() { + + var cell = document.getElementById('cell_5_5'); + var cell_id = "#cell_5_5"; + this.selectCell(cell, cell_id) + }, + "click #cell_5_6": function() { + + var cell = document.getElementById('cell_5_6'); + var cell_id = "#cell_5_6"; + this.selectCell(cell, cell_id) + }, + "click #cell_5_7": function() { + + var cell = document.getElementById('cell_5_7'); + var cell_id = "#cell_5_7"; + this.selectCell(cell, cell_id) + }, + "click #cell_5_8": function() { + + var cell = document.getElementById('cell_5_8'); + var cell_id = "#cell_5_8"; + this.selectCell(cell, cell_id) + }, + "click #cell_6_0": function() { + + var cell = document.getElementById('cell_6_0'); + var cell_id = "#cell_6_0"; + this.selectCell(cell, cell_id) + }, + "click #cell_6_1": function() { + + var cell = document.getElementById('cell_6_1'); + var cell_id = "#cell_6_1"; + this.selectCell(cell, cell_id) + }, + "click #cell_6_2": function() { + + var cell = document.getElementById('cell_6_2'); + var cell_id = "#cell_6_2"; + this.selectCell(cell, cell_id) + }, + "click #cell_6_3": function() { + + var cell = document.getElementById('cell_6_3'); + var cell_id = "#cell_6_3"; + this.selectCell(cell, cell_id) + }, + "click #cell_6_4": function() { + + var cell = document.getElementById('cell_6_4'); + var cell_id = "#cell_6_4"; + this.selectCell(cell, cell_id) + }, + "click #cell_6_5": function() { + + var cell = document.getElementById('cell_6_5'); + var cell_id = "#cell_6_5"; + this.selectCell(cell, cell_id) + }, + "click #cell_6_6": function() { + + var cell = document.getElementById('cell_6_6'); + var cell_id = "#cell_6_6"; + this.selectCell(cell, cell_id) + }, + "click #cell_6_7": function() { + + var cell = document.getElementById('cell_6_7'); + var cell_id = "#cell_6_7"; + this.selectCell(cell, cell_id) + }, + "click #cell_6_8": function() { + + var cell = document.getElementById('cell_6_8'); + var cell_id = "#cell_6_8"; + this.selectCell(cell, cell_id) + }, + "click #cell_7_0": function() { + + var cell = document.getElementById('cell_7_0'); + var cell_id = "#cell_7_0"; + this.selectCell(cell, cell_id) + }, + "click #cell_7_1": function() { + + var cell = document.getElementById('cell_7_1'); + var cell_id = "#cell_7_1"; + this.selectCell(cell, cell_id) + }, + "click #cell_7_2": function() { + + var cell = document.getElementById('cell_7_2'); + var cell_id = "#cell_7_2"; + this.selectCell(cell, cell_id) + }, + "click #cell_7_3": function() { + + var cell = document.getElementById('cell_7_3'); + var cell_id = "#cell_7_3"; + this.selectCell(cell, cell_id) + }, + "click #cell_7_4": function() { + + var cell = document.getElementById('cell_7_4'); + var cell_id = "#cell_7_4"; + this.selectCell(cell, cell_id) + }, + "click #cell_7_5": function() { + + var cell = document.getElementById('cell_7_5'); + var cell_id = "#cell_7_5"; + this.selectCell(cell, cell_id) + }, + "click #cell_7_6": function() { + + var cell = document.getElementById('cell_7_6'); + var cell_id = "#cell_7_6"; + this.selectCell(cell, cell_id) + }, + "click #cell_7_7": function() { + + var cell = document.getElementById('cell_7_7'); + var cell_id = "#cell_7_7"; + this.selectCell(cell, cell_id) + }, + "click #cell_7_8": function() { + + var cell = document.getElementById('cell_7_8'); + var cell_id = "#cell_7_8"; + this.selectCell(cell, cell_id) + }, + "click #cell_8_0": function() { + + var cell = document.getElementById('cell_8_0'); + var cell_id = "#cell_8_0"; + this.selectCell(cell, cell_id) + }, + "click #cell_8_1": function() { + + var cell = document.getElementById('cell_8_1'); + var cell_id = "#cell_8_1"; + this.selectCell(cell, cell_id) + }, + "click #cell_8_2": function() { + + var cell = document.getElementById('cell_8_2'); + var cell_id = "#cell_8_2"; + this.selectCell(cell, cell_id) + }, + "click #cell_8_3": function() { + + var cell = document.getElementById('cell_8_3'); + var cell_id = "#cell_8_3"; + this.selectCell(cell, cell_id) + }, + "click #cell_8_4": function() { + + var cell = document.getElementById('cell_8_4'); + var cell_id = "#cell_8_4"; + this.selectCell(cell, cell_id) + }, + "click #cell_8_5": function() { + + var cell = document.getElementById('cell_8_5'); + var cell_id = "#cell_8_5"; + this.selectCell(cell, cell_id) + }, + "click #cell_8_6": function() { + + var cell = document.getElementById('cell_8_6'); + var cell_id = "#cell_8_6"; + this.selectCell(cell, cell_id) + }, + "click #cell_8_7": function() { + + var cell = document.getElementById('cell_8_7'); + var cell_id = "#cell_8_7"; + this.selectCell(cell, cell_id) + }, + "click #cell_8_8": function() { + + var cell = document.getElementById('cell_8_8'); + var cell_id = "#cell_8_8"; + this.selectCell(cell, cell_id) + }, + + }, + + valid: function (k,l,r1){ + + var k1= (Math.floor(k/3))*3; + var k2=k1+3; + var l1= (Math.floor(l/3))*3; + var l2=l1+3; + for (var i=k1;i= 1 && key_no <= 9) + { + console.log("key + selected_cell_id",key, selected_cell_id); + var chk = globb.valid(rr,cc,key); + if (chk==1) + { + $(selected_cell_id).text(key); + sudokuboard[rr][cc]=key; + $(selected_cell_id).addClass('filled').removeClass('selected'); + if(globb.isfull(rr, cc)) + { + globb.show_wow() + setTimeout(function() { + globb.check(); + }, 10000); + } + } + else + alert("Cannot enter "+key+".Because this number twice in the same row or same column or same box."); + } + } + }, + + initialize:function() + { + document.onkeypress = this.keyPress; + }, + +selectCell: function(cell, cell_id) + { + if (checkit) + { + for (var rows = 0; rows <=8; rows++) + { + for (var cols=0; cols <= 8; cols++) + { + var cells=document.getElementById('cell_' + rows + '_' + cols) + if (cells.className == 'selected') + { + var v= sudokuboard[rows][cols]; + if (v==0){ + cells.className = 'tofill'; + } + else{ + if (sudokuboard[rows][cols] == board[rows][cols]) + { + cells.className = 'notfill'; + } + else + cells.className = 'filled'; + } + } + } + } + + var row = cell_id.charAt(6); + var col = cell_id.charAt(8); + + if (parseInt(cell.innerHTML)) + { + if (board[row][col] != 0){ + cell.className='notfill'; + } + else{ + cell.className='selected'; + } + + } + else{ + cell.className='selected'; + } + current_cell = this; + globb = this; + selected_cell_id = cell_id + } + }, + + level: function(lvl) + { + for (var i = 1; i <=lvl;) + { + var k=this.rand(); + var l=this.rand(); + if (sudokuboard[k][l] == 0) + { + var x = Puzzle[k][l]; + var random="cell_"+k+"_"+l; + $("#cell_"+k+"_"+l).text(x); + sudokuboard[k][l]=x; + board[k][l]=x; + i++; + } + } + for (var row = 0; row <=8; row++) + { + for (var col=0; col <= 8; col++) + { + var cell = document.getElementById('cell_' + row + '_' + col); + var self = this; + var cell_id = "#cell_" + row + "_" + col + var cell_idd = "cell_" + row + "_" + col + if (!parseInt(cell.innerHTML)) + { + cell.className='tofill'; + } + else + { + cell.className='notfill'; + } + } + } + this.rese(); + }, + + newgame: function() + { + $(".sudo").text("SUDOKU"); + this.problem(); + for (var row = 0; row <=8; row++) + { + sudokuboard[row]=new Array(9); + orginalboard[row]=new Array(9); + board[row]=new Array(9); + for (var col=0; col <= 8; col++) + { + $("#cell_"+row+"_"+col).text(""); + + sudokuboard[row][col]=0; + orginalboard[row][col]=0; + board[row][col]=0; + } + } + }, + + validd:function (randVal,thisRow,thisCol,subMat) + { + for(var i=0;i<9;i++) + { + if(thisRow[i]==randVal) + { + return 1; + } + else if (thisCol[i]==randVal) + { + return 1; + } + else if(subMat[i]==randVal) + { + return 1; + } + else + { + continue; + } + } + return 0; + }, + + rand: function() + { + var r1=Math.floor(Math.random() * 10); + r1=(r1+r1+1)%9 + return r1; + }, + + checkback: function() + { + for (var row = 0; row <=8; row++) + { + for (var col=0; col <= 8; col++) + { + var cell=document.getElementById('cell_' + row + '_' + col) + var cell_id = '#cell_' + row + '_' + col + var v= sudokuboard[row][col]; + if (v==0){ + $("#cell_"+row+"_"+col).text(""); + cell.className = 'tofill'; + } + else{ + $("#cell_"+row+"_"+col).text(v); + console.log("receckkkkk",sudokuboard[row][col] ) + if (sudokuboard[row][col] == board[row][col]) + { + cell.className = 'notfill'; + } + else + cell.className = 'filled'; + + } + + } + } + }, + + show_wow: function() { + var class_to_add = 'o_wow_thumbs'; + var $body = $('body'); + $body.addClass(class_to_add); + setTimeout(function() { + $body.removeClass(class_to_add); + }, 10000); + }, + + show_lost: function() { + var class_to_add = 'o_lost_thumbs'; + var $body = $('body'); + $body.addClass(class_to_add); + setTimeout(function() { + $body.removeClass(class_to_add); + }, 10000); + }, + + check: function() + { + for (var row = 0; row <=8; row++) + { + for (var col=0; col <= 8; col++) + { + var cell = document.getElementById('cell_' + row + '_' + col); + if (Puzzle[row][col]==sudokuboard[row][col]) + cell.className='green'; + else + cell.className='red'; + } + } + }, + + solve: function() + { + + for (var row = 0; row <=8; row++) + { + for (var col=0; col <= 8; col++) + { + var val=Puzzle[row][col]; + $("#cell_"+row+"_"+col).text(val); + sudokuboard[row][col]=val; + } + } + + }, + + rese: function() + { + this.initialize(); + for (var row = 0; row <=8; row++) + { + for (var col=0; col <= 8; col++) + { + sudokuboard[row][col]=board[row][col]; + var cell=document.getElementById('cell_' + row + '_' + col) + var cell_id = '#cell_' + row + '_' + col + var cell_idd = 'cell_' + row + '_' + col + var v= board[row][col]; + if (v==0) + $("#cell_"+row+"_"+col).text(""); + else{ + $("#cell_"+row+"_"+col).text(v); + } + if (!parseInt(cell.innerHTML)) + { + cell.className = 'tofill'; + } + else + cell.className = 'notfill'; + } + + } + }, + + isfull:function (rr, cc) + { + for (var row = 0; row <=8; row++) + { + for (var col=0; col <= 8; col++) + { + if (!(row == rr && col == cc)){ + var cell = document.getElementById('cell_' + row + '_' + col); + console.log("isfullllllllllllllllllll",cell, cell.innerHTML); + if (!parseInt(cell.innerHTML)) + { + return false; + } + } + } + } + return true; + }, + + problem: function(){ + + var count=101; + while(count>maxAttempts) + { + for(var m=0;m<9;m++) + { + Puzzle[m]=new Array(9); + for(var n=0;n<9;n++) + { + Puzzle[m][n]=0; + } + } + for(var row=0;row<9;row++) + { + for(var col=0;col<9;col++) + { + thisRow=Puzzle[row]; + thisCol=new Array(); + for(var row1=0;row1<9;row1++) + { + thisCol.push(Puzzle[row1][col]); + } + var subRow=parseInt(row/3); + var subCol=parseInt(col/3); + var subMat=new Array(); + for(var subR=0;subR<3;subR++) + { + for(var subC=0;subC<3;subC++) + { + subMat.push(Puzzle[(subRow*3)+subR][(subCol*3)+subC]); + } + } + var randVal=0; + count=0; + while(this.validd(randVal,thisRow,thisCol,subMat)) + { + randVal=this.rand(); + if (randVal==0) + randVal=9; + count+=1; + if(count>maxAttempts) + { + break; + } + } + Puzzle[row][col]=randVal; + if(count>maxAttempts) + { + break; + } + + + } + if(count>maxAttempts) + { + break; + } + } + + } + }, + +start: function () { + var self = this; + var hr_employee = new Model('hr.employee'); + hr_employee.query(['attendance_state', 'name']) + .filter([['user_id', '=', self.session.uid]]) + .all() + .then(function (res) { + if (_.isEmpty(res) ) { + self.$('.o_hr_attendance_employee').append(_t("Error : Could not find employee linked to user")); + return; + } + self.employee = res[0]; + self.user = self.session.uid + self.$el.html(QWeb.render("EntertainmentGamesSudoku", {widget: self})); + }); + + return this._super.apply(this, arguments); + }, +}); +core.action_registry.add('entertainment_games_sudoku', Sudoku); + +return Sudoku; + +}); diff --git a/game_sudoku/static/src/less/games.less b/game_sudoku/static/src/less/games.less new file mode 100644 index 000000000..30c0a71e5 --- /dev/null +++ b/game_sudoku/static/src/less/games.less @@ -0,0 +1,119 @@ +.o_entertainment_games_log_in_icon { + font-size: 15em; + cursor: pointer; + margin: 20px 0px 20px 0px; + padding: 0px 15px 0px 15px; + border-radius: 10%; + box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6); +} + +.o_entertainment_games_kiosk_mode_container { + .o-flex-display(); + .o-flex-flow(column, nowrap); + .o-justify-content(center); + .o-align-items(center); + + @media (min-width: @screen-xs-max) { + background: url("../img/application-switcher-bg.jpg") no-repeat center center fixed; + background-size: cover; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + } +} + +/************** MIXINS for ANIMATIONS *************/ +.o-display-marked(@content, @top, @left, @color) { + position: absolute; + top: @top; + left: @left; + font-size: 150px; + font-family: "FontAwesome"; + content: @content; + color: @color; + animation: markAnim ease-in-out 10s; + animation-iteration-count: 5; + transform-origin: 50% 50%; + animation-fill-mode:forwards; /*when the spec is finished*/ + -webkit-animation: markAnim ease-in-out 10s; + -webkit-animation-iteration-count: 1; + -webkit-transform-origin: 50% 50%; + -webkit-animation-fill-mode:forwards; /*Chrome 16+, Safari 4+*/ + -moz-animation: markAnim ease-in-out 10s; + -moz-animation-iteration-count: 1; + -moz-transform-origin: 50% 50%; + -moz-animation-fill-mode:forwards; /*FF 5+*/ + -o-animation: markAnim ease-in-out 10s; + -o-animation-iteration-count: 1; + -o-transform-origin: 50% 50%; + -o-animation-fill-mode:forwards; /*Not implemented yet*/ + -ms-animation: markAnim ease-in-out 10s; + -ms-animation-iteration-count: 1; + -ms-transform-origin: 50% 50%; + -ms-animation-fill-mode:forwards; /*IE 10+*/ + + @media (max-width: 992px) { + left: 40%; + font-size: 30vw; + } +} + +.o_wow_thumbs:after { + .o-display-marked("You Won \A \f164 \00a0 - \f118", 20%, 40%, #21b799); + white-space: pre; +} +.o_lost_thumbs:after { + .o-display-marked("You Lost \A \f165 \00a0 - \f119", 20%, 40%, #b73720); + white-space: pre; +} + + +.o_entertainment_games_kiosk_mode { + width: 100%; + text-align: center; + position: relative; + background-color: #fff; + padding: 2em; + + h1 { + margin: 0 0 2rem 0; + } + + .message_demo_barcodes { + font-size: 0.9em; + margin: 0; + } + + img { + overflow:hidden; // prevent margins colapsing with h1 + margin-top: 3rem; + width: 200px; + } + + p { + text-align: left; + margin: 3rem 0; + } + + > button { + font-size: 1.2em; + margin-bottom: 2rem; + width: 100%; + } + + > button:last-child { + margin-bottom: 0; + } + + @media (min-width: @screen-xs-max) { + flex: 0 0 auto; + width: 550px; + border-radius: 10px; + background-color: rgba(255,255,255,0.8); + box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6); + font-size: 1.2em; + padding: 3em; + } +} \ No newline at end of file diff --git a/game_sudoku/static/src/xml/game.xml b/game_sudoku/static/src/xml/game.xml new file mode 100644 index 000000000..453a4e638 --- /dev/null +++ b/game_sudoku/static/src/xml/game.xml @@ -0,0 +1,20 @@ + + diff --git a/game_sudoku/static/src/xml/sudoku.xml b/game_sudoku/static/src/xml/sudoku.xml new file mode 100644 index 000000000..eda232f0a --- /dev/null +++ b/game_sudoku/static/src/xml/sudoku.xml @@ -0,0 +1,161 @@ + + diff --git a/game_sudoku/views/game_approve_sequence.xml b/game_sudoku/views/game_approve_sequence.xml new file mode 100644 index 000000000..52371cfed --- /dev/null +++ b/game_sudoku/views/game_approve_sequence.xml @@ -0,0 +1,9 @@ + + + + + Game Approve + employee.game + + + \ No newline at end of file diff --git a/game_sudoku/views/game_template.xml b/game_sudoku/views/game_template.xml new file mode 100644 index 000000000..6f976770a --- /dev/null +++ b/game_sudoku/views/game_template.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/game_sudoku/views/main_menu.xml b/game_sudoku/views/main_menu.xml new file mode 100644 index 000000000..c0e88d404 --- /dev/null +++ b/game_sudoku/views/main_menu.xml @@ -0,0 +1,49 @@ + + + + + Game Approval + entertainment_games_my_game + main + + + + employee.game.approve.tree + employee.game.approve + + + + + + + + +