Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tutor-shot-extension
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ramdayal Munda
tutor-shot-extension
Commits
a56d284c
Commit
a56d284c
authored
Nov 09, 2023
by
ramdayalmunda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working on floating bar
parent
213f3378
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
3 deletions
+46
-3
content.js
content.js
+46
-3
No files found.
content.js
View file @
a56d284c
/**
* This file can access the DOM elements and also trigger DOM events
*/
var
loggedIn
=
false
;
!
function
()
{
var
floatingBar
=
null
!
(
function
()
{
let
origin
=
"http://localhost:3039"
if
(
window
.
origin
==
origin
)
login
()
}()
floatingBar
=
document
.
createElement
(
'div'
)
floatingBar
.
setAttribute
(
'style'
,
`
position:fixed;
bottom:0;
width:100vw;
z-index:100;
background: linear-gradient(45deg, #ffb102, transparent);
margin: 40px;
padding: 10px;
border-radius: 10px;
`
)
document
.
body
.
append
(
floatingBar
)
document
.
addEventListener
(
"visibilitychange"
,
function
()
{
if
(
document
.
visibilityState
===
'visible'
)
{
let
data
=
getCaptureData
()
reRenderFloatingBar
(
data
.
SSTaken
,
data
.
state
)
}
})
let
data
=
getCaptureData
()
reRenderFloatingBar
(
data
.
SSTaken
,
data
.
state
)
})()
function
login
()
{
let
userDetails
=
{
...
...
@@ -18,6 +42,25 @@ function login() {
}
}
function
getCaptureData
(){
return
{
SSTaken
:
28
,
state
:
"paused"
}
}
function
reRenderFloatingBar
(
ssTaken
,
state
)
{
let
innerHTML
=
/*html*/
`
<span>
${
ssTaken
?
ssTaken
:
0
}
SS taken</span>
${
state
==
'paused'
?
'<button>Play</button>'
:
''
}
<button>SS</button>
`
floatingBar
.
innerHTML
=
innerHTML
}
var
recording
=
false
;
const
api
=
axios
.
create
({
baseURL
:
"http://localhost:3039/api"
,
...
...
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