Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Zhai, Zirun
Clickerance
Commits
6d3269c4
Commit
6d3269c4
authored
Sep 27, 2020
by
Clara Stoddart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added colour to represent not in the database
parent
d7a239f8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
12 deletions
+21
-12
content.js
content.js
+3
-0
database.php
database.php
+1
-1
style.css
style.css
+17
-11
No files found.
content.js
View file @
6d3269c4
var
MOUSE_VISITED_CLASSNAME
=
'
crx_mouse_visited_true
'
;
var
MOUSE_VISITED_CLASSNAME_FALSE
=
'
crx_mouse_visited_false
'
;
var
MOUSE_VISITED_CLASSNAME_NOT_IN_DB
=
'
crx_mouse_visited_not_in_db
'
;
var
srcName
;
var
dietNum
=
999
;
...
...
@@ -41,6 +42,8 @@ document.addEventListener('mousemove', function (e) {
srcElement
.
classList
.
add
(
MOUSE_VISITED_CLASSNAME
);
}
else
if
(
responseText
==
"
0
"
)
{
srcElement
.
classList
.
add
(
MOUSE_VISITED_CLASSNAME_FALSE
);
}
else
if
(
responseText
==
"
2
"
)
{
srcElement
.
classList
.
add
(
MOUSE_VISITED_CLASSNAME_NOT_IN_DB
)
}
},
function
(
failureStatus
)
{
...
...
database.php
View file @
6d3269c4
...
...
@@ -15,7 +15,7 @@ $stmt->execute();
$stmt
->
bind_result
(
$containsgluten
,
$containsdairy
,
$containscorn
,
$containsmeat
);
$result
=
$stmt
->
fetch
();
if
(
$result
==
false
)
{
echo
"
8
"
;
echo
"
2
"
;
}
else
{
if
(
!
((
$containsdairy
&
boolval
(
1
&
$dietNum
))
|
(
$containsmeat
&
boolval
(
2
&
$dietNum
))
|
(
$containscorn
&
boolval
(
4
&
$dietNum
))
|
(
$containsgluten
&
boolval
(
8
&
$dietNum
))))
{
echo
"1"
;
...
...
style.css
View file @
6d3269c4
...
...
@@ -44,7 +44,7 @@ body {
.h-text
{
color
:
white
;
text-align
:
center
;
font-size
:
18px
;
padding
:
1px
;
vertical-align
:
middle
;
...
...
@@ -52,7 +52,7 @@ body {
/* ----- topbar ----- */
.topbar
{
height
:
30px
;
height
:
30px
;
overflow
:
hidden
;
}
...
...
@@ -119,7 +119,7 @@ body {
user-select
:
none
;
color
:
#494949
;
}
.container
input
{
position
:
absolute
;
opacity
:
0
;
...
...
@@ -127,7 +127,7 @@ body {
height
:
0
;
width
:
0
;
}
.checkmark
{
position
:
absolute
;
top
:
0
;
...
...
@@ -139,26 +139,26 @@ body {
border-radius
:
50%
;
box-shadow
:
0
0
1px
#adadad
;
}
.container
:hover
input
~
.checkmark
{
background-color
:
#d4d4d4
;
transition
:
ease
0.3s
;
}
.container
input
:checked
~
.checkmark
{
background-color
:
#df1b1b
;
}
.checkmark
:after
{
content
:
""
;
position
:
absolute
;
display
:
none
;
}
.container
input
:checked
~
.checkmark
:after
{
display
:
block
;
}
.container
.checkmark
:after
{
vertical-align
:
center
;
}
...
...
@@ -190,10 +190,16 @@ body {
.crx_mouse_visited_true
{
background-clip
:
#bcd5eb
!important
;
outline
:
2
px
solid
#
47bb47
!important
;
outline
:
3
px
solid
#
51c2a9
!important
;
}
.crx_mouse_visited_false
{
background-clip
:
#bcd5eb
!important
;
outline
:
2px
solid
#fa1100
!important
;
outline
:
3px
solid
#df1b1b
!important
;
}
.crx_mouse_visited_not_in_db
{
background-clip
:
#bcd5eb
!important
;
outline
:
3px
solid
#FFA500
!important
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment