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

feat: landing #406

Merged
merged 28 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e576b0c
feat: navbar & hero
joaodiaslobo Oct 14, 2024
0b6b80b
feat: sponsors
joaodiaslobo Oct 14, 2024
30adc37
feat: footer
joaodiaslobo Oct 17, 2024
3b0a64b
feat: add pitch
joaodiaslobo Oct 26, 2024
fcf7879
fix: rm button param
joaodiaslobo Oct 26, 2024
59efe58
feat: add partners
joaodiaslobo Oct 28, 2024
80090d4
Merge branch 'main' into jl/landing
joaodiaslobo Nov 6, 2024
710b161
feat: dynamic event dates
joaodiaslobo Nov 6, 2024
b923ac7
feat: highlighted speakers section
joaodiaslobo Nov 6, 2024
ae6c206
feat: schedule component
joaodiaslobo Nov 11, 2024
a2f2751
feat: improve schedule activities
joaodiaslobo Nov 15, 2024
b55aefa
feat: touches
joaodiaslobo Dec 22, 2024
6f1a345
Merge branch 'main' into jl/landing
joaodiaslobo Dec 23, 2024
5037fc3
fix: odd speaker name behaviour on small resolutions
joaodiaslobo Jan 2, 2025
39f390a
feat: add sparkles
joaodiaslobo Jan 2, 2025
e9b43a2
Merge branch 'main' into jl/landing
joaodiaslobo Jan 3, 2025
41d4714
feat: empty states & add docs
joaodiaslobo Jan 3, 2025
ff26ccf
feat: 404 page
joaodiaslobo Jan 3, 2025
c0d5312
feat: add logged in options to navbar
joaodiaslobo Jan 4, 2025
99be5b8
feat: add faqs
joaodiaslobo Jan 5, 2025
4f12707
fix: ci
joaodiaslobo Jan 5, 2025
b99ffcf
feat: add animations
joaodiaslobo Jan 5, 2025
0148130
fix: event date seeds
joaodiaslobo Jan 5, 2025
6b9c77e
feat: add placeholder company logo & hide team button
joaodiaslobo Jan 5, 2025
48a4867
feat: suggestions
joaodiaslobo Jan 5, 2025
0f36409
chore: format
joaodiaslobo Jan 5, 2025
7132c0c
chore: change page title
joaodiaslobo Jan 5, 2025
ee4f2b4
feat: suggestions
joaodiaslobo Jan 5, 2025
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
6 changes: 5 additions & 1 deletion assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,9 @@ input:-webkit-autofill:active {

@font-face {
font-family: "Terminal";
src: url("/fonts/TerminalGrotesque.ttf") format("truetype");
src: url("/fonts/Terminal/TerminalGrotesque.ttf") format("truetype");
}
@font-face {
font-family: "Inter-Regular";
src: url("/fonts/Inter/Inter-Regular.ttf") format("truetype");
}
3 changes: 2 additions & 1 deletion assets/css/components.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@import "components/avatar.css";
@import "components/field.css";
@import "components/field.css";
@import "components/dropdown.css";
35 changes: 35 additions & 0 deletions assets/css/components/dropdown.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* Dropdown */

.safira-dropdown {
@apply relative inline-block text-left;
}
.safira-dropdown__chevron {
@apply w-5 h-5 ml-2 -mr-1 dark:text-gray-100;
}
.safira-dropdown__menu-items-wrapper {
@apply absolute z-30 w-56 mt-2 bg-white rounded-md shadow-lg dark:bg-gray-800 ring-1 ring-black ring-opacity-5 focus:outline-none;
}
.safira-dropdown__menu-items-wrapper-placement--left {
@apply right-0 origin-top-right;
}
.safira-dropdown__menu-items-wrapper-placement--right {
@apply left-0 origin-top-left;
}
.safira-dropdown__menu-item {
@apply flex items-center self-start justify-start w-full gap-2 px-4 py-2 text-sm text-left text-gray-700 transition duration-150 ease-in-out dark:hover:bg-gray-700 dark:text-gray-300 dark:bg-gray-800 hover:bg-gray-100;
}
.safira-dropdown__trigger-button--no-label {
@apply flex items-center text-gray-400 rounded-full hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-blue-500;
}
.safira-dropdown__trigger-button--with-label {
@apply inline-flex justify-center w-full px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm dark:text-gray-300 dark:bg-gray-800 hover:dark:bg-gray-700 dark:border-gray-700 dark:focus:bg-gray-800 hover:bg-gray-50 focus:outline-none;
}
.safira-dropdown__trigger-button--with-label-and-trigger-element {
@apply align-middle;
}
.safira-dropdown__menu-item--disabled {
@apply text-gray-500 hover:bg-transparent;
}
.safira-dropdown__ellipsis {
@apply w-5 h-5;
}
12 changes: 6 additions & 6 deletions assets/css/components/field.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}

