Skip to content

Commit

Permalink
Final version
Browse files Browse the repository at this point in the history
  • Loading branch information
BrokHoly committed Oct 28, 2024
1 parent 31bdd9a commit b36003a
Show file tree
Hide file tree
Showing 12 changed files with 489 additions and 152 deletions.
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,35 @@ Ainsi, '[/brokholy.github.io](https://github.com/BrokHoly/brokholy.github.io)' n

## Travail réalisé
Comme demandé, toutes les features de bases ont été ajoutées :
- Dessin de Rectangle
- Dessin de Ligne
- Modification de la couleur
- Modification de l'épaisseur des traits
- Suppression des Formes du dessin
- Dessin de Rectangle.
- Dessin de Ligne.
- Modification de la couleur.
- Modification de l'épaisseur des traits.
- Suppression des Formes du dessin.


## Travail bonus
Certaine features supplémentaires, non obligatoires mais proposée dans les consignes du TP, ont aussi été ajoutées tel que :
- Dessin de Cercle (Pas d'ellipses)
- Dessin de Polygones
- Mise en ligne du TP sur un CDN : https://brokholy.github.io
Certaine features supplémentaires, non obligatoires mais proposée dans les consignes du TP ou imaginé, ont aussi été ajoutées tel que :
- Dessin de Cercle (Pas d'ellipses).
- Dessin de Polygones.
- Mise en ligne du TP sur un CDN : https://brokholy.github.io.
- Changement de la couleur du background.
- Choisir le style de ligne.
- Transformation complète du style de la page.
- Mise à jour des valeurs d'édition au rafraichissement de la page.
- Symboliser les formes avec des SVG dans la liste des formes.


## Travail à venir
Nous désirons ajouter encore quelques features comme :
- Changement de la couleur du background
- Boutons Undo/Redo
- Choisir le style de ligne (ctx.setLineDash)
- Boutons Undo/Redo.
- Ajouter un SVG de 'style de ligne' dans la liste des formes.


## Bugs trouvés/Travaux en cours :
- Les boutons 'Undo' et 'Redo' sont affichés mais désactivés.
- Le style de ligne est buggé pour les polygones.
- Le style de ligne ne se met pas à jour au changement d'épaisseur.

## Credits
Ce TP est le résultat d'un Fork du repo de O.Barais.
Expand Down
4 changes: 4 additions & 0 deletions assets/circle-svgrepo-com.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/line-tool-svgrepo-com.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/rectangle-wide-svgrepo-com.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/triangle-svgrepo-com.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
271 changes: 177 additions & 94 deletions canvas.css
Original file line number Diff line number Diff line change
@@ -1,108 +1,191 @@
*,*::after,*::before{
padding: 0px;
margin: 0px;
}

.myCanvas {
body{
color: white;
height: calc(100vh - 30px);
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
background:conic-gradient(from 45deg,rgb(16, 59, 112),rgb(62, 62, 167),rgb(36, 105, 81),rgb(65, 101, 145),rgb(112, 42, 193),rgb(16, 59, 112));;
}

#container{
width: 1000px;
margin: auto;
margin-top: 30px;
/* box-shadow: 0px 0px 10px white; */
padding: 0px;
/* background-color: cyan; */
/* border: 1px white solid; */
/* border-radius: 30px; */
}

.cf:before,.cf:after{content:"";display:table}.cf:after{clear:both}.cf{zoom:1}

.mx-button {
float: left;
#tools{
display: flex;
justify-content: space-between;
padding: 10px;
background-color: rgba(255, 255, 255, 0.24);
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.mx-button input {
display: none;

#shapeSelector{
margin-left: 10px;
display: flex;
gap: 3px;
}
.mx-button label {
background: #ccc;
border: 1px solid #888;
color: #666;
padding: 5px 10px;

.radioButton{
/* background-color: wheat; */
display: flex;
justify-content: center;
align-items: center;
/* border: black solid 2px; */
}
.mx-button label:hover {
background-color: #ddd;

.radioButton input{
display:none;
}
.mx-button label:active,
.mx-button input:focus + label {
background-color: #aaa;

.radioButton label{
color: white;
padding: 10px;
border: white solid 1px;
border-radius: 5px;
background: linear-gradient(45deg, rgb(61, 57, 74), rgb(87, 81, 105), rgb(61, 57, 74))
}
.mx-button input:checked + label {
background-color: #b4b4b4;

.radioButton input:checked + label{
background: linear-gradient(45deg, rgb(12, 87, 47), rgb(14, 113, 60), rgb(12, 87, 47));
}

.radioButton input:hover + label{
background : linear-gradient(45deg, rgb(26, 40, 101), rgb(35, 54, 139), rgb(26, 40, 101));
}


#sidesSelect{
color: white;
padding-top: 5px;
padding-left: 3px;
padding-right: 3px;
border: white solid 1px;
border-radius: 5px;
background: linear-gradient(45deg, rgb(61, 57, 74), rgb(87, 81, 105), rgb(61, 57, 74));
overflow: hidden;
display: flex;
flex-direction: column;
}

#sidesSelect input{
height: 50%;
}

#backgroundSelect{
color: white;
padding-top: 5px;
padding-left: 3px;
padding-right: 3px;
border: white solid 1px;
border-radius: 5px;
background: linear-gradient(45deg, rgb(61, 57, 74), rgb(87, 81, 105), rgb(61, 57, 74));
overflow: hidden;
display: flex;
flex-direction: column;
}

#backgroundSelect input{
height: 55%;
width: 100%;
}

#styleSelector{
display: flex;
gap: 10px;
}

#styleSelector div{
display: flex;
flex-direction: column;
}


#workspace{
margin: 0px;
display: flex;
gap: 3px;
}

