Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

7.3 KB
Raw Blame
// Recipe catalog (serverkit-recipes registry) — cards grid + install drawer.

.recipes-page {
    // Width and gutter come from the page shell, as on every page.

    &__head {
        display: flex;
        align-items: flex-end;
        gap: $spacing-lg;
        margin-bottom: $spacing-md;
    }

    &__lede {
        flex: 1;
        min-width: 0;
        margin: 0;
        color: var(--text-secondary);
        font-size: $text-sm;
        line-height: 1.55;
        max-width: 640px;
    }

    &__search {
        display: flex;
        align-items: center;
        gap: $space-2;
        width: 260px;
        height: $control-md;
        padding: 0 $space-3;
        border: 1px solid var(--border-color);
        border-radius: $radius-control;
        background: var(--bg-card);
        color: var(--text-tertiary);

        input {
            flex: 1;
            min-width: 0;
            border: none;
            outline: none;
            background: transparent;
            color: var(--text-primary);
            font-size: $text-sm;
        }
    }

    &__cats {
        display: flex;
        flex-wrap: wrap;
        gap: $space-2;
        margin-bottom: $spacing-md;

        .sk-pill {
            cursor: pointer;
            opacity: 0.72;

            &.is-active {
                opacity: 1;
                border-color: var(--primary-color);
                color: var(--primary-color);
            }
        }
    }

    &__grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: $spacing-md;
    }

    &__loading {
        display: flex;
        justify-content: center;
        padding: $space-16 0;
        color: var(--text-tertiary);
    }

    &__source {
        margin-top: $spacing-md;
        text-align: center;
        font-size: $text-xs;
        color: var(--text-ghost);
    }
}

.recipe-card {
    display: flex;
    flex-direction: column;
    gap: $space-3;
    padding: $spacing-md;
    border: 1px solid var(--border-color);
    border-radius: $radius-card;
    background: var(--bg-card);

    &__top {
        display: flex;
        align-items: center;
        gap: $space-3;
    }

    &__ico {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px; // geometry: icon tile
        flex-shrink: 0;
        border-radius: $radius-control;
        background: color-mix(in srgb, var(--primary-color) 12%, transparent);
        color: var(--primary-color);
    }

    &__id {
        flex: 1;
        min-width: 0;
    }

    &__name {
        font-weight: $font-weight-semibold;
        font-size: $text-base;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    &__meta {
        font-size: $text-xs;
        color: var(--text-tertiary);
        margin-top: 1px;
    }

    &__featured {
        flex-shrink: 0;
    }

    &__desc {
        margin: 0;
        font-size: $text-sm;
        line-height: 1.5;
        color: var(--text-secondary);
        // Two-line clamp keeps every card the same height.
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    &__reqs {
        display: flex;
        flex-wrap: wrap;
        gap: $space-tight;

        span {
            padding: $space-hair $space-2;
            border-radius: $radius-badge;
            border: 1px solid var(--border-color);
            font-size: $text-xs;
            color: var(--text-tertiary);

            &.is-hard {
                color: var(--amber);
                border-color: color-mix(in srgb, var(--amber) 45%, transparent);
            }
        }
    }

    &__foot {
        display: flex;
        align-items: center;
        gap: $spacing-sm;
        margin-top: auto;
        padding-top: $space-1;
    }

    &__steps {
        flex: 1;
        min-width: 0;
        font-size: $text-xs;
        color: var(--text-ghost);
    }
}

.recipe-install {
    display: flex;
    flex-direction: column;
    gap: $spacing-sm;

    .form-label {
        display: block;
        font-size: $text-sm;
        font-weight: $font-weight-semibold;
        margin-bottom: $space-tight;
    }

    .form-hint {
        margin: $space-1 0 0;
        font-size: $text-xs;
        color: var(--text-tertiary);
    }

    .form-input {
        width: 100%;
        height: $control-md;
        padding: 0 $space-3;
        border: 1px solid var(--border-color);
        border-radius: $radius-control;
        background: var(--bg-input, var(--bg-card));
        color: var(--text-primary);
        font-size: $text-sm;
    }

    &__servers {
        overflow: hidden;
        padding: 0;
    }

    &__server {
        display: flex;
        align-items: center;
        gap: $space-3;
        width: 100%;
        padding: $space-3 $space-3;
        border: none;
        border-bottom: 1px solid var(--border-color);
        background: transparent;
        color: var(--text-primary);
        cursor: pointer;
        text-align: start;

        &:last-child { border-bottom: none; }

        &:hover { background: var(--bg-hover, rgba(128, 128, 128, 0.06)); }

        &.is-on {
            background: color-mix(in srgb, var(--primary-color) 8%, transparent);

            svg { color: var(--primary-color); }
        }
    }

    &__radio {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
        border-radius: 50%;
        border: 1.5px solid var(--border-color);

        .is-on & {
            border-color: var(--primary-color);
            box-shadow: inset 0 0 0 3.5px var(--primary-color); // geometry: draws the radio's inner dot
        }
    }

    &__srvname {
        flex: 1;
        min-width: 0;
        font-size: $text-sm;
        font-weight: $font-weight-semibold;
    }

    &__srvspec {
        font-size: $text-xs;
        color: var(--text-tertiary);
    }

    &__nosrv {
        margin: 0;
        padding: $space-3;
        font-size: $text-sm;
        color: var(--text-tertiary);
    }

    &__preflight {
        overflow: hidden;
        padding: 0;
    }

    &__blocked {
        margin: $space-2 0 0;
        font-size: $text-xs;
        color: var(--red);
    }

    &__handoffs {
        overflow: hidden;
        padding: 0;
    }

    &__actions {
        display: flex;
        justify-content: flex-end;
        gap: $space-2;
        padding-top: $spacing-sm;
    }
}

.recipe-preflight {
    display: flex;
    align-items: center;
    gap: $space-2;
    padding: $space-2 $space-3;
    border-bottom: 1px solid var(--border-color);
    font-size: $text-sm;

    &:last-child { border-bottom: none; }

    &.is-ok svg { color: var(--green); }
    &.is-bad svg { color: var(--red); }

    &__k {
        flex: 1;
        min-width: 0;
    }

    &__need,
    &__have {
        font-size: $text-xs;
        color: var(--text-tertiary);
        min-width: 64px;
        text-align: end;
    }
}

.recipe-handoff-row {
    display: flex;
    align-items: center;
    gap: $space-2;
    padding: $space-2 $space-3;
    border-bottom: 1px solid var(--border-color);
    font-size: $text-sm;

    &:last-child { border-bottom: none; }

    svg { color: var(--amber); flex-shrink: 0; }

    &__k { flex: 1; min-width: 0; }

    &__url {
        font-size: $text-xs;
        color: var(--primary-color);
    }
}