.safira-checkbox {
@apply w-5 h-5 transition-all duration-150 ease-linear border-gray-300 rounded cursor-pointer text-primary-500 dark:bg-gray-800 dark:border-gray-600 disabled:bg-gray-300 dark:disabled:bg-gray-600 disabled:cursor-not-allowed focus:ring-primary-500;
@apply w-5 h-5 transition-all duration-150 ease-linear border-gray-300 rounded cursor-pointer text-secondary-500 dark:bg-gray-800 dark:border-gray-600 disabled:bg-gray-300 dark:disabled:bg-gray-600 disabled:cursor-not-allowed focus:ring-secondary-500;
}

.safira-checkbox-label {
Expand Down Expand Up @@ -47,7 +47,7 @@
/* Text input */

.safira-text-input {
@apply block w-full border-gray-300 rounded-md shadow-sm focus:border-primary-500 focus:ring-primary-500 dark:border-gray-600 dark:focus:border-primary-500 sm:text-sm disabled:cursor-not-allowed dark:text-gray-300 focus:outline-none;
@apply block w-full border-gray-300 rounded-md shadow-sm focus:border-secondary-500 focus:ring-secondary-500 dark:border-gray-600 dark:focus:border-secondary-500 sm:text-sm disabled:cursor-not-allowed dark:text-gray-300 focus:outline-none;
}

/* Switch */
Expand Down Expand Up @@ -75,7 +75,7 @@
/* Radio */

.safira-radio {
@apply w-4 h-4 border-gray-300 cursor-pointer text-primary-600 focus:ring-primary-500 dark:border-gray-600;
@apply w-4 h-4 border-gray-300 cursor-pointer text-secondary-600 focus:ring-secondary-500 dark:border-gray-600;
}

.safira-radio-label {
Expand Down Expand Up @@ -111,19 +111,19 @@
/* Color */

.safira-color-input {
@apply border-gray-300 cursor-pointer focus:border-primary-500 focus:ring-primary-500 dark:border-gray-600 dark:focus:border-primary-500;
@apply border-gray-300 cursor-pointer focus:border-secondary-500 focus:ring-secondary-500 dark:border-gray-600 dark:focus:border-secondary-500;
}

/* File */

.safira-file-input {
@apply text-sm rounded-md cursor-pointer focus:outline-none file:border-0 text-slate-500 file:text-primary-700 file:font-semibold file:px-4 file:py-2 file:mr-6 file:rounded-md hover:file:bg-primary-100 file:bg-primary-200 dark:file:bg-primary-300 hover:dark:file:bg-primary-200;
@apply text-sm rounded-md cursor-pointer focus:outline-none file:border-0 text-slate-500 file:text-secondary-700 file:font-semibold file:px-4 file:py-2 file:mr-6 file:rounded-md hover:file:bg-secondary-100 file:bg-secondary-200 dark:file:bg-secondary-300 hover:dark:file:bg-secondary-200;
}

/* Range */

.safira-range-input {
@apply w-full border-gray-300 cursor-pointer focus:border-primary-500 focus:ring-primary-500 dark:border-gray-600 dark:focus:border-primary-500;
@apply w-full border-gray-300 cursor-pointer focus:border-secondary-500 focus:ring-secondary-500 dark:border-gray-600 dark:focus:border-secondary-500;
}

/* Text */
Expand Down
2 changes: 1 addition & 1 deletion assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ let liveSocket = new LiveSocket("/live", Socket, {
})

// Show progress bar on live navigation and form submits
topbar.config({barColors: {0: "#29d"}, shadowColor: "rgba(0, 0, 0, .3)"})
topbar.config({barColors: {0: "#ffdb0d"}, shadowColor: "rgba(0, 0, 0, .3)"})
window.addEventListener("phx:page-loading-start", _info => topbar.show(300))
window.addEventListener("phx:page-loading-stop", _info => topbar.hide())

Expand Down
62 changes: 55 additions & 7 deletions assets/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const path = require("path")
const colors = require("tailwindcss/colors");

module.exports = {
//darkMode: "selector",
darkMode: "selector",
content: [
"./js/**/*.js",
"../lib/safira_web.ex",
Expand All @@ -13,9 +13,8 @@ module.exports = {
theme: {
extend: {
colors: {
primary: colors.blue,
primaryDark: "#04041C",
accent: "#ff800d",
primary: "#04041C",
accent: "#ffdb0d",
light: "#ffffff",
lightMuted: "#a1a1aa",
lightShade: "#e5e7eb",
Expand All @@ -30,8 +29,24 @@ module.exports = {
gray: colors.gray
},
fontFamily: {
terminal: ["Terminal"]
}
terminal: ["Terminal"],
iregular: ["Inter-Regular"]
},
animation: {
"slide-in": "slide-in 1.5s ease-in-out",
"fade-in": "fade-in 0.5s ease-in-out",
"fade-in-slow": "fade-in 1.5s ease-in-out"
},
keyframes: {
"slide-in": {
"0%": { transform: "translateY(20%)", opacity: 0},
"100%": { transform: "translateY(0)", opacity: 1},
},
"fade-in": {
"0%": { opacity: 0},
"100%": { opacity: 1},
}
},
},
},
plugins: [
Expand Down Expand Up @@ -86,6 +101,39 @@ module.exports = {
}
}
}, {values})
}),

// Embeds FontAwesome icons (https://fontawesome.com/) into app.css bundle
plugin(function ({ matchComponents, theme }) {
let iconsDir = path.join(__dirname, "../deps/fontawesome/svgs")
let values = {}
let icons = [
["", "", "/regular"],
["-solid", "", "/solid"],
["", "brand-", "/brands"]
]
icons.forEach(([suffix, prefix, dir]) => {
fs.readdirSync(path.join(iconsDir, dir)).forEach(file => {
let name = prefix + path.basename(file, ".svg") + suffix
values[name] = { name, fullPath: path.join(iconsDir, dir, file) }
})
})
matchComponents({
"fa": ({ name, fullPath }) => {
let content = fs.readFileSync(fullPath).toString().replace(/\r?\n|\r/g, "")
return {
[`--fa-${name}`]: `url('data:image/svg+xml;utf8,${content}')`,
"-webkit-mask": `var(--fa-${name})`,
"mask": `var(--fa-${name})`,
"mask-repeat": "no-repeat",
"background-color": "currentColor",
"vertical-align": "middle",
"display": "inline-block",
"width": theme("spacing.5"),
"height": theme("spacing.5")
}
}
}, { values })
})
]
}
}
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ config :safira, SafiraWeb.Endpoint,
adapter: Bandit.PhoenixAdapter,
render_errors: [
formats: [html: SafiraWeb.ErrorHTML, json: SafiraWeb.ErrorJSON],
layout: false
layout: {SafiraWeb.Layouts, :landing}
],
pubsub_server: Safira.PubSub,
live_view: [signing_salt: "TzWGKiXG"]
Expand Down
2 changes: 1 addition & 1 deletion lib/safira/accounts/roles/permissions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defmodule Safira.Accounts.Roles.Permissions do
"purchases" => ["show", "redeem", "refund"],
"badges" => ["show", "edit", "delete", "give", "revoke", "give_without_restrictions"],
"minigames" => ["show", "edit", "simulate"],
"event" => ["show", "edit"],
"event" => ["show", "edit", "edit_faqs"],
"spotlights" => ["edit"],
"schedule" => ["edit"],
"statistics" => ["show"],
Expand Down
47 changes: 47 additions & 0 deletions lib/safira/activities.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,37 @@ defmodule Safira.Activities do
|> Flop.validate_and_run(params, for: Activity)
end

