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

Lcds scheme #313

Merged
merged 3 commits into from
Jan 20, 2025
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
5 changes: 3 additions & 2 deletions assets/js/invenio_app_rdm/overridableRegistry/mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import { CDSAffiliationsSuggestions } from "../../components/deposit/overrides/C
export const overriddenComponents = {
"InvenioAppRdm.RecordsList.layout": CDSRecordsList,
"InvenioAppRdm.RecordsResultsListItem.layout": CDSRecordsResultsListItem,
"InvenioCommunities.CommunitiesCarousel.layout": CDSCommunitiesCarousel,
"InvenioCommunities.CommunitiesCarousel.layout": null,
"InvenioCommunities.CarouselItem.layout": CDSCarouselItem,
"InvenioAppRdm.Deposit.AccordionFieldBasicInformation.extra":
BasicCERNInformation,
"InvenioAppRdm.Deposit.CustomFields.container": () => null,
"ReactInvenioForms.AffiliationsSuggestions.content": CDSAffiliationsSuggestions,
"ReactInvenioForms.AffiliationsSuggestions.content":
CDSAffiliationsSuggestions,
};
14 changes: 9 additions & 5 deletions assets/less/cds-rdm/elements/container.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
}

.frontpage-header {
height: calc((@homePageHeroHeight / 2));
height: calc((@homePageHeroHeight));
align-items: center;
align-content: center;
@media all and (max-width: @computerBreakpoint) {
position: relative;
top: 5em;
align-content: space-evenly;
position: relative;

@media all and (max-width: @largestMobileScreen){
align-content: start !important;
}
}

Expand All @@ -34,6 +35,7 @@
}

.theme.header.frontpage{
overflow-x: clip;
.invenio-header-container {
height: calc(@homePageHeroHeight - 3px);
}
Expand All @@ -49,6 +51,8 @@
padding-top: 2em;
padding-bottom: 2em;
background-color: @lighterGray;
border: 1px solid white;
margin-bottom: -2em;
.background-layer{
position: absolute;
width:100%;
Expand Down
40 changes: 40 additions & 0 deletions assets/less/cds-rdm/globals/carousel.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

@keyframes carousel {
0% {
transform: translateX(0px);
opacity: 1;
}
16% {
transform: translateX(-200px);
opacity: 1;
}
32% {
transform: translateX(-400px);
opacity: 0;
}
48% {
transform: translateX(-600px);
opacity: 0;
}
64% {
transform: translateX(-800px);
opacity: 0;
}
80% {
transform: translateX(-1000px);
opacity: 0;
}
100% {
transform: translateX(-1200px);
opacity: 0;
}
}


.generate-carousel-delay(@max, @i:0) when (@i =< @max) {
&:nth-child(@{i}) {
animation-delay: unit(3*@i, s);
}

.generate-carousel-delay(@max, (@i+1));
}
92 changes: 76 additions & 16 deletions assets/less/cds-rdm/globals/hero.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@media all and (max-width: @largestTabletScreen) {
html,body {
html,
body {
width: 100vw;
overflow-x: clip;
}
Expand All @@ -13,7 +14,11 @@
&:after {
content: " ";
background: white;
background: linear-gradient(90deg, transparent 70%, rgba(28, 68, 107, 1) 75%);
background: linear-gradient(
90deg,
transparent 65%,
rgba(28, 68, 107, 1) 70%
);
position: absolute;
height: @homePageHeroHexHeight !important;
width: 100%;
Expand All @@ -39,9 +44,10 @@
}
}


.clip-path.shadow {
filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
.clip-path {
&.shadow {
filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}
height: fit-content;
width: fit-content;
position: absolute;
Expand Down Expand Up @@ -72,30 +78,56 @@
z-index: 1;
left: 45%;
position: relative;
top: calc(@homePageHeroHeight - (1 / 3 * @homePageHeroHexHeight)) !important;
top: calc(
@homePageHeroHeight - (1 / 3 * @homePageHeroHexHeight)
) !important;
}

.hex {
position: absolute;

&.blue {
z-index: 3;
background-image: radial-gradient(circle at left, @quaternaryColor 5%, @quinaryColor 90%);
background-image: radial-gradient(
circle at left,
@quaternaryColor 5%,
@quinaryColor 90%
);
.hexagon(@homePageHeroHexHeight);
// special shape due to being on the side
-webkit-clip-path: polygon(25% 0, 100% 0, 100% 50%, 100% 100%, 25% 100%, 0% 50%);
-webkit-clip-path: polygon(
25% 0,
100% 0,
100% 50%,
100% 100%,
25% 100%,
0% 50%
);
clip-path: polygon(25% 0, 100% 0, 100% 50%, 100% 100%, 25% 100%, 0% 50%);


@media all and (max-width: @largestMobileScreen) {
width: 100vw !important;
-webkit-clip-path: polygon(30% 0, 100% 0, 100% 100%, 25% 100%, 0% 80%, 0% 25%);
-webkit-clip-path: polygon(
30% 0,
100% 0,
100% 100%,
25% 100%,
0% 80%,
0% 25%
);
clip-path: polygon(30% 0, 100% 0, 100% 100%, 25% 100%, 0% 80%, 0% 25%);
height: calc(@homePageHeroHeight - 3px) !important;
}
@media all and (min-width: @tabletBreakpoint) and (max-width: @largestTabletScreen) {
width: 100vw !important;
-webkit-clip-path: polygon(15% 0, 100% 0, 100% 100%, 10% 100%, 0% 85%, 0% 25%);
-webkit-clip-path: polygon(
15% 0,
100% 0,
100% 100%,
10% 100%,
0% 85%,
0% 25%
);
clip-path: polygon(15% 0, 100% 0, 100% 100%, 10% 100%, 0% 85%, 0% 25%);
height: calc(@homePageHeroHeight - 3px) !important;
}
Expand All @@ -118,7 +150,6 @@
top: 20%;
transform: unset;
}

}
}

Expand Down Expand Up @@ -181,14 +212,43 @@

&.code {
background-color: @CERNlightgray;
top: 60%;
left: 15%;
top: 80%;
left: 25%;
.flat-text-shadow-mixin(@CERNlightgray);
@media all and (max-width: @computerBreakpoint) {
top: 70%;
top: 90%;
left: 70%;
}

}
}

&.background {

//opacity: 0.388;
background-color: white;
filter: unset !important;
z-index: -2 !important;
.hexagon(5/4 * @homePageHeroHexHeight);
&.communities {
position:relative !important;
left: -65%;
top: -26rem;
}
&:after{
content: '';
background-color: white;
display: inline-block;
z-index: -3;
.linear-gradient(270deg, rgba(255,255,255,0) 30%, rgba(243,243,242,1) 80%);
.hexagon(calc( 5/4* @homePageHeroHexHeight - 1px));
}
}
}
}
}

