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

CLDR-17803 site: improved popup #4029

Merged
merged 1 commit into from
Sep 9, 2024
Merged
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
35 changes: 23 additions & 12 deletions docs/site/assets/css/page.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,31 @@ header .nav > div {
display: inline;
}

header .nav a {
header .nav a.uplink {
color: white;
}

header .nav ul b {
color: gray;
header .nav div.subpages {
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
background-color: white;
position: absolute;
color: black;
padding: 0.5em;
}

.title ul.subpages {
display: none;
div.subpages .hamburger {
left: 1em;
top: 1em;
color: darkslateblue;
}

.title:hover ul.subpages {
display: block;
.subpages .hamburger:hover {
color: gray;
}

header .nav ul b {
color: gray;
}

header .nav .crumb {
Expand All @@ -59,19 +70,19 @@ header .nav .crumb {

header .nav ul {
display: inline;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
background-color: navy;
padding: 0.5em;
}

header .nav ul li {
display: block;
padding: 0.5em;
padding: 0.25em;
font-size: medium;
margin: 0;
}

.subpages .li a {
color: black !important;
}

header .message {
color: lightblue;
display: list-item;
Expand Down
33 changes: 22 additions & 11 deletions docs/site/assets/js/cldrsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,17 @@ async function siteData() {
const app = Vue.createApp(
{
setup(props) {
// the tree.json data
const tree = ref({});
// loading status for tree.json
const status = ref(null);
// is the popup menu shown?
const popup = ref(false);

return {
tree,
status,
popup,
};
},
mounted() {
Expand Down Expand Up @@ -211,18 +216,24 @@ const app = Vue.createApp(
<a class="uplink" v-bind:href="ancestor.href">{{ ancestor.title }}</a><span class="crumb">❱</span>
</span>
<div v-if="!siblingPages || !siblingPages.length" class="title"> {{ ourTitle }} </div>
<div v-else class="title"><span class="hamburger">≡</span>
<div v-else class="title" @mouseover="popup = true"><span class="hamburger" @click="popup = !popup">≡</span>
{{ ourTitle }}
<ul class="subpages">
<li v-for="subpage of siblingPages" :key="subpage.path">
<span v-if="path == subpage.html">
<b>{{ subpage.title }}</b>
</span>
<a v-else v-bind:href="'/'+subpage.html">
{{ subpage.title }}
</a>
</li>
</ul>

<div class="subpages" v-if="popup">
<span class="hamburger" @click="popup=false">✕</span>
<ul class="subpages" >
<li v-for="subpage of siblingPages" :key="subpage.path">
<span v-if="path == subpage.html">
<b>{{ subpage.title }}</b>
</span>
<a v-else v-bind:href="'/'+subpage.html">
{{ subpage.title }}
</a>
</li>
</ul>
</div>


</div>

</div>`,
Expand Down
Loading