Skip to content

Commit

Permalink
Set up toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
souravtecken committed Mar 26, 2020
1 parent 51e8882 commit d3f535c
Show file tree
Hide file tree
Showing 33 changed files with 5,987 additions and 18 deletions.
32 changes: 28 additions & 4 deletions css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ html, body {
margin: 0;
padding: 0;
min-height: 100vh;
min-width: 100%;
min-width: 100%;
background-color: #E2E1E0 !important;
}

canvas {
Expand All @@ -14,10 +15,33 @@ canvas {
z-index: 1000;
}

#mainContainer {
#toolBarContainer {
width: 5rem;
}
.toolButtonBox:hover {
box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
}

.toolButtonBox {
cursor: pointer;
text-align: center;
margin: 0;
padding: 0 !important;
width: 100%;
border: none;
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
}

#canvasContainer {
background-color: #E2E1E0 !important;
.toolButton {
cursor: pointer;
border: none;
height: 100%;
width: 100%;
outline: none;
background-color: white;
font-size: 2rem;
}

.activeToolButton {
box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
}
44 changes: 35 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,43 @@
<script type="text/javascript" src="./js/paint.js"></script>
</head>

<body>
<div id="mainContainer" class="ui bottom attached segment pushable">
<div class="ui visible inverted left vertical sidebar menu">

<body>
<div id="toolBarContainer" class="ui mini left fixed vertical menu">
<div class="toolButtonBox">
<button class="toolButton">
<i class="pencil icon"></i>
</button>
</div>
<div id="canvasContainer" class="pusher">
<canvas id="myCanvas" height="600px" width="800px" oncontextmenu="return false;">
Hello, World!
</canvas>
<div class="toolButtonBox">
<button class="toolButton">
<i class="paint brush icon"></i>
</button>
</div>
</div>
<div class="ui left pointing dropdown link toolButtonBox">
<div class="menu">
<div class="item">To be color palette</div>
</div>
<button class="toolButton">
<i class="tint icon"></i>
</button>
</div>

<div class="toolButtonBox">
<button class="toolButton">
<i class="eraser icon"></i>
</button>
</div>
<div class="toolButtonBox">
<button class="toolButton">
<i class="trash icon"></i>
</button>
</div>
</div>

<canvas id="myCanvas" height="600px" width="800px" oncontextmenu="return false;">
Hello, World!
</canvas>

<script type="text/javascript" src="./js/index.js"></script>
</body>

Expand Down
14 changes: 9 additions & 5 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ canvas.addEventListener("mousedown", (event) => {
ctx.moveTo(event.offsetX, event.offsetY);
})

initCanvas(ctx);
function initToolBox(){
const toolButtonWidth = $('.toolButtonBox').width();
$('.toolButtonBox').css({'height':`${toolButtonWidth}px`});

$('.ui.dropdown')
.dropdown();
}

$('.visible.example .ui.sidebar')
.sidebar({
context: '.visible.example .bottom.segment'
}).sidebar('hide');
initCanvas(ctx);
initToolBox();
Binary file added semantic-ui/themes/basic/assets/fonts/icons.eot
Binary file not shown.
450 changes: 450 additions & 0 deletions semantic-ui/themes/basic/assets/fonts/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added semantic-ui/themes/basic/assets/fonts/icons.woff
Binary file not shown.
Binary file not shown.
1,008 changes: 1,008 additions & 0 deletions semantic-ui/themes/default/assets/fonts/brand-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added semantic-ui/themes/default/assets/fonts/icons.otf
Binary file not shown.
1,518 changes: 1,518 additions & 0 deletions semantic-ui/themes/default/assets/fonts/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
366 changes: 366 additions & 0 deletions semantic-ui/themes/default/assets/fonts/outline-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
200 changes: 200 additions & 0 deletions semantic-ui/themes/github/assets/fonts/octicons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2,373 changes: 2,373 additions & 0 deletions semantic-ui/themes/material/assets/fonts/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit d3f535c

Please sign in to comment.