Boarding Pass ·

icyou

updated 5w ago
Preview
/* Every element above is yours to style.
   Tip: check the *,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0f172a;
  --pass-bg: #ffffff;
  --pass-stub-bg: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --brand-color: #2563eb;
  --accent-color: #eff6ff;
  --border-color: #e2e8f0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* Boarding Pass Container */
.pass {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 680px;
  background-color: var(--pass-bg);
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
  overflow: hidden;
  position: relative;
}

@media (min-width: 640px) {
  .pass {
    flex-direction: row;
  }
}

/* Main Section */
.pass-main {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Header */
.pass-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.airline {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand-color);
}

.pass-type {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Route Hero */
.route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.stop {
  display: flex;
  flex-direction: column;
}

.stop.to {
  align-items: flex-end;
}

.stop .code {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
}

.stop .city {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.stop .time {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-top: 0.375rem;
}

.route-line {
  flex: 1;
  position: relative;
  height: 2px;
  background-color: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.route-line .plane {
  background-color: var(--pass-bg);
  padding: 0 0.5rem;
  font-size: 1.125rem;
  color: var(--brand-color);
  transform: rotate(90deg);
}

.duration {
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  color: var(--text-muted);
  margin-top: -0.75rem;
}

/* Details Grid */
.details {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background-color: var(--pass-stub-bg);
  padding: 1rem;
  border-radius: 0.5rem;
}

.details dt {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.details dd {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-top: 0.125rem;
}

.details .highlight {
  background-color: var(--accent-color);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  margin: -0.25rem -0.5rem;
}

.details .highlight dt {
  color: var(--brand-color);
}

.details .highlight dd {
  color: var(--brand-color);
}

/* Status Badge */
.status {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background-color: #dcfce7;
  color: #166534;
}

/* Stub Section & Perforation */
.pass-stub {
  background-color: var(--pass-stub-bg);
  border-top: 1px dashed var(--border-color);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
  width: 100%;
}

@media (min-width: 640px) {
  .pass-stub {
    width: 220px;
    border-top: none;
    border-left: 2px dashed var(--border-color);
  }
}

.stub-route {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.stub-details {
  display: flex;
  gap: 2rem;
}

.stub-details dt {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stub-details dd {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.125rem;
}

/* Pure CSS Barcode */
.barcode {
  height: 48px;
  width: 100%;
  background: repeating-linear-gradient(
    90deg,
    #000,
    #000 2px,
    #fff 2px,
    #fff 4px,
    #000 4px,
    #000 5px,
    #fff 5px,
    #fff 8px,
    #000 8px,
    #000 12px,
    #fff 12px,
    #fff 14px
  );
  border-radius: 2px;
}

.confirmation {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.05em;
}

.confirmation strong {
  color: var(--text-main);
  font-family: monospace;
}
 tab for classes and attributes to hook into.
   Want a custom typeface? Use the T button to import any Google Font. */

Discussion 0

    Sign in to join the discussion.