.frontpage-main.communities {
.clip-path {
z-index: -1;
}
}
10 changes: 4 additions & 6 deletions assets/less/cds-rdm/globals/site.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
width: 100px;
}


.outer-navbar {
z-index: 1;
background-color: transparent !important;
Expand Down Expand Up @@ -71,15 +70,14 @@
box-shadow: @boxShadow !important;
}


#focus-on {
margin-bottom: (@homePageHeroHexHeight - @homePageHeroHeight);
}

#communities-frontpage {
height: 55em;
}

#frontpage-searchbar{
margin-top: -5em;
}

.inline-flex {
display: inline-flex !important;
}
Expand Down
4 changes: 2 additions & 2 deletions assets/less/cds-rdm/globals/site.variables
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
@linkHoverColor: darken(saturate(@linkColor, 20), 15, relative);
@linkHoverUnderline: underline;

@homePageHeroHeight: 55em;
@homePageHeroHexHeight: 60em;
@homePageHeroHeight: 45em;
@homePageHeroHexHeight: 50em;
@hexHeightToWidthRatio: sqrt(3)/2;
@hexVerticesMap: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);

Expand Down
27 changes: 24 additions & 3 deletions assets/less/cds-rdm/views/card.overrides
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
#communities-carousel {
@import "../globals/carousel.less";

.frontpage-main.communities{
.card {
box-shadow: 0px 1px 14px -10px rgba(0,0,0,1) !important;
padding: 1em;
&:hover{
box-shadow: 0px 1px 14px -7px rgba(0,0,0,1) !important;
}
.content {
border: none;
}
.image {
height: 250px;
background-color: white;
display: flex;
padding: 1em;
padding: 1.5em;
img {
object-fit: contain;
margin: auto;
Expand All @@ -15,4 +25,15 @@
}
}
}
}
}


.ui.cards.carousel .carousel-page {
//position: absolute;
//top: 0;
//left: calc(50% - 100px);
opacity: 1;
animation: carousel 30s infinite;

.generate-carousel-delay(10);
}
2 changes: 1 addition & 1 deletion invenio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ RDM_RECORDS_IDENTIFIERS_SCHEMES = {**RDM_RECORDS_IDENTIFIERS_SCHEMES,
"datacite": "INSPIRE"}}}

RDM_RECORDS_PERSONORG_SCHEMES = {**RDM_RECORDS_PERSONORG_SCHEMES,
**{"inspire": {"label": _("Inspire"),
**{"inspire_author": {"label": _("Inspire"),
"validator": schemes.is_inspire_author,
"datacite": "INSPIRE"},
"lcds": {"label": _("CDS"),
Expand Down
21 changes: 13 additions & 8 deletions site/cds_rdm/schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def cds_reference_number():
return {
"validator": lambda value: True,
"normalizer": lambda value: value,
"filter": ["cds_ref"],
"url_generator": None,
}

Expand All @@ -41,13 +40,12 @@ def aleph():
return {
"validator": is_aleph,
"normalizer": lambda value: value,
"filter": ["aleph"],
"url_generator": None,
}


def is_inspire(val):
"""Test if argument is an inspire ID.
"""Test if argument is an Inspire ID.

Warning: INSPIRE IDs are just integers, with no structure, so this function will
say any integer is an INSPIRE id
Expand All @@ -61,26 +59,33 @@ def is_inspire_author(val):


def inspire():
"""Define validator for inspire."""
"""Define validator for Inspire."""
return {
"validator": is_inspire,
"normalizer": lambda value: value,
"filter": ["inspire"],
"url_generator": None,
}


def inspire_author():
"""Define validator for inspire author."""
"""Define validator for Inspire author."""
return {
"validator": is_inspire_author,
"normalizer": lambda value: value,
"filter": ["inspire"],
"url_generator": None,
}


def is_legacy_cds(val):
"""Test if argument is a valid CERN person ID."""
"""Test if argument is a valid legacy id."""
pattern = r"^\d+$"
return bool(re.match(pattern, val))


def legacy_cds():
"""Define scheme for CDS."""
return {
"validator": is_legacy_cds,
"normalizer": lambda value: value,
"url_generator": None,
}
Loading
Loading