Corentin NELHOMME hace 1 año
padre
commit
f49f5b575d
Se han modificado 5 ficheros con 112 adiciones y 58 borrados
  1. 1 31
      index.css
  2. 58 7
      index.html
  3. 15 3
      index.js
  4. 33 12
      nse.css
  5. 5 5
      video.html

+ 1 - 31
index.css

@@ -2,36 +2,6 @@ img {
     width: 400px;
 }
 
-#modalNse {
-    background-color: rgb(255, 255, 255);
-    border-radius: 10px;
-    box-shadow: rgba(100, 100, 111, 0.637) 0px 7px 29px 0px;
-}
-
-#editImageBtn {
-    padding: 1rem 1.8rem;
-    background-color: rgb(255, 255, 255);
-    color: rgb(0, 0, 0);
-    font-family: Arial, Helvetica, sans-serif;
-    border: none;
-    border-radius: 10px;
-    box-shadow: rgba(100, 100, 111, 0.267) 0px 7px 29px 0px;
-    font-weight: 700;
-    cursor: pointer;
-}
-
-#modalNseBackground {
-    display: none;
-    position: fixed;
-    left: 0;
-    top: 0;
-    height: 100vh;
-    width: 100%;
-    backdrop-filter: blur(5px);
-    justify-content: center;
-    align-items: center;
-}
-
 #cropper-modal {
     display: none;
     position: fixed;
@@ -49,7 +19,7 @@ img {
     padding: 20px;
     border-radius: 8px;
     max-width: 90%;
-    max-height: 90%;
+    max-height: 890px;
     overflow: auto;
   }
   #cropper-container img {

+ 58 - 7
index.html

@@ -310,17 +310,68 @@
             <div id="cropper-container">
               <img id="cropper-image" src="" alt="Cropper Image" />
               <div id="cropper-actions">
-                <button id="cropper-cancel">Annuler</button>
-                <button id="cropper-confirm">Cropper & Valider</button>
+                <button class="defaultNseButton close" id="cropper-cancel">Annuler</button>
+                <button class="defaultNseButton" id="cropper-confirm">Cropper & Valider</button>
               </div>
             </div>
           </div>
 
-          <div id="modalNseBackground">
-            <div id="modalNse">
-              <div id="uppy"></div>
-            </div>
-          </div>
+                    <!-- Début du nseVideoEditor --->
+                    <div id="modalNseBackground">
+                      <div id="modalNse">
+                        <div id="uppy"></div>
+                      </div>
+                    </div>
+          
+                    <div id="modalNseVideoBackground">
+                      <div id="modalPosterNse">
+                        <h1>Poster - Image preview</h1>
+                        <p>Your actual image</p>
+          
+                        <div class="previewCenter">
+                          <img class="preview" id="posterPreview"/> 
+                        </div> 
+          
+                        <p>Your updated image</p>
+                        <div id="uppy-poster"></div>
+          
+                          <div class="modalButtonContainer">
+                            <button id="closeVideoModal" class="defaultNseButton close">Close</button>
+                            <button id="nextToVideo" class="defaultNseButton">
+                              Next to Video
+                            </button>
+                        </div>
+                      </div>
+          
+                      <div id="modalVideoNse">
+                        <h1>Video</h1>
+          
+                        <div class="modalFlex">
+                          <label>Description for accessibility</label>
+                          <input id="ariaLabel" type="text">                
+                        </div>
+          
+                        <div class="modalFlex">
+                          <label>Title</label>
+                          <input id="videoTitle" type="text">                
+                        </div>
+          
+                        <div class="previewCenter">
+                        <video autoplay controls class="preview" id="videoPreview"></video>
+                         </div> 
+          
+                        <div id="uppy-video"></div>
+          
+                        <div class="modalButtonContainer">
+                          <button id="backToPoster" class="defaultNseButton">
+                            Go back to Poster
+                          </button>
+                          <button id="submitVideoEditor" class="defaultNseButton">Submit</button>
+                        </div>
+                      </div>
+                    </div>
+          
+                    <!-- Fin du nseVideoEditor-->
           <button
             id="manager"
             class="fred--launcher_btn fred--launcher_btn_manager"

+ 15 - 3
index.js

