Parcourir la source

Merge branch 'master' of http://git.choozmo.com:3000/choozmo/AI_Anchor_2

ming il y a 3 ans
Parent
commit
cf2af7fb36

+ 31 - 2
html/login.html

@@ -4,6 +4,7 @@
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta http-equiv="Cache-Control" content="no-cache">
     <title>AI Spokesgirl</title>
     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
     <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp"
@@ -26,9 +27,9 @@
 <body>
     <!-- ================================================================= -->
     <!-- navbar -->
-    <nav class="navbar navbar-expand-lg navbar-light">
+    <nav class="navbar navbar-expand-lg navbar-light d-block d-md-none">
         <div class="container-fluid">
-            <a class="navbar-brand" href="index.html">AI Spokesgirl</a>
+            <a class="navbar-brand d-block d-md-none" href="index.html">AI Spokesgirl</a>
             <button class="navbar-toggler" type="button" data-bs-toggle="collapse"
                 data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
                 aria-label="Toggle navigation">
@@ -69,6 +70,9 @@
     <div class="container-fluid px-0">
         <div class="container-login">
             <div class="row-img">
+                <video autoplay loop class="video">
+                    <source src="static/img/登入影片.mp4" type="video/mp4">
+                </video>
                 <div class="row-img-box text-center">
                     <h2>將你的生活、創作 、宣傳做成影片</h2>
                     <h4>開始使用 AI Spokesgirl</h4>
@@ -76,6 +80,31 @@
                 <div class="row-img-txt text-center">ChoozMo AI Spokesgirl</div>
             </div>
             <div class="row-login">
+                <div class="login-top d-none d-md-block">
+                    <ul class="navbar-nav ms-auto mb-2 mb-lg-0">
+                        <li class="nav-item">
+                            <a class="nav-link active" aria-current="page" href="pricing.html" set-lan="html:pricing">早鳥方案</a>
+                        </li>
+                        <li class="nav-item dropdown">
+                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
+                                中/En
+                            </a>
+                            <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
+                                <li><button class="nav-link lan-swtich" aria-current="page" set-lan="html:en" onclick="changeLan(this)" value="en">English</button></li>
+                                <li><button class="nav-link lan-switch" aria-current="page" set-lan="html:zh" onclick="changeLan(this)" value="zh">中文</button></li>
+                            </ul>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link active btn-login" aria-current="page" href="login.html" set-lan="html:login">登入</a>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link btn-userProfile" aria-current="page" href="user_profile.html" set-lan="html:user_profile">會員資料</a>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link btn-logout" aria-current="page" set-lan="html:logout">登出</a>
+                        </li>
+                    </ul>
+                </div>
                 <div class="login-content">
                     <!-- 已登入 {% if success %} -->
                   <!-- 未登入 {% endif %} -->

+ 6 - 0
html/login.js

@@ -3,6 +3,9 @@ const inputPassword = document.querySelector('#login #password');
 const btnLoginPage = document.querySelector('.btn-login');
 const btnUserProfile = document.querySelector('.btn-userProfile');
 const btnLogout = document.querySelector('.btn-logout');
+const btnLoginPage_d = document.querySelector('.login-top .btn-login');
+const btnUserProfile_d = document.querySelector('.login-top .btn-userProfile');
+const btnLogout_d= document.querySelector('.login-top .btn-logout');
 
 inputPassword.addEventListener('keyup', loginByEnter);
 btnLogin.addEventListener('click', login);
@@ -61,6 +64,9 @@ function loginControl() {
     btnLoginPage.style.display = 'block';
     btnLogout.style.display = 'none';
     btnUserProfile.style.display = 'none';
+    btnLoginPage_d.style.display = 'block';
+    btnLogout_d.style.display = 'none';
+    btnUserProfile_d.style.display = 'none';
 }
 
 loginControl();

+ 30 - 1
html/register.html

@@ -4,6 +4,7 @@
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta http-equiv="Cache-Control" content="no-cache">
     <title>AI Spokesgirl</title>
     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
     <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp"
@@ -26,7 +27,7 @@
 <body>
     <!-- ================================================================= -->
     <!-- navbar -->
