Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Implementation of Collapsible Sidebar Menu #30 #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
84 changes: 83 additions & 1 deletion src/app/app.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,86 @@ h5, .h5 {
margin: 2%;
bottom: 2%;
color: #fff;
} */
} */

/* Toggle sidebar */

.ham {
position: absolute;
width: 30px;
height: 30px;
right: 5%;
top: calc(50% - 15px);
}

.ham::before,
.ham::after,
.ham .dash {
content: "";
position: absolute;
top: 30%;
height: 2px;
background-color: white;
width: 100%;
transform-origin: center;
transition: all 0.5s ease-in-out;
}

.ham::after {
top: 70%;
}

.ham .dash {
top: 50%;
}

.ham.open::before {
top: 50%;
transform: rotate(45deg);
}

.ham.open::after {
top: 50%;
transform: rotate(-45deg);
}

.ham.open .dash {
opacity: 0;
}

.row {
flex-wrap: nowrap;
max-width: 100%;
overflow-x: hidden;
}

nav {
position: relative;
}

.sidebar {
text-align: center;
}

.row div:nth-child(1) {
flex-grow: 3;
flex-shrink: 1;
}
.row div:nth-child(2) {
flex-grow: 1;
min-width: 200px;
flex-shrink: 3;
transition: all 0.5s linear;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
/* transition-delay: 0ms; */
width: max-content;
}

.hide {
max-width: 0 !important;
min-width: 0 !important;
flex-grow: 0 !important;
padding: 0;
}
1 change: 1 addition & 0 deletions src/app/hindi-version/hindi-version.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<header>
<nav class="level-nav">
<div class="ham"><div class="dash"></div></div>
</nav>
</header>
<section class="mt-3">
Expand Down
25 changes: 15 additions & 10 deletions src/app/hindi-version/hindi-version.component.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { Component, OnInit } from '@angular/core';
import $ from 'jquery'
import { Component, OnInit } from "@angular/core";
import $ from "jquery";

@Component({
selector: 'app-hindi-version',
templateUrl: './hindi-version.component.html',
selector: "app-hindi-version",
templateUrl: "./hindi-version.component.html",
// styleUrls: ['./hindi-version.component.css']
styleUrls: ['../app.component.css']
styleUrls: ["../app.component.css"],
})
export class HindiVersionComponent implements OnInit {
constructor() {}

constructor() { }

title = 'speak-with-me';
title = "speak-with-me";
exploreandlearn = true;
learnandplay = false;
playgame = false;
Expand All @@ -23,11 +22,18 @@ export class HindiVersionComponent implements OnInit {
// $('.active').next('.nav-link').trigger('click');
// });
// });

$(document).ready(function () {
$(".ham").click(function () {
$(".ham").toggleClass("open");
$(".sidebar").toggleClass("hide");
});
});
}
public getFingerPrintJsId = () => {
const fpDetails_v2 = localStorage.getItem("did");
return fpDetails_v2;
}
};

showExploreandLearn() {
this.exploreandlearn = true;
Expand Down Expand Up @@ -56,5 +62,4 @@ export class HindiVersionComponent implements OnInit {
this.playgame = false;
this.videohelp = true;
}

}
1 change: 1 addition & 0 deletions src/app/kannada-version/kannada-version.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<header>
<nav class="level-nav">
<div class="ham"><div class="dash"></div></div>
</nav>
</header>
<section class="mt-3">
Expand Down
7 changes: 7 additions & 0 deletions src/app/kannada-version/kannada-version.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ export class KannadaVersionComponent implements OnInit {
// $('.active').next('.nav-link').trigger('click');
// });
// });

$(document).ready(function() {
$('.ham').click(function(){
$('.ham').toggleClass('open');
$('.sidebar').toggleClass('hide')
});
});
}
public getFingerPrintJsId = () => {
const fpDetails_v2 = localStorage.getItem("did");
Expand Down
3 changes: 2 additions & 1 deletion src/app/tamil-version/tamil-version.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<header>
<nav class="level-nav">
<div class="ham"><div class="dash"></div></div>
</nav>
</header>
<section class="mt-3">
Expand Down Expand Up @@ -36,7 +37,7 @@
</div>
</div>
</div>
<div class="col-md-3">
<div class="col-md-3 sidebar hide">
<h2 class="accordion-header">
<button class="accordion-button cl fw-700 ml-2" type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapseOne" aria-expanded="true"
Expand Down
8 changes: 8 additions & 0 deletions src/app/tamil-version/tamil-version.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ export class TamilVersionComponent implements OnInit {
// $('.active').next('.nav-link').trigger('click');
// });
// });

$(document).ready(function() {
$('.ham').click(function(){
$('.ham').toggleClass('open');
$('.sidebar').toggleClass('hide')
});
});

}
public getFingerPrintJsId = () => {
const fpDetails_v2 = localStorage.getItem("did");
Expand Down