@@ -722,6 +722,11 @@ let NEWSITEEDITOR = (function () {
         maxNumberOfFiles: 1,
         allowedFileTypes: [".jpg", ".jpeg", ".png", ".gif", ".webp"],
       },
+      locale: {
+        strings: {
+          uploadXFiles: "Save file !"
+        }
+      }
     });
 
     uppy.use(Dashboard, {
@@ -753,10 +758,11 @@ let NEWSITEEDITOR = (function () {
     uppy.use(XHRUpload, { endpoint: "http://localhost/php/index.php" });
 
     const customButton = document.createElement("button");
-    customButton.innerText = "Edit";
+    customButton.innerText = "Replace image";
     customButton.style.position = "absolute";
     customButton.style.display = "none";
     customButton.id = "editImageBtn";
+    customButton.classList.add("defaultNseButton", "visible");
     document.body.append(customButton);
 
     customButton.onclick = () => showNseModal(true);
@@ -1381,9 +1387,15 @@ let NEWSITEEDITOR = (function () {
       });
 
       const player = videojs(currentId);
-      player.poster("http://localhost/php/" + result.files.poster);
+      player.poster(
+        result.files.poster
+          ? "http://localhost/php/" + result.files.poster
+          : videoOldInfo.poster
+      );
       player.src({
-        src: "http://localhost/php/" + result.files.video,
+        src: result.files.video
+          ? "http://localhost/php/" + result.files.video
+          : videoOldInfo.src,
         type: "video/mp4",
       });
 

+ 33 - 12
nse.css

@@ -1,3 +1,5 @@
+@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
+
 .fred .fred--launcher_center {
     position: fixed;
     width: 100%;
@@ -171,7 +173,7 @@ border-radius: 11px;
 
 .labelInput{
     color:white;
-    font: 16px "Helvetica Neue", Helvetica, Arial, Tahoma, sans-serif
+    font: 16px "Inter", Helvetica, Arial, Tahoma, sans-serif
 }
 
 .inputBox {
@@ -181,7 +183,7 @@ border-radius: 11px;
     border: 1px solid #E4E4E4;
     position: relative;
     transition: border-color 0.25s;
-    font: 16px "Helvetica Neue", Helvetica, Arial, Tahoma, sans-serif
+    font: 16px "Inter", Helvetica, Arial, Tahoma, sans-serif
 }
 
 label[for="paddingTop"],[for="paddingBottom"]{
@@ -190,14 +192,20 @@ label[for="paddingTop"],[for="paddingBottom"]{
 
 /* Pour le nseVideoEditor */
 
-.defaultNseButton {
+.defaultNseButton, .uppy-StatusBar-actionBtn--upload {
     padding: .375rem .75rem;
-    border-radius: .25rem;
-    background-color: #549c89;
+    border-radius: .25rem !important;
+    background-color: #549c89 !important;
     color: white;
     cursor: pointer;
 }
 
+.defaultNseButton.visible {
+    background-color: white !important;
+    color: black !important;
+    box-shadow: 0px 10px 61px -3px rgba(0, 0, 0, 0.685);
+}
+
 .defaultNseButton.close {
     background: #ed673e !important;
 }
@@ -207,26 +215,27 @@ label[for="paddingTop"],[for="paddingBottom"]{
     z-index: 20000;
 }
 
-#modalNseVideoBackground {
+#modalNseVideoBackground, #modalNseBackground {
     display: none;
     position: fixed;
     left: 0;
     top: 0;
     height: 100vh;
     width: 100%;
-    z-index: 10000;
+    z-index: 800;
     background-color: rgba(0, 0, 0, 0.247);
     justify-content: center;
     align-items: center;
+    cursor: pointer;
 }
 
 #modalPosterNse, #modalVideoNse {
+    font-family: "Inter", "Haettenschweiler", 'Arial Narrow Bold', sans-serif;
     background-color: rgb(255, 255, 255);
     border-radius: 10px;
     box-shadow: rgba(0, 0, 0, 0.068) 0px 7px 29px 0px;
-    min-height: 50vh;
-
-    padding: 2rem;
+    cursor: default;
+    padding: 1.5rem;
     margin: 0 20px;
 
     & h1 {
@@ -246,12 +255,20 @@ label[for="paddingTop"],[for="paddingBottom"]{
         flex-direction: column;
         margin-bottom: 1rem;
 
+        & label {
+            font-size: 14px;
+            color: #272b33;
+        }
+
         & input {
             height: 40px;
             padding: 0.5rem;
+            padding-inline: 10px 20px;
             margin-top: 0.5rem;
-            border: 1px solid #549c89;
+            outline: 1px solid #d1d5dc;
             border-radius: 0.25rem;
+            font-size: 0.95rem;
+            color: #101828;
         }
     }
 }
@@ -263,11 +280,15 @@ label[for="paddingTop"],[for="paddingBottom"]{
 .previewCenter {
     display: flex;
     justify-content: center;
-    margin-top: 1rem;
+    margin-top: 0.5rem;
     margin-bottom: 1rem;
 }
 
 .preview {
     aspect-ratio: 16 / 9;
     max-width: 400px;
+}
+
+.preview {
+    border-radius: 0.25rem;
 }

+ 5 - 5
video.html

@@ -44,7 +44,7 @@
           <div id="modalNseVideoBackground">
             <div id="modalPosterNse">
               <h1>Poster - Image preview</h1>
-              <p>Your actual image</p>
+              <p>Your current image</p>
 
               <div class="previewCenter">
                 <img class="preview" id="posterPreview"/> 
@@ -65,13 +65,13 @@
               <h1>Video</h1>
 
               <div class="modalFlex">
-                <label>Description for accessibility</label>
-                <input id="ariaLabel" type="text">                
+                <label>Title</label>
+                <input id="videoTitle" type="text">                
               </div>
 
               <div class="modalFlex">
-                <label>Title</label>
-                <input id="videoTitle" type="text">                
+                <label>Description for people using screen readers (screen reader)</label>
+                <input id="ariaLabel" type="text">                
               </div>
 
               <div class="previewCenter">