File tree Expand file tree Collapse file tree 3 files changed +39
-6
lines changed
Expand file tree Collapse file tree 3 files changed +39
-6
lines changed Original file line number Diff line number Diff line change 88 < link rel ="stylesheet " href ="codemirror-5.47.0/lib/codemirror.css ">
99 < link href ="https://fonts.googleapis.com/icon?family=Material+Icons "
1010 rel ="stylesheet ">
11+ < meta name ="viewport " content ="width=400 " />
12+ < meta name ="description " content ="Traducteur de langage naturel vers du Python ">
1113</ head >
1214< body >
1315 < header >
Original file line number Diff line number Diff line change @@ -99,6 +99,15 @@ function writeCode(){
9999 }
100100}
101101function toggleMenu ( ) {
102+ if ( $ ( window ) . scrollTop ( ) > $ ( "header" ) . outerHeight ( ) ) {
103+ $ ( "nav" ) . css ( {
104+ top : 0
105+ } )
106+ } else {
107+ $ ( "nav" ) . css ( {
108+ top : $ ( "header" ) . outerHeight ( ) - $ ( window ) . scrollTop ( ) //Makes the menu stick the header
109+ } )
110+ }
102111 $ ( "nav" ) . animate ( {
103112 left : parseInt ( $ ( "nav" ) . css ( 'left' ) , 10 ) == 0 ? - $ ( "nav" ) . outerWidth ( ) : 0
104113 } ) ;
@@ -108,4 +117,20 @@ $(function() {
108117 writeCode ( ) ;
109118 //Making sure everithing is coordinated in the ouput
110119 $ ( "#output .swicher" ) . val ( "text" )
120+ } ) ;
121+ $ ( window ) . resize ( function ( ) {
122+ $ ( "nav" ) . css ( {
123+ top : $ ( "header" ) . outerHeight ( )
124+ } )
125+ } ) ;
126+ $ ( window ) . scroll ( function ( ) {
127+ if ( $ ( window ) . scrollTop ( ) > $ ( "header" ) . outerHeight ( ) ) {
128+ $ ( "nav" ) . css ( {
129+ top : 0
130+ } )
131+ } else {
132+ $ ( "nav" ) . css ( {
133+ top : $ ( "header" ) . outerHeight ( ) - $ ( window ) . scrollTop ( ) //Makes the menu stick the header
134+ } )
135+ }
111136} ) ;
Original file line number Diff line number Diff line change 11@import url ('https://fonts.googleapis.com/css?family=Noto+Sans+HK:300&display=swap' );body {
22 font-family : 'Noto Sans HK' , sans-serif;
33}
4- body , html {
4+ body , html {
55 background-color : whitesmoke;
66 padding : 0px ;
77 margin : 0px ;
8+ min-width : 360px ;
89}
910# menu-openner {
1011 position : absolute;
@@ -20,11 +21,11 @@ body,html{
2021 font-size : 40px ;
2122}
2223nav {
23- position : absolute ;
24- top : 69 px ;
24+ position : fixed ;
25+ top : 0 px ;
2526 z-index : 1000 ;
2627 background-color : white;
27- height : calc ( 100vh - 69 px ) ;
28+ height : 100vh ;
2829 width : 300px ;
2930 border : 1px # cbcb solid;
3031 box-shadow : 2px 2px 10px silver;
@@ -180,14 +181,19 @@ h2{
180181 display : block;
181182 }
182183 # inputArea , # outputArea {
183- width : 100% ;
184+ width : 90% ;
185+ margin : auto;
184186 }
185187}
186- @media screen and (max-width : 500 px ){
188+ @media screen and (max-width : 600 px ){
187189 h1 {
188190 font-size : 25px ;
189191 }
190192 h1 img {
191193 height : 35px ;
192194 }
195+ section {
196+ padding : 0px ;
197+ width : 100% ;
198+ }
193199}
You can’t perform that action at this time.
0 commit comments