From d628afbc6899285971734d5576f3bc2bcfbe6713 Mon Sep 17 00:00:00 2001 From: mberard Date: Mon, 25 Oct 2021 23:54:27 +0200 Subject: [PATCH] fix: conflicts --- .htaccess | 1 - anthologie.php | 25 ++++ apropos.php | 26 ++++ index.html | 195 --------------------------- index.php | 111 +++++++++++++++ parts/head.php | 36 +++++ parts/header.php | 29 ++++ src/anthology.js | 51 ------- src/app.css | 328 ++++++++++++++++++++++----------------------- src/translation.js | 21 ++- 10 files changed, 405 insertions(+), 418 deletions(-) create mode 100644 anthologie.php create mode 100644 apropos.php delete mode 100644 index.html create mode 100644 index.php create mode 100644 parts/head.php create mode 100644 parts/header.php diff --git a/.htaccess b/.htaccess index 5a928f6..e69de29 100644 --- a/.htaccess +++ b/.htaccess @@ -1 +0,0 @@ -Options -Indexes diff --git a/anthologie.php b/anthologie.php new file mode 100644 index 0000000..630732a --- /dev/null +++ b/anthologie.php @@ -0,0 +1,25 @@ + + + + + +
+

Anthologie

+

+ Si vous souhaitez supprimer un message/poème public, merci de le faire savoir à contact@avion-poe.me +



+
+
+
+ +
+

Retour à la carte

+
+ + + + + + + + \ No newline at end of file diff --git a/apropos.php b/apropos.php new file mode 100644 index 0000000..179541f --- /dev/null +++ b/apropos.php @@ -0,0 +1,26 @@ + + + + + + +
+

A propos



+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+

Librairies utilisées

+

Bootstrap | jQuery | Leaflet | Leaflet.fullscreen | Leaflet-locatecontrol | Leaflet.PixiOverlay | Leaflet.Terminator | Moment.js | PixiJS | Popper | Quill | RasterizeHTML.js | Turf.js | OriSim3D-JS | Geonames

+

Sources de la carte

+ +
+
+
+
+

Retour à la carte

+
+ + + + \ No newline at end of file diff --git a/index.html b/index.html deleted file mode 100644 index d88e328..0000000 --- a/index.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - Avion-poème - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - -
-

Anthologie

-

- Si vous souhaitez supprimer un message/poème public, merci de le faire savoir à contact@avion-poe.me -



-
-
-
- -
-

A propos



-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

-

Librairies utilisées

-

Bootstrap | jQuery | Leaflet | Leaflet.fullscreen | Leaflet-locatecontrol | Leaflet.PixiOverlay | Leaflet.Terminator | Moment.js | PixiJS | Popper | Quill | RasterizeHTML.js | Turf.js | OriSim3D-JS | Geonames

-

Sources de la carte

- -
-
-
-
-

Retour à la carte