#canvasDiv{
margin: 0px;
padding: 0px;
}

#myCanvas {

form {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: 80px;
}

.mx-button label {
background-color: #f5f5f5;
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
background-image: linear-gradient(top, #ffffff, #e6e6e6);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
border: 1px solid #cccccc;
border-bottom-color: #b3b3b3;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
color: #333333;
cursor: pointer;
display: inline-block;
margin-bottom: 0;
margin-left: -1px;
padding: 4px 10px;
font-size: 13px;
line-height: 18px;
text-align: center;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
vertical-align: middle;
}
.mx-button label:hover {
background-color: #e6e6e6;
background-position: 0 -15px;
color: #333333;
text-decoration: none;
-webkit-transition: background-position 0.1s linear;
-moz-transition: background-position 0.1s linear;
-ms-transition: background-position 0.1s linear;
-o-transition: background-position 0.1s linear;
transition: background-position 0.1s linear;
}
.mx-button label:active,
.mx-button input:focus + label {
background-color: #d9d9d9;
background-image: none;
-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
outline: 0;
}

.mx-button input:checked + label {
background: #f5f5f5;
-webkit-box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}
.mx-button:first-child label {
-webkit-border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
border-top-left-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
border-bottom-left-radius: 4px;
margin-left: 0;
}
.mx-button:last-child label {
-webkit-border-top-right-radius: 4px;
-moz-border-radius-topright: 4px;
border-top-right-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
border-bottom-right-radius: 4px;
}

#shapeManager{
width: 100%;
background-color: rgb(32, 25, 53);
/* overflow-y: scroll; */
max-height: 600px;
}





#clearButton{
width: 100%;
background-color: red;
color: white;
font-weight: 900;
}

#unreDo{
display: flex;
justify-content: space-around;
}

#unreDo button{
width: 100%;
}

#shapeList{
max-height: 560px;
overflow-y: scroll;
color: white;
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 3px;
}

#shapeList li{
width: 100%;
display: flex;
justify-content: space-between;
background-color: rgba(0, 0, 0, 0.1);
}

#shapeList li:nth-child(odd){
/* width: 100%; */
background-color: rgba(255, 255, 255, 0.2);
}

.shapeIcon{
height: 15px;
filter : invert(100%)
}

.shapeRemover{
color: white;
margin-left: 5px;
margin-right: 5px;
padding-left: 10px;
padding-right: 10px;
text-shadow: 0px 0px 3px black;
}
Loading

0 comments on commit b36003a

Please sign in to comment.