Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/common/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,17 @@ input[type="range"]::-webkit-slider-runnable-track {

.left {
position: relative;
flex: 0 0 240px;
max-width: 240px;
min-width: 240px;
height: 100vh;
box-shadow: 1px 0px 20px rgba(0, 0, 0, 0.08);
overflow-y: auto;
overflow-x: hidden;
overflow-x: scroll;
}

.right {
position: relative;
flex: 1 1 880px;
max-width: 880px;
/* max-width: 880px; */
background-color: #f2f7f8;
padding-top: 1rem;
padding-bottom: 1rem;
padding: 1rem;
height: 100vh;
overflow-y: auto;
}
Expand Down Expand Up @@ -118,7 +113,7 @@ input[type="range"]::-webkit-slider-runnable-track {
margin-bottom: 0.25rem !important;
padding: 0.25rem 0.5rem;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
/* color: rgba(0, 0, 0, 0.85); */
}

.triangle {
Expand Down Expand Up @@ -160,7 +155,7 @@ input[type="range"]::-webkit-slider-runnable-track {
}

.sidebar-top a {
display: inline-block;
/* display: inline-block; */
}

.sidebar-item {
Expand Down Expand Up @@ -470,3 +465,8 @@ button#join, button#leave {
margin-top: 0.5rem !important;
}
}


.finder {
border: 5px solid red;
}
141 changes: 106 additions & 35 deletions src/common/left-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,28 @@ function __isSmallScreen() {
const windowWidth = $(window).width();
return windowWidth <= SM_WIDTH;
}

function __transListToMenuDom(list) {
return list
.map((item) => {
return `<div class="sidebar-menu" >
<div class="sidebar-title">
<span class="i18n" name="${item.name}"></span>
<span class="triangle"></span>
</div>
<div class="sidebar-list">
${item.data
.map((item, index) => {
return `
<div class="sidebar-item" data-index="${index}">
<a href="${item.url}" class="i18n" name="${item.name}"> </a>
</div>
`;
})
.join("")}
</div>
</div>`;
return `
<div class="sidebar-menu">
<div class="sidebar-title">
<span class="i18n" name="${item.name}"></span>
<span class="triangle"></span>
</div>
<div class="sidebar-list">
${item.data
.map((item, index) => {
return `
<div class="sidebar-item" data-index="${index}">
<a href="${item.url}" class="i18n" name="${item.name}"></a>
</div>
`;
})
.join("")}
</div>
</div>
`;
})
.join("");
}
Expand All @@ -44,21 +45,22 @@ function __initMenu() {
logoImgSrc = `${ORIGIN_URL}/assets/agora-logo-zh.png`;
}
let logoHtml = `<img src=${logoImgSrc} alt="logo" style="width:56px; height: 30px;">`;
let menuHtml = `
<div class="sidebar">
<div class="sidebar-top">
<div class="border-bottom pb-3 mb-3 flex top-wrapper">
<a href=${href} target="_blank" class="link-body-emphasis text-decoration-none">
${logoHtml}
</a>
<span id="language-switch-wrapper">
</span>
</div>
</div>
${__transListToMenuDom(MENU_LIST)}
</div >
`;

let menuHtml = `
<div class="sidebar">
<div class="sidebar-top">
<div class="border-bottom pb-3 mb-3 flex top-wrapper">
<a href=${href} target="_blank" class="link-body-emphasis text-decoration-none">
${logoHtml}
</a>
<span id="language-switch-wrapper">
</span>
</div>
</div>
${__transListToMenuDom(MENU_LIST)}
</div >
`;
menuHtml = `${leftNav()}`;
if (__isSmallScreen()) {
menuHtml = `<nav class="navbar width-100 overflow-hidden">
<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvas-navbar">
Expand Down Expand Up @@ -90,10 +92,9 @@ function __hightlightMenu() {
$(".sidebar-item").removeClass("active").removeClass("hover");
$(".sidebar-title").removeClass("active").removeClass("hover");
$(".triangle").removeClass("open");

let targetNode = $(`.sidebar-item:has(a[href = "${href}"])`);
let targetNode = $(`a[href = "${href}"]`).find('.sidebar-item')
if (!targetNode.length) {
targetNode = $(`.sidebar-item:has(a[href = "${href}index.html"])`);
targetNode = $(`a[href = "${href}index.html"]`).find('.sidebar-item')
}
targetNode.addClass("active");
const sidebarMenu = targetNode.closest(".sidebar-menu");
Expand Down Expand Up @@ -160,3 +161,73 @@ if (__isSmallScreen()) {
__hightlightMenu();
});
}

function leftNav() {
let language = getLanguage();
let href = "";
let logoImgSrc = "";
if (language == "en") {
href = DEFAULT_EN_DOC_URL;
logoImgSrc = `${ORIGIN_URL}/assets/agora-logo-en.png`;
} else {
href = DEFAULT_ZH_DOC_URL;
logoImgSrc = `${ORIGIN_URL}/assets/agora-logo-zh.png`;
}
let logoHtml = `<img src=${logoImgSrc} alt="logo" style="width:56px; height: 30px;">`;
return `
<div class="relative flex w-full max-w-[20rem] flex-col rounded-xl bg-white bg-clip-border text-gray-700 shadow-xl shadow-blue-gray-900/5">
<div class="sidebar-top">
<div class="border-bottom p-3 flex top-wrapper">
<a href=${href} target="_blank" class="link-body-emphasis text-decoration-none">
${logoHtml}
</a>
<span id="language-switch-wrapper"></span>
</div>
</div>
<nav class="min-h-screen flex min-w-[240px] flex-col gap-1 p-2 font-sans text-base font-normal text-blue-gray-700">
${__transListToMenuDomV2(MENU_LIST)}
</nav>
</div>
`;
}


function __transListToMenuDomV2(list) {
return list
.map((item) => {
return `
<div class="sidebar-menu relative block w-full">
<div name="${item.name}" role="button"
class="sidebar-title i18n flex items-center w-full p-0 leading-tight transition-all rounded-lg outline-none bg-blue-gray-50/50 text-start text-blue-gray-700 hover:bg-blue-gray-50 hover:bg-opacity-80 hover:text-blue-gray-900 focus:bg-blue-gray-50 focus:bg-opacity-80 focus:text-blue-gray-900 active:bg-blue-gray-50 active:bg-opacity-80 active:text-blue-gray-900">
<button type="button"
class="finder flex items-center justify-between w-full p-3 font-sans text-xl antialiased font-semibold leading-snug text-left transition-colors border-b-0 select-none border-b-blue-gray-100 text-blue-gray-900 hover:text-blue-gray-900">
<p class="block mr-auto font-sans text-base antialiased font-normal leading-relaxed text-blue-gray-900"></p>
<span class="ml-4"></span>
</button>
</div>
<div class="overflow-hidden">
<div class="block w-full py-1 font-sans text-sm antialiased font-light leading-normal text-gray-700">
<nav class="flex min-w-[240px] flex-col gap-1 p-0 font-sans text-base font-normal text-blue-gray-700">
${item.data
.map((item, index) => {
return `
<a href="${item.url}" class="navitem flex items-center">
<div name="${item.name}" role="button"
class="sidebar-item i18n flex items-center w-full p-3 leading-tight transition-all rounded-lg outline-none text-start hover:bg-blue-gray-50 hover:bg-opacity-80 hover:text-blue-gray-900 focus:bg-blue-gray-50 focus:bg-opacity-80 focus:text-blue-gray-900 active:bg-blue-gray-50 active:bg-opacity-80 active:text-blue-gray-900">
</div>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="3"
stroke="currentColor" aria-hidden="true" class="w-5 h-3">
<path stroke-linecap="round" stroke-linejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5"></path>
</svg>
</a>
`;
})
.join("")}
</nav>
</div>
</div>
</div>
`;
})
.join("");
}
2 changes: 2 additions & 0 deletions src/example/advanced/adjustVideoProfile/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<title>Adjust Video Profile -- Agora</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css">
<link rel="stylesheet" href="../../../common/common.css">
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions src/example/advanced/audioEffects/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<title>Audio Mixing & Audio Effect -- Agora</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions src/example/advanced/customVideoSource/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<title>Custom Video Source -- Agora</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions src/example/advanced/displayCallStats/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<title>Display Call Stats -- Agora</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions src/example/advanced/geoFencing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<title>Geo Fencing -- Agora</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions src/example/advanced/joinMultipleChannel/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<title>Join Multiple Channel -- Agora</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions src/example/advanced/screenshot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<title>Video Screenshot -- Agora</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions src/example/advanced/selfCapturing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<title>Video Self-Capturing -- Agora</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion src/example/advanced/selfRendering/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<title>Video Self-Rendering -- Agora</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
<script src="https://cdn.tailwindcss.com"></script>
</head>

<body>
Expand Down Expand Up @@ -52,7 +53,6 @@
position: absolute;
left: 0px;
top: 0px;
object-fit: cover;
"
></video>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/example/advanced/selfRendering/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ async function subscribe(user, mediaType) {
<div style="width: 100%; height: 100%; position: relative; overflow: hidden; background-color: black;">
<video id="video_track-video-${uid}-mirror"
class="agora_video_player" playsinline="" muted=""
style="width: 100%; height: 100%; position: absolute; left: 0px; top: 0px; object-fit: cover; transform: rotateY(180deg);">
style="width: 100%; height: 100%; position: absolute; left: 0px; top: 0px; transform: rotateY(180deg);">
</video>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/example/advanced/shareTheScreen/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<title>Agora WebSDK Demos</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions src/example/advanced/testMediaDevices/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<link rel="stylesheet" href="./jquery.jsonview.min.css" />
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions src/example/advanced/vadExtention/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<title>VAD -- Agora</title>
<link rel="stylesheet" href="../assets/bootstrap.min.css" />
<link rel="stylesheet" href="./index.css" />
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions src/example/basic/basicLive/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<title>Basic Live -- Agora</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions src/example/basic/basicVideoCall/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<title>Basic Video Call -- Agora</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions src/example/basic/basicVoiceCall/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<title>Basic Voice Call -- Agora</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions src/example/extension/aiDenoiser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<title>Ai Denoiser -- Agora</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions src/example/extension/beauty/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<title>Beauty -- Agora</title>
<link rel="stylesheet" href="../../../assets/bootstrap.min.css" />
<link rel="stylesheet" href="../../../common/common.css" />
<script src="https://cdn.tailwindcss.com"></script>

</head>

<body>
Expand Down
Loading