-    <nav class="navbar navbar-expand-lg navbar-light">
+    <nav class="navbar navbar-expand-lg navbar-light d-block d-md-none">
         <div class="container-fluid">
             <a class="navbar-brand" href="index.html">AI Spokesgirl</a>
             <button class="navbar-toggler" type="button" data-bs-toggle="collapse"
@@ -69,6 +70,9 @@
     <div class="container-fluid px-0">
         <div class="container-login">
             <div class="row-img">
+                <video autoplay loop class="video">
+                    <source src="static/img/登入影片.mp4" type="video/mp4">
+                </video>
                 <div class="row-img-box text-center">
                     <h2>將你的生活、創作 、宣傳做成影片</h2>
                     <h4>開始使用 AI Spokesgirl</h4>
@@ -76,6 +80,31 @@
                 <div class="row-img-txt text-center">ChoozMo AI Spokesgirl</div>
             </div>
             <div class="row-login">
+                <div class="login-top d-none d-md-block">
+                    <ul class="navbar-nav ms-auto mb-2 mb-lg-0">
+                        <li class="nav-item">
+                            <a class="nav-link active" aria-current="page" href="pricing.html" set-lan="html:pricing">早鳥方案</a>
+                        </li>
+                        <li class="nav-item dropdown">
+                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
+                                中/En
+                            </a>
+                            <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
+                                <li><button class="nav-link lan-swtich" aria-current="page" set-lan="html:en" onclick="changeLan(this)" value="en">English</button></li>
+                                <li><button class="nav-link lan-switch" aria-current="page" set-lan="html:zh" onclick="changeLan(this)" value="zh">中文</button></li>
+                            </ul>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link active btn-login" aria-current="page" href="login.html" set-lan="html:login">登入</a>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link btn-userProfile" aria-current="page" href="user_profile.html" set-lan="html:user_profile">會員資料</a>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link btn-logout" aria-current="page" set-lan="html:logout">登出</a>
+                        </li>
+                    </ul>
+                </div>
                 <div class="login-content">
                     <!-- 已登入 {% if success %} -->
                   <!-- 未登入 {% endif %} -->

+ 6 - 0
html/register.js

@@ -3,6 +3,9 @@ const btnLoginPage = document.querySelector('.btn-login');
 const btnUserProfile = document.querySelector('.btn-userProfile');
 const btnLogout = document.querySelector('.btn-logout');
 const registerPassword = document.querySelector('#register #password');
+const btnLoginPage_d = document.querySelector('.login-top .btn-login');
+const btnUserProfile_d = document.querySelector('.login-top .btn-userProfile');
+const btnLogout_d= document.querySelector('.login-top .btn-logout');
 
 registerPassword.addEventListener('keyup', registerByEnter);
 btnRegister.addEventListener('click', register);
@@ -95,6 +98,9 @@ function loginControl() {
     btnLoginPage.style.display = 'block';
     btnLogout.style.display = 'none';
     btnUserProfile.style.display = 'none';
+    btnLoginPage_d.style.display = 'block';
+    btnLogout_d.style.display = 'none';
+    btnUserProfile_d.style.display = 'none';
 }
 
 loginControl();

BIN
html/static/img/登入影片.mp4


+ 6 - 23
html/static/script_util.js

@@ -1,22 +1,4 @@
-$(document).ready(function () {
-  let token = getCookie('jwt_token');
-  if(!token) {
-      return;
-  }
-  axios({
-    method: 'post',
-    url: 'http://www.choozmo.com:8887/user_profile',
-    headers: { 
-        'accept': 'text/html',
-        'Authorization': `Bearer ${token}`
-     }
-}).then(res => {
-  var userName='';
-  console.log(res.data.user_info.userName);
-  userName+=' <h2 class="user-name text-white mt-4 fw-bold">Hello,'+res.data.user_info.userName+'</h2>';
-  $('.userName').html(userName);
-  })
-});
+checkRoute();
 
 function checkRoute() {
   jwt_token = get_jwt_token();
@@ -31,17 +13,18 @@ function checkRoute() {
         'Authorization': `Bearer ${jwt_token}`
      }
   }).then(res => {
-    console.log(res.status);
+    console.log(res.data);
     if(res.status !== 200) {
       window.location.replace("login.html");
     }
+    var userName='';
+    userName+=' <h2 class="user-name text-white mt-4 fw-bold">Hello,'+res.data.user_info.userName+'</h2>';
+    $('.userName').html(userName);
   }).catch(err => {
     console.log(err);
   });
 }
 