@doc """
Returns the count of activities.

## Examples

iex> get_activities_count()
42

"""
def get_activities_count do
Activity
|> Repo.aggregate(:count, :id)
end

@doc """
Returns the list of daily activities.

## Examples

iex> list_daily_activities(~D[2022-01-01])
[%Activity{}, ...]

"""
def list_daily_activities(day) do
Activity
|> where([a], a.date == ^day)
|> order_by([a], a.time_start)
|> preload([:speakers, :category])
|> Repo.all()
end

@doc """
Gets a single activity.

Expand Down Expand Up @@ -374,4 +405,20 @@ defmodule Safira.Activities do
def change_speaker(%Speaker{} = speaker, attrs \\ %{}) do
Speaker.changeset(speaker, attrs)
end

@doc """
Returns the list of highlighted speakers.

## Examples

iex> list_highlighted_speakers()
[%Speaker{}, ...]

"""
def list_highlighted_speakers(opts \\ []) do
Speaker
|> apply_filters(opts)
|> where([s], s.highlighted)
|> Repo.all()
end
end
24 changes: 24 additions & 0 deletions lib/safira/companies.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ defmodule Safira.Companies do
|> Flop.validate_and_run(params, for: Company)
end

@doc """
Returns the count of companies.

## Examples

iex> get_companies_count()
42

"""
def get_companies_count do
Company
|> Repo.aggregate(:count, :id)
end

@doc """
Gets a single company.

Expand Down Expand Up @@ -248,4 +262,14 @@ defmodule Safira.Companies do
def get_next_tier_priority do
(Repo.aggregate(from(t in Tier), :max, :priority) || -1) + 1
end

@doc """
Returns the list of tiers with companies.
"""
def list_tiers_with_companies do
Tier
|> order_by(:priority)
|> preload(:companies)
|> Repo.all()
end
end
Loading
Loading