Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
logging-scratch-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Goessmann
logging-scratch-gui
Commits
9e783d8a
Commit
9e783d8a
authored
6 years ago
by
Paul Kaplan
Browse files
Options
Downloads
Patches
Plain Diff
Use a big green flag overlay to start the VM if needed
parent
f659dfbc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/components/stage/stage.css
+14
-1
14 additions, 1 deletion
src/components/stage/stage.css
src/components/stage/stage.jsx
+6
-0
6 additions, 0 deletions
src/components/stage/stage.jsx
src/containers/green-flag-overlay.jsx
+55
-0
55 additions, 0 deletions
src/containers/green-flag-overlay.jsx
with
75 additions
and
1 deletion
src/components/stage/stage.css
+
14
−
1
View file @
9e783d8a
...
...
@@ -89,7 +89,10 @@ to adjust for the border using a different method */
padding-bottom
:
calc
(
$
stage-full-screen-stage-padding
+
$
stage-full-screen-border-width
);
}
.monitor-wrapper
,
.color-picker-wrapper
,
.frame-wrapper
{
.monitor-wrapper
,
.color-picker-wrapper
,
.frame-wrapper
,
.green-flag-overlay-wrapper
{
position
:
absolute
;
top
:
0
;
left
:
0
;
...
...
@@ -138,6 +141,16 @@ to adjust for the border using a different method */
animation-fill-mode
:
forwards
;
/* Leave at 0 opacity after animation */
}
.green-flag-overlay
{
width
:
100%
;
height
:
100%
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
pointer-events
:
all
;
cursor
:
pointer
;
}
@keyframes
flash
{
0
%
{
opacity
:
1
;
}
100
%
{
opacity
:
0
;
}
...
...
This diff is collapsed.
Click to expand it.
src/components/stage/stage.jsx
+
6
−
0
View file @
9e783d8a
...
...
@@ -7,6 +7,7 @@ import DOMElementRenderer from '../../containers/dom-element-renderer.jsx';
import
Loupe
from
'
../loupe/loupe.jsx
'
;
import
MonitorList
from
'
../../containers/monitor-list.jsx
'
;
import
TargetHighlight
from
'
../../containers/target-highlight.jsx
'
;
import
GreenFlagOverlay
from
'
../../containers/green-flag-overlay.jsx
'
;
import
Question
from
'
../../containers/question.jsx
'
;
import
MicIndicator
from
'
../mic-indicator/mic-indicator.jsx
'
;
import
{
STAGE_DISPLAY_SIZES
}
from
'
../../lib/layout-constants.js
'
;
...
...
@@ -71,6 +72,11 @@ const StageComponent = props => {
stageWidth
=
{
stageDimensions
.
width
}
/>
</
Box
>
<
Box
className
=
{
styles
.
greenFlagOverlayWrapper
}
>
<
GreenFlagOverlay
className
=
{
styles
.
greenFlagOverlay
}
/>
</
Box
>
{
isColorPicking
&&
colorInfo
?
(
<
Box
className
=
{
styles
.
colorPickerWrapper
}
>
<
Loupe
colorInfo
=
{
colorInfo
}
/>
...
...
This diff is collapsed.
Click to expand it.
src/containers/green-flag-overlay.jsx
0 → 100644
+
55
−
0
View file @
9e783d8a
import
bindAll
from
'
lodash.bindall
'
;
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
connect
}
from
'
react-redux
'
;
import
VM
from
'
scratch-vm
'
;
import
greenFlag
from
'
../components/green-flag/icon--green-flag.svg
'
;
class
GreenFlagOverlay
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
bindAll
(
this
,
[
'
handleClick
'
]);
}
handleClick
()
{
this
.
props
.
vm
.
start
();
this
.
props
.
vm
.
greenFlag
();
}
render
()
{
if
(
this
.
props
.
isStarted
)
return
null
;
return
(
<
div
className
=
{
this
.
props
.
className
}
onClick
=
{
this
.
handleClick
}
>
<
img
draggable
=
{
false
}
src
=
{
greenFlag
}
/>
</
div
>
);
}
}
GreenFlagOverlay
.
propTypes
=
{
className
:
PropTypes
.
string
,
isStarted
:
PropTypes
.
bool
,
vm
:
PropTypes
.
instanceOf
(
VM
)
};
const
mapStateToProps
=
state
=>
({
isStarted
:
state
.
scratchGui
.
vmStatus
.
started
,
vm
:
state
.
scratchGui
.
vm
});
const
mapDispatchToProps
=
()
=>
({});
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
GreenFlagOverlay
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment