-
Notifications
You must be signed in to change notification settings - Fork 595
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
implemented two column layout for footer in mobile view #1946
Open
snehaio
wants to merge
5
commits into
meshery:master
Choose a base branch
from
snehaio:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a830908
implemented two column layout for footer in mobile view
snehaio 0bb6e24
changed the order of footer columns
snehaio dd9cbda
Aligned the columns using grid layout
snehaio 9ccf3be
Merge branch 'master' into master
vishalvivekm a8f47cf
readded the function logic
snehaio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,21 +107,102 @@ <h2><a {% if column.new_window %}target="_blank" {% endif %} | |
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script> | ||
<script src="{{ site.baseurl }}/js/vanilla-tilt.min.js"></script> | ||
<script> | ||
function resetCopyText(element) { /* function logic */ } | ||
|
||
function resetCopyText(element) { | ||
let childElements = element.childNodes | ||
if (childElements.length > 3) { | ||
childElements[3].innerHTML = "Copy to clipboard"; | ||
} else { | ||
childElements[1].innerHTML = "Copy URL"; | ||
childElements[1].style.color = 'white'; | ||
childElements[1].style.background = "#00b39fff"; | ||
} | ||
} | ||
|
||
|
||
var clipboard = new ClipboardJS('.btn'); | ||
clipboard.on('success', function (e) { /* clipboard success logic */ }); | ||
clipboard.on('error', function (e) { /* clipboard error logic */ }); | ||
</script> | ||
<script> | ||
function displayCode(id) { /* function logic */ } | ||
</script> | ||
<script type="text/javascript"> | ||
let toggleBtn = document.getElementById("mode-toggle-btn"); | ||
clipboard.on('success', function (e) { | ||
console.info('Action:', e.action); | ||
console.info('Text:', e.text); | ||
console.info('Trigger:', e.trigger); | ||
let childElements = e.trigger.childNodes; | ||
if (childElements.length > 3) { | ||
childElements[3].innerHTML = "Copied!"; | ||
} else { | ||
childElements[1].innerHTML = "Copied"; | ||
childElements[1].style.color = 'white'; | ||
childElements[1].style.background = "#1a2421"; | ||
} | ||
e.clearSelection(); | ||
}); | ||
clipboard.on('error', function (e) { | ||
console.error('Action:', e.action); | ||
console.error('Trigger:', e.trigger); | ||
}); | ||
</script> | ||
|
||
<script> | ||
function displayCode(id) { | ||
var divId = id + "_code"; | ||
var element = document.getElementById(divId); | ||
element.classList.toggle("showDiv"); | ||
var toggleDivs = document.getElementsByClassName("toggle"); | ||
if (element.style.maxHeight) { | ||
element.style.maxHeight = null; | ||
} else { | ||
element.style.maxHeight = element.scrollHeight + "px"; | ||
console.log(element.style.maxHeight); | ||
} | ||
for (let i = 0; i < toggleDivs.length; i++) { | ||
if (toggleDivs[i] != element) { | ||
toggleDivs[i].classList.remove("showDiv"); | ||
if (toggleDivs[i].style.maxHeight) { | ||
toggleDivs[i].style.maxHeight = null; | ||
} | ||
} | ||
} | ||
} | ||
</script> | ||
<script type="text/javascript"> | ||
let toggleBtn = document.getElementById("mode-toggle-btn") | ||
// console.log(document.body.classList); | ||
// console.log(localStorage.getItem("mode")); | ||
toggleBtn.onclick = setMode; | ||
|
||
if (localStorage.getItem("mode") === null) { | ||
localStorage.setItem("mode", "dark-mode"); | ||
} | ||
|
||
const isDark = document.body.classList.contains("dark-mode"); | ||
const currentMode = localStorage.getItem("mode"); | ||
if (document.body.classList.contains("dark-mode") ^ (currentMode === "dark-mode")) { setMode(); } | ||
function setMode() { /* function logic */ } | ||
</script> | ||
if (isDark ^ (currentMode === "dark-mode")) { | ||
setMode(); | ||
} | ||
|
||
function setMode() { | ||
document.body.classList.toggle("dark-mode") | ||
|
||
let layer5Logos = document.querySelectorAll("#layer5-logo"); | ||
let allLogos = document.querySelectorAll("#logo-dark-light"); | ||
if (document.body.classList.contains("dark-mode")) { | ||
layer5Logos.forEach(e => e.src = '../assets/images/company-logo/layer5-dark-mode-logo.svg') | ||
allLogos.forEach(e => e.src = e.dataset.logoForDark) | ||
} else { | ||
layer5Logos.forEach(e => e.src = '../assets/images/company-logo/layer5-no-trim.svg') | ||
allLogos.forEach(e => e.src = e.dataset.logoForLight) | ||
} | ||
if (document.body.classList.contains("dark-mode")) { | ||
localStorage.setItem("mode", "dark-mode") | ||
} else { | ||
localStorage.setItem("mode", "light-mode") | ||
} | ||
document.dispatchEvent(new CustomEvent("themeChange",{ | ||
detail : {value : localStorage.getItem("mode")}, | ||
bubbles: true , | ||
})) | ||
} | ||
|
||
</script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/slick/slick.min.js"></script> | ||
<script> | ||
$(document).ready(function () { | ||
|
@@ -134,7 +215,72 @@ <h2><a {% if column.new_window %}target="_blank" {% endif %} | |
slidesToScroll: 1, | ||
autoplay: true, | ||
autoplaySpeed: 1500, | ||
responsive: [{ breakpoint: 1300, settings: { slidesToShow: 2.5 } }, /* other breakpoints */] | ||
responsive: [ | ||
{ | ||
breakpoint: 1300, | ||
settings: { | ||
slidesToShow: 2.5, | ||
} | ||
}, | ||
{ | ||
breakpoint: 1200, | ||
settings: { | ||
slidesToShow: 2, | ||
} | ||
}, | ||
{ | ||
breakpoint: 1024, | ||
settings: { | ||
slidesToShow: 2, | ||
} | ||
}, | ||
{ | ||
breakpoint: 800, | ||
settings: { | ||
slidesToShow: 1.5, | ||
slidesToScroll: 1, | ||
} | ||
}, | ||
{ | ||
breakpoint: 600, | ||
settings: { | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
autoplaySpeed: 2000, | ||
} | ||
}, | ||
{ | ||
breakpoint: 480, | ||
settings: { | ||
slidesToShow: 1, | ||
slidesToScroll: 1 | ||
} | ||
}, | ||
{ | ||
breakpoint: 400, | ||
settings: { | ||
slidesToShow: 1, | ||
adaptiveWidth: true, | ||
slidesToScroll: 1 | ||
} | ||
}, | ||
{ | ||
breakpoint: 380, | ||
settings: { | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
adaptiveWidth: true, | ||
} | ||
}, | ||
{ | ||
breakpoint: 360, | ||
settings: { | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
adaptiveWidth: true, | ||
} | ||
} | ||
] | ||
}); | ||
}); | ||
</script> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any reasons to remove other breakpoints ? @snehaio |
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please correct the formatting and confirm if the added logic is same as previous. Thanks!