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

New nav, 2025 #234

Merged
merged 6 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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
9 changes: 9 additions & 0 deletions app/assets/javascripts/reimagine2/mobile_global_nav.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,12 @@

if !$mobileSearchContainer.hasClass("hide")
$mobileSearchContainer.find("#search").focus()

$("[data-accordion-tab]").on "click", (e) =>
e.preventDefault()

targetId = $(e.currentTarget).attr('href').substring(1)
$targetSection = $("[data-accordion-section='#{targetId}']")

$targetSection.slideToggle()
$('[data-accordion-section').not($targetSection).slideUp();
161 changes: 125 additions & 36 deletions app/assets/stylesheets/reimagine2/devpost/_global_nav_bar.sass
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
@import "./global_nav_active_states"

$dropdown-links-line-height: 28px

#global-nav
background: white
box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 3px 0px
box-shadow: 0px 1px 3px rgba(0,0,0,0.3)
position: relative

.top-bar-section
.dropdown.main-menu-dropdown
li a
padding: 0
line-height: $dropdown-links-line-height

&:hover
background: none

.has-dropdown > a:after
border-top-color: transparent
border-left-color: $grey-3
Expand Down Expand Up @@ -102,13 +112,18 @@
display: flex
flex-direction: column
padding-top: 3px
padding-left: 53px

&.with-icon-offset
padding-left: 50px

a
padding: 6px 6px
line-height: 16px
color: $primary-1

.resource-title
font-weight: bold

.name
float: left

Expand Down Expand Up @@ -157,8 +172,13 @@
strong
display: inline

@media only screen and (max-width: 1076px)
padding: 0 1.18em
&:after
border: 0 !important

i
margin-left: 4px
position: relative
top: 1px

.alpha
display: none
Expand Down Expand Up @@ -345,13 +365,32 @@
color: $grey-3
font-size: 1.1rem

.accordion-tab
color: $dark
font-weight: 500
display: block
padding: 24px 16px !important
max-height: none
line-height: $dropdown-links-line-height !important
border-bottom: 1px solid $grey-2
font-size: 16px !important
display: flex
align-items: center
justify-content: space-between

.accordion-section
display: none
background: $grey-1

.panel-section
border-bottom: 1px solid #DDE3E6

.ui-autocomplete
max-width: 300px

.dropdown
&.float-left
position: absolute
left: -12.125em
z-index: 1001

.panel-product-content
Expand All @@ -362,42 +401,92 @@
margin-bottom: 0
line-height: 16px

#floating-menu-wrapper
.floating-menu
.floating-menu-wrapper
padding: 32px

.mobile &
padding: 0

.panel-container
flex: 1
margin-right: 32px
font-size: 14px

&:last-child, &.mr-0
margin-right: 0

&.mb-4
margin-bottom: 16px

&.bordered
border: 1px solid #DDE3E6
border-radius: 8px

&.bordered-hover:hover
border-color: $anchor-font-color-hover

.panel-product
display: flex
height: 226px
width: 768px

.panel-container
flex: 1
padding: 20px 30px 40px
font-size: 14px

.panel-product
display: flex
grid-column-gap: 12px
align-items: flex-start
padding: 10px
border-radius: 3px
font-size: 14px
grid-column-gap: 12px
align-items: flex-start
border-radius: 3px
font-size: 14px
white-space: normal
max-height: initial !important
padding: 0 !important

> *
white-space: normal
max-height: initial

.title
padding-top: 4px
padding-bottom: 4px
.title
margin: 4px 0 6px

.subtitle
color: $blue-grey-4
.subtitle
color: $blue-grey-6

.panel-content
display: flex
flex-direction: column
.panel-content
display: flex
flex-direction: column

&.with-icon-offset
padding-top: 10px
padding-left: 53px
padding-left: 50px

a
padding: 6px 6px
border-radius: 3px
line-height: 16px
color: $primary-1
a
line-height: $dropdown-links-line-height !important
padding: 0 !important
border-radius: 3px
color: $primary-1

.panel-section
padding: 16px

&.pt-0
padding-top: 0

.fa-arrow-right
float: right
line-height: $dropdown-links-line-height
color: $blue-grey-4

a:hover
.fa-arrow-right
color: $anchor-font-color-hover

p:not(.title)
margin-bottom: 0

#join-a-hackathon-dropdown
left: -194px
width: 820px

#host-a-hackathon-dropdown
min-width: 1000px

@media #{$large}
min-width: 1100px

left: -402px

#resources-dropdown
left: -100px
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
@media #{$small}
+align-stretch

.align-start
align-items: flex-start

.flex-column
-ms-flex-direction: column
-webkit-flex-direction: column
Expand Down Expand Up @@ -67,3 +70,6 @@

.flex-columns
+flex(1)

.is-flex-grow-1
flex-grow: 1
4 changes: 0 additions & 4 deletions app/views/reimagine2/devpost/_global_nav_desktop.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@

