Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
samsung-christmas
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
abcd7293
authored
Dec 17, 2019
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
6dedbccd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
18 deletions
+5
-18
Public/static/css/index.css
+4
-17
Public/static/js/leaves.js
+1
-1
No files found.
Public/static/css/index.css
View file @
abcd7293
...
@@ -49,7 +49,10 @@ input::-webkit-input-placeholder {
...
@@ -49,7 +49,10 @@ input::-webkit-input-placeholder {
overflow
:
hidden
;
overflow
:
hidden
;
}
}
//
leaf
animation
css
.leafContainer
img
{
width
:
auto
;
height
:
auto
;
}
/* Defines the position and dimensions of the leafContainer div */
/* Defines the position and dimensions of the leafContainer div */
.leafContainer
.leafContainer
{
{
...
@@ -57,22 +60,6 @@ input::-webkit-input-placeholder {
...
@@ -57,22 +60,6 @@ input::-webkit-input-placeholder {
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
}
}
/* This CSS rule is applied to all div elements in the leafContainer div.
It styles and animates each leafDiv.
*/
.leafContainer
>
div
{
position
:
absolute
;
width
:
81px
;
height
:
81px
;
/* We use the following properties to apply the fade and drop animations to each leaf.
Each of these properties takes two values. These values respectively match a setting
for fade and drop.
*/
-webkit-animation-iteration-count
:
infinite
,
infinite
;
-webkit-animation-direction
:
normal
,
normal
;
-webkit-animation-timing-function
:
linear
,
ease-in
;
}
/* This CSS rule is applied to all img elements directly inside div elements which are
/* This CSS rule is applied to all img elements directly inside div elements which are
directly inside the leafContainer div. In other words, it matches the 'img' elements
directly inside the leafContainer div. In other words, it matches the 'img' elements
inside the leafDivs which are created in the createALeaf() function.
inside the leafDivs which are created in the createALeaf() function.
...
...
Public/static/js/leaves.js
View file @
abcd7293
...
@@ -113,7 +113,7 @@ function createALeaf()
...
@@ -113,7 +113,7 @@ function createALeaf()
var
leafDiv
=
document
.
createElement
(
'div'
);
var
leafDiv
=
document
.
createElement
(
'div'
);
var
image
=
document
.
createElement
(
'img'
);
var
image
=
document
.
createElement
(
'img'
);
/* Randomly choose a leaf image and assign it to the newly created element */
/* Randomly choose a leaf image and assign it to the newly created element */
image
.
src
=
window
.
base_resource_url
+
'/image2/snow-'
+
randomInteger
(
1
,
3
)
+
'.png'
;
image
.
src
=
window
.
base_resource_url
+
'/image2/snow-'
+
randomInteger
(
1
,
4
)
+
'.png'
;
console
.
log
(
randomInteger
(
1
,
3
));
console
.
log
(
randomInteger
(
1
,
3
));
leafDiv
.
style
.
top
=
"-100px"
;
leafDiv
.
style
.
top
=
"-100px"
;
/* Position the leaf at a random location along the screen */
/* Position the leaf at a random location along the screen */
...
...
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