Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Rishika Ponna
chillflix
Commits
02bc2d56
Unverified
Commit
02bc2d56
authored
Nov 21, 2021
by
rishikaponna
Committed by
GitHub
Nov 21, 2021
Browse files
Add files via upload
parent
36396acd
Changes
2
Hide whitespace changes
Inline
Side-by-side
js/darkmode.js
0 → 100644
View file @
02bc2d56
let
theme
=
localStorage
.
getItem
(
'
data-theme
'
);
const
changeThemeToDark
=
()
=>
{
document
.
getElementById
(
"
HTML
"
).
setAttribute
(
"
data-theme
"
,
"
dark
"
)
// set theme to dark
localStorage
.
setItem
(
"
data-theme
"
,
"
dark
"
)
// save theme to local storage
var
image
=
document
.
getElementById
(
'
logo2
'
);
image
.
src
=
"
img/Darkmode_logo.png
"
;
var
image
=
document
.
getElementById
(
'
logo-foot
'
);
image
.
src
=
"
img/Darkmode_logo.png
"
;
}
const
changeThemeToLight
=
()
=>
{
document
.
getElementById
(
"
HTML
"
).
setAttribute
(
"
data-theme
"
,
"
light
"
)
// set theme light
localStorage
.
setItem
(
"
data-theme
"
,
'
light
'
)
// save theme to local storage
var
image
=
document
.
getElementById
(
'
logo2
'
);
image
.
src
=
"
img/Lightmode_logo.png
"
;
var
image
=
document
.
getElementById
(
'
logo-foot
'
);
image
.
src
=
"
img/Lightmode_logo.png
"
;
}
const
checkbox
=
document
.
getElementById
(
"
checkbox
"
);
checkbox
.
addEventListener
(
'
change
'
,
()
=>
{
let
theme
=
localStorage
.
getItem
(
'
data-theme
'
);
// Retrieve saved them from local storage
if
(
theme
===
'
dark
'
){
changeThemeToLight
()
}
else
{
changeThemeToDark
()
}
});
function
changing
(){
document
.
getElementById
(
"
HTML
"
).
setAttribute
(
"
data-theme
"
,
localStorage
.
getItem
(
'
data-theme
'
))
;
if
(
localStorage
.
getItem
(
'
data-theme
'
)
===
"
dark
"
)
{
var
image
=
document
.
getElementById
(
'
logo2
'
);
image
.
src
=
"
img/Darkmode_logo.png
"
;
var
image
=
document
.
getElementById
(
'
logo-foot
'
);
image
.
src
=
"
img/Darkmode_logo.png
"
;
document
.
getElementById
(
"
checkbox
"
).
checked
=
true
;
}
else
if
(
localStorage
.
getItem
(
'
data-theme
'
)
===
null
)
{
document
.
getElementById
(
"
HTML
"
).
setAttribute
(
"
data-theme
"
,
"
dark
"
)
;
var
image
=
document
.
getElementById
(
'
logo2
'
);
image
.
src
=
"
img/Darkmode_logo.png
"
;
var
image
=
document
.
getElementById
(
'
logo-foot
'
);
image
.
src
=
"
img/Darkmode_logo.png
"
;
document
.
getElementById
(
"
checkbox
"
).
checked
=
true
;
}
}
\ No newline at end of file
js/download.js
0 → 100644
View file @
02bc2d56
document
.
getElementsByClassName
(
'
press
'
).
addEventListener
(
'
click
'
,
function
(){
document
.
getElementById
(
'
press1
'
).
click
()
})
\ No newline at end of file
Write
Preview
Supports
Markdown
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