Skip to content

Commit 0098110

Browse files
committed
moved positioning of clipboard buttons
1 parent 4fd8aff commit 0098110

File tree

4 files changed

+305
-219
lines changed

4 files changed

+305
-219
lines changed

client/components/Clipboard.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ const Clipboard = () => {
7676
gap: '30px',
7777
width: .8,
7878
}}
79-
className="code-container"
8079
>
8180
<Typography variant="h3" align="center" gutterBottom sx={{ color: '#6E00BB', mb: 0, mt: 5 }}>{projectName}</Typography>
8281
<TextField
@@ -88,12 +87,14 @@ const Clipboard = () => {
8887
onChange={updateServer}
8988
/>
9089
<Box
90+
className="clipboard-code-container"
9191
sx={{
9292
width: .85,
9393
height: 500,
9494
overflow: 'auto',
9595
backgroundColor: '#282C34',
9696
borderRadius: 2,
97+
position: 'relative'
9798
}}
9899
>
99100
<div id="main-clipboard">
@@ -103,8 +104,9 @@ const Clipboard = () => {
103104
</code>
104105
</pre>
105106
</div>
107+
<ClipboardButton />
106108
</Box>
107-
<ClipboardButton />
109+
108110
<Button
109111
onClick={handleClear}
110112
sx={{ flexDirection: 'column' }}

client/containers/CodeContainer.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import React from 'react';
22
import Box from '@mui/material/Box';
33
import ButtonContainer from './ButtonContainer';
4-
54
import CodeText from '../components/CodeText';
65

76
// This container wraps the text box containing the code from server
87

98
const CodeContainer = () => {
109
return (
11-
<div className="code-container">
12-
<Box className='test-code-box'>
10+
<div>
11+
<Box className='test-code-box code-container'>
1312
<CodeText />
13+
<ButtonContainer />
1414
</Box>
15-
<ButtonContainer />
1615
</div>
1716
);
1817
};

client/stylesheets/styles.scss

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ body {
4040
}
4141

4242
#main-clipboard {
43+
position: relative;
4344
font-family: 'Inconsolata', monospace;
4445
font-size: medium;
4546
border-radius: '2px';
47+
z-index: 9;
4648
}
4749

4850
img[alt~='logo'] {
@@ -80,29 +82,29 @@ img[alt~='logo'] {
8082

8183
.code-container:hover > .button-container {
8284
transition: all 0.5s ease-in;
83-
opacity: 100;
84-
}
85-
86-
.code-container:hover > .clipboard-button-container {
87-
transition: all 0.5s ease-in;
88-
opacity: 100;
85+
opacity: 1;
8986
}
9087

9188
.button-container {
9289
position: absolute;
9390
display: inline-block;
94-
top: 8px;
95-
right: 38px;
91+
top: 2px;
92+
right: 30px;
9693
opacity: 0;
9794
overflow: hidden;
9895
z-index: 10;
9996
}
10097

98+
.clipboard-code-container:hover > .clipboard-button-container {
99+
transition: all 0.5s ease-in;
100+
opacity: 1;
101+
}
102+
101103
.clipboard-button-container {
102104
position: absolute;
103105
display: inline-block;
104-
top: 86px;
105-
right: 32px;
106+
top: 18px;
107+
right: 18px;
106108
opacity: 0;
107109
overflow: hidden;
108110
z-index: 10;

0 commit comments

Comments
 (0)