Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-images-generator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-images-generator
Commits
b1ca85eb
Commit
b1ca85eb
authored
Apr 14, 2013
by
Jingqin Lynn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use dropdown for Attribute editing.
parent
dafc0dc7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
12 deletions
+76
-12
js/main.coffee
js/main.coffee
+18
-4
js/main.js
js/main.js
+22
-5
style.css
style.css
+36
-3
No files found.
js/main.coffee
View file @
b1ca85eb
...
...
@@ -29,11 +29,25 @@ $(document).ready ->
$
(
'.editable'
).
each
(
_
,
element
)
->
if
element
.
classList
.
contains
(
'attribute'
)
$
(
element
).
click
(
e
)
->
height
=
element
.
getClientRects
()[
0
].
height
$e
=
$
(
element
)
$e
.
mousemove
(
e
)
->
padding
=
(
Math
.
floor
(
e
.
offsetY
/
height
)
+
1
)
*
height
if
padding
==
height
padding
=
0
if
element
.
style
.
paddingBottom
!=
padding
+
'px'
element
.
style
.
paddingBottom
=
padding
+
'px'
$e
.
mouseleave
(
e
)
->
$e
.
removeAttr
'style'
$e
.
click
(
e
)
->
attrs
=
[
'dark'
,
'divine'
,
'earth'
,
'fire'
,
'light'
,
'water'
,
'wind'
]
old_attr
=
element
.
dataset
[
'attribute'
]
new_attr
=
attrs
[(
attrs
.
indexOf
(
old_attr
)
+
1
)
%
attrs
.
length
]
element
.
dataset
[
'attribute'
]
=
new_attr
i
=
Math
.
floor
(
e
.
offsetY
/
height
)
if
i
>
0
element
.
dataset
[
'attribute'
]
=
attrs
[
i
-
1
]
else
if
element
.
classList
.
contains
(
'level'
)
$
(
element
).
click
(
e
)
->
delta
=
0
...
...
js/main.js
View file @
b1ca85eb
...
...
@@ -29,13 +29,30 @@
return
this
.
document
.
value
=
$
(
'
.card
'
)[
0
].
outerHTML
;
});
$
(
'
.editable
'
).
each
(
function
(
_
,
element
)
{
var
$e
,
height
;
if
(
element
.
classList
.
contains
(
'
attribute
'
))
{
return
$
(
element
).
click
(
function
(
e
)
{
var
attrs
,
new_attr
,
old_attr
;
height
=
element
.
getClientRects
()[
0
].
height
;
$e
=
$
(
element
);
$e
.
mousemove
(
function
(
e
)
{
var
padding
;
padding
=
(
Math
.
floor
(
e
.
offsetY
/
height
)
+
1
)
*
height
;
if
(
padding
===
height
)
{
padding
=
0
;
}
if
(
element
.
style
.
paddingBottom
!==
padding
+
'
px
'
)
{
return
element
.
style
.
paddingBottom
=
padding
+
'
px
'
;
}
});
$e
.
mouseleave
(
function
(
e
)
{
return
$e
.
removeAttr
(
'
style
'
);
});
return
$e
.
click
(
function
(
e
)
{
var
attrs
,
i
;
attrs
=
[
'
dark
'
,
'
divine
'
,
'
earth
'
,
'
fire
'
,
'
light
'
,
'
water
'
,
'
wind
'
];
old_attr
=
element
.
dataset
[
'
attribute
'
];
new_attr
=
attrs
[(
attrs
.
indexOf
(
old_attr
)
+
1
)
%
attrs
.
length
];
return
element
.
dataset
[
'
attribute
'
]
=
new_attr
;
i
=
Math
.
floor
(
e
.
offsetY
/
height
);
if
(
i
>
0
)
{
return
element
.
dataset
[
'
attribute
'
]
=
attrs
[
i
-
1
];
}
});
}
else
if
(
element
.
classList
.
contains
(
'
level
'
))
{
return
$
(
element
).
click
(
function
(
e
)
{
...
...
style.css
View file @
b1ca85eb
...
...
@@ -60,6 +60,7 @@
width
:
40px
;
height
:
40px
;
background-size
:
40px
40px
;
background-repeat
:
no-repeat
;
}
.attribute
[
data-attribute
=
"water"
]
{
background-image
:
url(mse/data/yugioh-caicai-levels.mse-symbol-font/水.png)
}
.attribute
[
data-attribute
=
"fire"
]
{
background-image
:
url(mse/data/yugioh-caicai-levels.mse-symbol-font/炎.png)
}
...
...
@@ -137,9 +138,41 @@
}
[
contenteditable
]
:active
,
[
contenteditable
]
:hover
,
.attribute.editable
:hover
{
background-color
:
rgba
(
255
,
255
,
255
,
0.3
);
[
contenteditable
]
:hover
{
background-color
:
rgba
(
255
,
255
,
255
,
0.3
);
}
.attribute.editable
:hover::before
{
position
:
relative
;
display
:
block
;
width
:
inherit
;
height
:
40px
;
top
:
100%
;
margin-top
:
-40px
;
background-color
:
rgba
(
255
,
255
,
255
,
0.4
);
z-index
:
101
;
content
:
" "
;
}
.attribute.editable
:hover::after
{
position
:
relative
;
margin-top
:
40px
;
height
:
280px
;
width
:
inherit
;
display
:
block
;
content
:
" "
;
z-index
:
100
;
background
:
url(mse/data/yugioh-caicai-levels.mse-symbol-font/%E6%9A%97.png)
0
0
,
url(mse/data/yugioh-caicai-levels.mse-symbol-font/%E7%A5%9E.png)
0
40px
,
url(mse/data/yugioh-caicai-levels.mse-symbol-font/%E5%9C%B0.png)
0
80px
,
url(mse/data/yugioh-caicai-levels.mse-symbol-font/%E7%82%8E.png)
0
120px
,
url(mse/data/yugioh-caicai-levels.mse-symbol-font/%E5%85%89.png)
0
160px
,
url(mse/data/yugioh-caicai-levels.mse-symbol-font/%E6%B0%B4.png)
0
200px
,
url(mse/data/yugioh-caicai-levels.mse-symbol-font/%E9%A3%8E.png)
0
240px
;
background-color
:
rgba
(
0
,
0
,
0
,
0.2
);
background-size
:
40px
40px
;
background-repeat
:
no-repeat
;
}
.image
{
...
...
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