-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlocalrun.html
186 lines (185 loc) · 7.58 KB
/
localrun.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta property="og:image" content="images/logo.png" />
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="stylesheet" href="localcache/all.css">
<link rel="stylesheet" href="localcache/bootstrap-glyphicons.css">
<;link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"/>
<;link rel="stylesheet" href="https://bootswatch.com/4/darkly/bootstrap.min.css"/>
<link rel="stylesheet" href="localcache/bootstrap.min.css"/>
<style>
html {font-size: 100%;}
svg text {cursor: default;}
</style>
<title>Local solve puzzle</title>
</head>
<body>
<script src="localcache/jquery-3.4.1.min.js"></script>
<script src="localcache/popper.min.js"></script>
<script src="localcache/bootstrap.min.js"></script>
<script src="localcache/snap.svg-min.js"></script>
<script src="localcache/require.min.js"></script>
<script src="js/jquery.rateit.js"></script>
<script>
requirejs.config({baseUrl: 'js'});
</script>
<div class="container">
<div class="row">
<div class="col-12 col-lg-10 m-auto">
<div class="card">
<div id="errorMessage" class="alert alert-danger alert-dismissible fade show" role="alert" style="display: none; position: absolute; top: 0; left: 0; z-index: 100;">
<span id="errorMessageText"></span>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden='true'>×</span>
</button>
</div>
<div id="successMessage" class="alert alert-success alert-dismissible fade show" role="alert" style="display: none; position: absolute; top: 0; left: 0; z-index: 100;"><span id="successMessageText"></span>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<h2 class="card-body pt-0 pb-0 mb-0"><%= puzzle.type.name %></h2>
<p class="card-body text-right pb-0 pt-0 mb-0"><small>Author: <%= puzzle.author %></small></p>
<svg id="mainGrid"
class="col-xs-12 text-center" style="overflow: visible; z-index: 90;">
Sorry, but your browser is not supported. Try to setup the new version.
</svg>
<div class="row card-body pb-1" id="puzzleControls">
<div class="col-8">
<div class="d-flex flex-row flex-wrap">
<div class="modal" name="restartModal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<p>Do you want to restart the puzzle? All progress will be lost!</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" name="confirmYes">Yes</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">No</button>
</div>
</div>
</div>
</div>
<div class="modal" name="voteModal">
<div class="modal-dialog" role="document">
<div class="modal-content alert-success show" '>
<div class="modal-header">
<p class="mb-0"><%= __('Congratulations! The puzzle has been solved correctly!!') %></p>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<% if(user && !puzzle.authorId.equals(user._id) ) { %>
<div class="modal-body">
<p><%= __('You can rate the quality of the puzzle') %><br>
<span name="voteRating" class="rateit" data-rateit-resetable="false" data-rateit-step="1" data-rateit-starwidth="32" data-rateit-starheight="32"></span>
</p>
<div class="form-group">
<label><%= __('You can add a comment for the puzzle author. It will be shown anonymously.') %></label>
<textarea class="form-control rounded-0" name="voteComment" rows="3"></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" name="voteSave"><%= __('Save') %></button>
<button type="button" class="btn btn-secondary" data-dismiss="modal" name="voteClose"><%= __('Close') %></button>
</div>
<% } %>
</div>
</div>
</div>
<button name="startBtn" type="button" class="btn btn-primary mb-3 mr-3">Start</button>
<button name="revertBtn" type="button" class="btn btn-primary mb-3 mr-3" style="display: none;">Undo</button>
<div class="mt-1 mr-3" name="pencilMarkCtrl" style="display: none;">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" name="pencilMarkCb"
id="pencilMarkCb">
<label class="custom-control-label"
for="pencilMarkCb">
Pencil-marks
</label>
</div>
</div>
</div>
</div>
<div class="col-4">
<div class="d-flex flex-row-reverse flex-wrap">
<button name="checkBtn" type="button" class="btn btn-primary mb-3 ml-3">Check</button>
<span name="timer" class="align-top" style="font-family: Lucida Console; font-size: 130%; display: none;"></span>
</div>
</div>
</div>
<div class="d-flex flex-wrap card-body pt-0" id="puzzleRules">
<!--
<div class="col-lg-4">
<span class="puzzle-figures w-100 d-block" theme="default" figures="domino" set="12345" doubles="true"></span>
</div>
-->
<div class="col-lg-8">
<p class="card-text text-left mt-2 w-100">Divide the grid along the grid lines into regions. Each region must contain one area of white cells and one area of shaded cells. The pair of areas must be of the same shape and size (the areas may be rotated or mirrored). A number indicates how many cells of one color the region contains. A region may contain several cells with numbers (in this case all numbers must be equal).</p>
<p class="card-text text-left mt-1"><b>Grid control</b>:
To draw a cut click at the cell edge or move mouse along the line holding the button. You can also connect the centers of cells which belong to the same rectangle with auxiliary line. In this case cut lines will be added automatically.
More details about grid control are at the <a href='/help'>help page</a>.
</p>
</div>
</div>
<script src="js/locale_ru.js"></script>
<script src="js/puzzle_figures.js"></script>
<script>
function showPuzzle() {
var controls = "#puzzleControls";
var puzzleData = {
typeCode: "double_choco_consecutive",
id: "puzzle.code",
dimension: "6x6"
};
var settings = {
local: true,
data: {
"f1": "grey4",
"c2": "grey",
"d2": "grey",
"f2": "grey",
"d3": "1",
"e3": "grey",
"f3": "grey",
"a4": "grey",
"c4": "3",
"d4": "grey",
"e4": "grey",
"f4": "grey",
"a5": "grey",
"b5": "grey",
"d5": "grey",
"e5": "grey",
"f5": "grey",
"a6": "grey5",
"b6": "grey",
"c6": "grey",
"tag": ""
}
};
settings.theme = "default";
var grid = "#mainGrid"
requirejs(["areapuzzle"], function() {
puzzle = new doubleChocoPuzzleType(puzzleData, controls, settings);
puzzle.render(Snap(grid));
});
}
</script>
</div>
<script>
$(document).ready(function () {
showPuzzle();
});
</script>
<div class="card card-body">
</div>
</div>
</div>
</div>
</body>
</html>