-
- - - - - - - - - - - - \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..f3063b9 --- /dev/null +++ b/index.php @@ -0,0 +1,111 @@ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/parts/head.php b/parts/head.php new file mode 100644 index 0000000..31d4178 --- /dev/null +++ b/parts/head.php @@ -0,0 +1,36 @@ + + + + + + Avion-poème + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/parts/header.php b/parts/header.php new file mode 100644 index 0000000..9e48743 --- /dev/null +++ b/parts/header.php @@ -0,0 +1,29 @@ + + \ No newline at end of file diff --git a/src/anthology.js b/src/anthology.js index 5b712a3..523db59 100644 --- a/src/anthology.js +++ b/src/anthology.js @@ -1,54 +1,3 @@ -//open / close -var anthologyOpen = 0 - -$('#buttonAnthology').on('click',function(){ - //hiding navbar - $('.navbar-collapse').collapse('hide'); - if (anthologyOpen > 0){ - $('#anthology').css('visibility','hidden'); - $('#anthology').css('opacity','0') - $('#backToMap').css('visibility','hidden'); - $('#backToMap').css('opacity','0') - anthologyOpen = 0 - } - else{ - $('#anthology').css('visibility','visible') - $('#anthology').css('opacity','1') - $('#backToMap').css('visibility','visible'); - $('#backToMap').css('opacity','1') - anthologyOpen = 1 - displayAnthology() - - } - //closing about - $('#about').css('visibility','hidden'); - $('#about').css('opacity','0') - aboutOpen = 0 -}) - -$('#closeAnthologyAbout').on('click',function(){ - $('#anthology').css('opacity','0') - $('#anthology').css('visibility','hidden') - $('#backToMap').css('opacity','0') - $('#backToMap').css('visibility','hidden') - anthologyOpen = 0 -}) - -$('#navTitle').on('click',function(){ - $('#anthology').css('opacity','0') - $('#anthology').css('visibility','hidden') - $('#backToMap').css('opacity','0') - $('#backToMap').css('visibility','hidden') - $('#about').css('opacity','0') - $('#about').css('visibility','hidden') - aboutOpen = 0 - anthologyOpen = 0 -}) - - - - - function flightTime(a,b){ var days = Math.round((b-a)/86400 * 100) / 100 var months = Math.round(days/30) diff --git a/src/app.css b/src/app.css index 3d18e91..dfebd43 100644 --- a/src/app.css +++ b/src/app.css @@ -4,19 +4,19 @@ body { height: 100%; } -body { - position: relative; - margin: 0; - padding: 0; - font-family: 'PT Mono', monospace; +body { + position: relative; + margin: 0; + padding: 0; + font-family: "PT Mono", monospace; } -#map { - position: fixed; - top: 0; - bottom: 0; - height:100%; - width: 100%; +#map { + position: fixed; + top: 0; + bottom: 0; + height: 100%; + width: 100%; } .footer { @@ -27,238 +27,230 @@ body { height: 30px; line-height: 30px; /* Vertically center the text there */ background-color: #f5f5f5; - font-size: 12px + font-size: 12px; } - /* big modal */ .modal-lg { - max-width:1140px !important; + max-width: 1140px !important; } /* paper plane animation */ -#canvas3d{ - display:none; - transition: all .3s; - position:fixed; - height:100vh; - width:100vw; - background-color: rgba(0,0,0,0); - z-index:9999; - margin-top: 50vh; /* poussé de la moitié de hauteur de viewport */ - transform: translateY(-50%) translateX(-50%); /* tiré de la moitié de sa propre hauteur */ - margin-left: 50vw; /* poussé de la moitié de hauteur de viewport */ +#canvas3d { + display: none; + transition: all 0.3s; + position: fixed; + height: 100vh; + width: 100vw; + background-color: rgba(0, 0, 0, 0); + z-index: 9999; + margin-top: 50vh; /* poussé de la moitié de hauteur de viewport */ + transform: translateY(-50%) translateX(-50%); /* tiré de la moitié de sa propre hauteur */ + margin-left: 50vw; /* poussé de la moitié de hauteur de viewport */ } /* qill text editor */ #messageTextArea { min-height: 200px; - border-radius: 0px 0px .25em .25em !important; - border-color: #ced4da !important + border-radius: 0px 0px 0.25em 0.25em !important; + border-color: #ced4da !important; } -.ql-toolbar{ - border-radius: .25em .25em 0px 0px !important; - border-color: #ced4da !important +.ql-toolbar { + border-radius: 0.25em 0.25em 0px 0px !important; + border-color: #ced4da !important; } /* make the pixi overlay on top of the arc lines */ .leaflet-pixi-overlay { - position: absolute !important; - z-index: 201 !important; + position: absolute !important; + z-index: 201 !important; } -.bold{ - font-weight:bold !important +.bold { + font-weight: bold !important; } /* Anthology */ -#anthology{ - visibility:hidden; - opacity:0; - transition:visibility 0.2s linear,opacity 0.2s linear; - position:absolute; - z-index:1029; - padding-top:66px; - padding-bottom:35px; - padding-left:30%; - padding-right:30%; - overflow-x:hidden; - height:100vh; - width:100vw; - background-color:rgba(255,255,255,0.9) +#anthology { + margin-top: 30px; + z-index: 1029; + padding-top: 66px; + padding-bottom: 35px; + padding-left: 30%; + padding-right: 30%; + overflow-x: hidden; + width: 100vw; + background-color: rgba(255, 255, 255, 0.9); } /* About */ -#about{ - visibility:hidden; - opacity:0; - transition:visibility 0.2s linear,opacity 0.2s linear; - position:absolute; - z-index:1029; - padding-top:66px; - padding-bottom:35px; - padding-left:30%; - padding-right:30%; - overflow-x:hidden; - height:100vh; - width:100vw; - background-color:rgba(255,255,255,0.9) +#about { + margin-top: 30px; + z-index: 1029; + padding-top: 66px; + padding-bottom: 35px; + padding-left: 30%; + padding-right: 30%; + overflow-x: hidden; + width: 100vw; + background-color: rgba(255, 255, 255, 0.9); } -#backToMap{ - visibility:hidden; - opacity:0; - transition:visibility 0.2s linear,opacity 0.2s linear; - position:fixed; - z-index:1035; - padding-left:10%; - padding-right:10%; - overflow-x:hidden; - width:100vw; - bottom:0px; - background-color:rgba(255,255,255,1); - border-top: 1px solid #ddd; +#backToMap { + transition: visibility 0.2s linear, opacity 0.2s linear; + position: fixed; + z-index: 1035; + padding-left: 10%; + padding-right: 10%; + overflow-x: hidden; + width: 100vw; + bottom: 0px; + background-color: rgba(255, 255, 255, 1); + border-top: 1px solid #ddd; } -#backToMap a{ - color:#070707 +#backToMap a { + color: #070707; } -#backToMap p{ - margin-bottom:5px; - padding-top:3px; +#backToMap p { + margin-bottom: 5px; + padding-top: 3px; } -#backToMap a:hover{ - color:black +#backToMap a:hover { + color: black; } -.leaflet-popup-content-wrapper{ - font-family: 'PT Mono', monospace; - border-radius: 1px; - /* font-family: 'Special Elite', cursive !important */ +.leaflet-popup-content-wrapper { + font-family: "PT Mono", monospace; + border-radius: 1px; + /* font-family: 'Special Elite', cursive !important */ } -.leaflet-popup-content{ - /* min-width:280px; */ - margin-left: 10px; - margin-right: 21px; - margin-top: 10px; - margin-bottom: 10px; +.leaflet-popup-content { + /* min-width:280px; */ + margin-left: 10px; + margin-right: 21px; + margin-top: 10px; + margin-bottom: 10px; } -.leaflet-popup-content hr{ - width: 267px; - margin-top: 10px; - margin-bottom: 10px; +.leaflet-popup-content hr { + width: 267px; + margin-top: 10px; + margin-bottom: 10px; } .leaflet-control-scale-line:not(:first-child) { - border-top: none; - border-bottom: 1px solid; - margin-top: 0px; + border-top: none; + border-bottom: 1px solid; + margin-top: 0px; } .leaflet-control-scale-line { - FONT-WEIGHT: 100; - font-family: 'PT Mono', monospace; - border: 1px solid #fff; - border-right: none; - border-top: none; - border-left: none; - line-height: 1.1; - padding: 2px 5px 1px; - font-size: 11px; - white-space: nowrap; - overflow: hidden; - color: white; - -moz-box-sizing: border-box; - box-sizing: border-box; - /* background: #fff; */ - background: rgba(255, 255, 255, 0); + font-weight: 100; + font-family: "PT Mono", monospace; + border: 1px solid #fff; + border-right: none; + border-top: none; + border-left: none; + line-height: 1.1; + padding: 2px 5px 1px; + font-size: 11px; + white-space: nowrap; + overflow: hidden; + color: white; + -moz-box-sizing: border-box; + box-sizing: border-box; + /* background: #fff; */ + background: rgba(255, 255, 255, 0); } .leaflet-bar a:last-child { - border-bottom-left-radius: 1px !important; - border-bottom-right-radius: 1px !important; + border-bottom-left-radius: 1px !important; + border-bottom-right-radius: 1px !important; } .leaflet-bar a:first-child { - border-top-left-radius: 1px !important; - border-top-right-radius: 1px !important; + border-top-left-radius: 1px !important; + border-top-right-radius: 1px !important; } /* pulsating marker */ .pulse-icon-anim { - margin-top:2px; - margin-left:2px; - border: 3px solid; - -webkit-border-radius: 30px; - height: 18px; - width: 18px; - -webkit-animation: pulsate 1s ease-out; - -webkit-animation-iteration-count: infinite; - /*opacity: 0.0*/ + margin-top: 2px; + margin-left: 2px; + border: 3px solid; + -webkit-border-radius: 30px; + height: 18px; + width: 18px; + -webkit-animation: pulsate 1s ease-out; + -webkit-animation-iteration-count: infinite; + /*opacity: 0.0*/ } @-webkit-keyframes pulsate { - 0% {-webkit-transform: scale(0.1, 0.1); opacity: 0.0;} - 50% {opacity: 1.0;} - 100% {-webkit-transform: scale(1.2, 1.2); opacity: 0.0;} + 0% { + -webkit-transform: scale(0.1, 0.1); + opacity: 0; + } + 50% { + opacity: 1; + } + 100% { + -webkit-transform: scale(1.2, 1.2); + opacity: 0; + } } -a#navbarDropdownLang.nav-link.dropdown-toggle::after{ - margin-left:0px !important +a#navbarDropdownLang.nav-link.dropdown-toggle::after { + margin-left: 0px !important; } -.nav-item{ - margin-right:10px +.nav-item { + margin-right: 10px; } -.dropdown-menu{ - font-size:0.9em !important; - padding: 0px !important +.dropdown-menu { + font-size: 0.9em !important; + padding: 0px !important; } .ql-editor { - min-height:170px !important; - width: 100% !important + min-height: 170px !important; + width: 100% !important; } .ql-editor p { - font-size:1.25em !important; - + font-size: 1.25em !important; } .ql-editor .ql-size-small { - font-size: 0.9em !important; + font-size: 0.9em !important; } @media screen and (max-width: 600px) { - .modal-body { - font-size:0.9rem - } - .modal-body .form-control{ - font-size:0.8rem - } - .leaflet-popup-content { - margin: 10px 10px; - line-height: 1.4; - } - #anthologyItems{ - font-size:0.8rem - } - #about{ - padding-left:5% !important; - padding-right:5% !important; - } - #anthology{ - padding-left:5% !important; - padding-right:5% !important; - } + .modal-body { + font-size: 0.9rem; + } + .modal-body .form-control { + font-size: 0.8rem; + } + .leaflet-popup-content { + margin: 10px 10px; + line-height: 1.4; + } + #anthologyItems { + font-size: 0.8rem; + } + #about { + padding-left: 5% !important; + padding-right: 5% !important; + } + #anthology { + padding-left: 5% !important; + padding-right: 5% !important; + } } - - - - diff --git a/src/translation.js b/src/translation.js index 238933b..fe8c57a 100644 --- a/src/translation.js +++ b/src/translation.js @@ -1,6 +1,14 @@ +// Default lang var lang = 'en' + +// Lang by session +var langSession = sessionStorage.getItem('lang'); +// Lang by navigator config var userLang = navigator.userLanguage || navigator.language; -if (userLang){ + +if (langSession) { + lang = langSession.substring(0,2) +} else if (userLang) { lang = userLang.substring(0,2) } @@ -25,6 +33,7 @@ $(document).ready(function(){ } $(".langSelect").on('click',function(e){ lang = e.currentTarget.attributes[1].value + sessionStorage.setItem('lang', lang); translateUI(lang) //$("#navbarDropdownLang").html($(this).html()) }) @@ -90,7 +99,13 @@ function translateUI(l){ $("#navTitle").html(s.avionpoeme) $("#buttonAnthology").html(s.anthologie) $("#buttonAbout").html(s.apropos) - $("#buttonNewPlane").val(s.lancer_avion+" "+nbPlane+"/100") + if (typeof nbPlane !== 'undefined') { + $("#buttonNewPlane").val(s.lancer_avion+" "+nbPlane+"/100") + } else { + $("#buttonNewPlane").on('click', () => { + window.location.replace("/"); + }) + } //new plane form $("#newPlaneModalTitle").html(s.lancer_avion) $("#newPlaneModalMessage").html(s.message) @@ -138,7 +153,7 @@ function translateUI(l){ }) //plane limit tooltip - if (nbPlane > 99){ + if (nbPlane && nbPlane > 99){ $("#planeLimitTooltip").attr("title", s.AvionPoeme_epuise).tooltip("_fixTitle"); } else{