<div class="right">
<ul>
<li>
<%= link_to 'Host a hackathon', 'https://info.devpost.com', class: 'main-link', data: { role: 'for-orgs' } %>
</li>

<li class="search-expand-container desktop main-link">
<a data-toggle-desktop-search><i class="fas fa-search"></i></a>
</li>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<% arrow_icon = '<i class="fa-arrow-right fas" aria-hidden="true" aria-label="Arrow icon"></i>'.html_safe %>

<%= content_tag :div, class: ["panel-section", local_assigns[:panel_classes]] do %>
<div class="panel-content">
<p class="title bold">By use case</p>

<%
entries = [
['AI hackathons', 'https://info.devpost.com/product/ai-hackathons'],
['Customer hackathons', 'https://info.devpost.com/product/customer-hackathons'],
['Employee hackathons', 'https://info.devpost.com/product/devpost-for-teams'],
['Public hackathons', 'https://info.devpost.com/product/public-hackathons'],
]
%>

<% entries.each do |entry| %>
<% link_copy, link_url = entry %>
<%= link_to link_url do %>
<%= link_copy %> <%= arrow_icon %>
<% end %>
<% end %>
</div>
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<% arrow_icon = '<i class="fa-arrow-right fas" aria-hidden="true" aria-label="Arrow icon"></i>'.html_safe %>

<div class="panel-section">
<a class="panel-product panel-product-content" href="https://info.devpost.com/product/public-hackathons">
<%= image_tag 'reimagine2/devpost-logo-mobile.svg', alt: 'Devpost' %>
<div>
<p class="title bold">Devpost</p>
<p class="subtitle">Grow your developer ecosystem and promote your platform</p>
</div>
</a>

<div class="panel-content with-icon-offset">
<%= link_to "https://info.devpost.com/product/public-hackathons" do %>
Host a public hackathon <%= arrow_icon %>
<% end %>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<% arrow_icon = '<i class="fa-arrow-right fas" aria-hidden="true" aria-label="Arrow icon"></i>'.html_safe %>

<div class="panel-section">
<a class="panel-product panel-product-content" href="https://info.devpost.com/product/devpost-for-teams">
<%= image_tag 'reimagine2/dft-logo-mobile.svg', alt: 'Devpost for Teams logo' %>
<div>
<p class="title bold">Devpost for Teams</p>
<p class="subtitle">Drive innovation, collaboration, and retention within your organization</p>
</div>
</a>

<div class="panel-content with-icon-offset">
<%= link_to "https://info.devpost.com/product/devpost-for-teams" do %>
Host an internal hackathon <%= arrow_icon %>
<% end %>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<% arrow_icon = '<i class="fa-arrow-right fas" aria-hidden="true" aria-label="Arrow icon"></i>'.html_safe %>

<li class="has-dropdown">
<%= link_to '#', class: 'main-link' do %>
Host a hackathon <i class="fa-angle-down fas" aria-hidden="true"></i>
<% end %>

<ul class="dropdown float-left main-menu-dropdown" id="host-a-hackathon-dropdown">
<li class="floating-menu-wrapper">
<div class="floating-menu flex-row align-start">
<div class="panel-container bordered">
<%= render "reimagine2/devpost/global_nav/host_a_hackathon_devpost_section" %>
</div>

<div class="panel-container bordered">
<%= render "reimagine2/devpost/global_nav/host_a_hackathon_dft_section" %>
</div>

<div class="panel-container">
<%= render "reimagine2/devpost/global_nav/host_a_hackathon_by_use_case_section", panel_classes: "pt-0" %>
</div>
</div>
</li>
</ul>
</li>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<% arrow_icon = '<i class="fa-arrow-right fas" aria-hidden="true" aria-label="Arrow icon"></i>'.html_safe %>

<div class="panel-section">
<%= link_to reimagine_root_url(path: '/hackathons'), class: "panel-product panel-product-content" do %>
<%= image_tag 'reimagine2/devpost-logo-mobile.svg', alt: 'Devpost logo' %>
<div>
<p class="title bold">Devpost</p>
<p class="subtitle">Participate in our public hackathons</p>
</div>
<% end %>
<div class="panel-content with-icon-offset">
<%= link_to reimagine_root_url(path: '/hackathons') do %>
Hackathons <%= arrow_icon %>
<% end %>
<%= link_to reimagine_root_url(path: '/software') do %>
Projects <%= arrow_icon %>
<% end %>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<% arrow_icon = '<i class="fa-arrow-right fas" aria-hidden="true" aria-label="Arrow icon"></i>'.html_safe %>

<div class="panel-section">
<a class="panel-product panel-product-content" href="https://info.devpost.com/product/devpost-for-teams">
<%= image_tag 'reimagine2/dft-logo-mobile.svg', alt: 'Devpost for Teams' %>
<div>
<p class="title bold">Devpost for Teams</p>
<p class="subtitle">Access your company's private hackathons</p>
</div>
</a>
<div class="panel-content with-icon-offset">
<a href="https://devpost.team">
Login <%= arrow_icon %>
</a>
</div>
</div>
Loading