-checkRoute();
-
 const btnLoginPage = document.querySelector('.btn-login');
 const btnUserProfile = document.querySelector('.btn-userProfile');
 const btnLogout = document.querySelector('.btn-logout');
@@ -312,7 +295,7 @@ var loaded_data = ''
 function openNav() {
   document.getElementById("mySidenav").style.width = "250px";
   document.querySelector('.loader').style.display = "block";
-  $.get("/history_input", function (data, status) {
+  $.get("http://www.choozmo.com:8887/history_input", function (data, status) {
     console.log(data)
     loaded_data = data
     for (var obj of data) {

+ 33 - 2
html/static/scss/style.css

@@ -823,10 +823,19 @@ body {
   -webkit-box-align: center;
       -ms-flex-align: center;
           align-items: center;
-  background-image: -webkit-gradient(linear, left top, right bottom, from(rgba(16, 68, 142, 0.7)), to(rgba(16, 68, 142, 0.7))), url("../img/sideImg.png");
-  background-image: linear-gradient(to right bottom, rgba(16, 68, 142, 0.7), rgba(16, 68, 142, 0.7)), url("../img/sideImg.png");
+  background-image: -webkit-gradient(linear, left top, right bottom, from(rgba(16, 68, 142, 0.7)), to(rgba(16, 68, 142, 0.7)));
+  background-image: linear-gradient(to right bottom, rgba(16, 68, 142, 0.7), rgba(16, 68, 142, 0.7));
   background-size: cover;
   background-position: center;
+  overflow: hidden;
+}
+
+.row-img .video {
+  height: 100%;
+  z-index: -1;
+  position: absolute;
+  left: -10%;
+  top: 0;
 }
 
 .row-img .row-img-box {
@@ -852,6 +861,7 @@ body {
       -ms-flex-align: center;
           align-items: center;
   text-align: center;
+  position: relative;
 }
 
 .row-login .title {
@@ -869,6 +879,27 @@ body {
   border-bottom: 4px solid #052859;
 }
 
+.row-login .login-top {
+  position: absolute;
+  right: 1rem;
+  top: 1rem;
+}
+
+.row-login .login-top .navbar-nav {
+  -webkit-box-orient: horizontal;
+  -webkit-box-direction: normal;
+      -ms-flex-direction: row;
+          flex-direction: row;
+}
+
+.row-login .login-top .navbar-nav .nav-item {
+  margin: 0 .5rem;
+}
+
+.row-login .login-top .navbar-nav .nav-item a {
+  color: black;
+}
+
 .login-content {
   width: 80%;
   min-width: 350px;

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
html/static/scss/style.css.map


+ 26 - 2
html/static/scss/style.scss

@@ -44,6 +44,7 @@ body {
 
 .navbar {
 	background-color: white;
+	
 }
 
 /* .imf {
@@ -774,9 +775,17 @@ body {
 	background-image: linear-gradient(to right bottom,
     rgba(#10448E, 0.7),
     rgba(#10448E, 0.7)
-	), url('../img/sideImg.png');
+	);
 	background-size: cover;
-    background-position: center;
+	background-position: center;
+	overflow: hidden;
+	.video {
+		height: 100%;
+		z-index: -1;
+		position: absolute;
+		left: -10%;
+		top: 0;
+	}
 	.row-img-box {
 		color: white;
 	}
@@ -794,6 +803,7 @@ body {
 	justify-content: flex-start;
 	align-items: center;
 	text-align: center;
+	position: relative;
 	.title {
 		position: relative;
 		color: #052859;
@@ -807,6 +817,20 @@ body {
 			border-bottom: 4px solid #052859;
 		}
 	}
+	.login-top {
+		position: absolute;
+		right: 1rem;
+		top: 1rem;
+		.navbar-nav {
+			flex-direction: row;
+			.nav-item {
+				margin: 0 .5rem;
+				a {
+					color: black;
+				}
+			}
+		}
+	}
 }
 
 .login-content {

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff