Skip to content

Manic EMU is an all-in-one retro game emulator for iOS. It packs powerful features while keeping a clean, sleek UI and delivering buttery-smooth gameplay.

Swift
14.7 KB
Raw Blame
@keyframes spin {
    to { transform: rotate(360deg); }
}

:root {
    --bg-primary: #121212;
    --bg-secondary: #1B1B20;
    --bg-tertiary: #27272E;
    --bg-quaternary: #464651;
    --label1: #ffffff;
    --label2: #8F8F92;
    --red: #FF2442;
    --background1: var(--bg-primary);
    --background2: var(--bg-secondary);
    --interactive-bg: var(--bg-tertiary);
    --segment-bg: var(--bg-secondary);
    --segment-selected-bg: var(--bg-tertiary);
    --segment-height: 40px;
    --action-button-height: 52px;
    --interactive-height: 60px;
    --interactive-radius: 16px;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #F2F2F6;
        --bg-secondary: #FFFFFF;
        --bg-tertiary: #EEEEEE;
        --bg-quaternary: #FFFFFF;
        --label1: #323443;
        --label2: #90929F;
    }
}

body.theme-light {
    --bg-primary: #F2F2F6;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #EEEEEE;
    --bg-quaternary: #FFFFFF;
    --label1: #323443;
    --label2: #90929F;
}

* {
    box-sizing: border-box;
}

#column,
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

html {
    background-color: var(--bg-primary);
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    font-size: 16px;
    background-color: var(--bg-primary);
    color: var(--label1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: default;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overflow-x: hidden;
}

#column {
    width: 100%;
    background-color: var(--bg-primary);
    padding-bottom: calc(var(--action-button-height) + 36px + env(safe-area-inset-bottom));
}

h1,
header {
    display: none;
}

#wrapper {
    flex: 1;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px 0;
}

#switch-container {
    margin-bottom: 20px;
}

#switch-create-button {
    background-color: var(--segment-bg);
    border-radius: calc(var(--segment-height) / 2 + 4px);
    padding: 4px;
    display: flex;
    gap: 4px;
    width: 100%;
}

.mode-segment {
    flex: 1;
    height: var(--segment-height);
    padding: 0 20px;
    border-radius: calc(var(--segment-height) / 2);
    background-color: transparent;
    color: var(--label1);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .2s ease;
    white-space: nowrap;
    border: 0;
    outline: 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-segment.selected {
    background-color: var(--segment-selected-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.switch {
    display: none !important;
}

#app-info {
    text-align: left;
    margin-bottom: 20px;
    padding: 0;
}

#app-info p {
    margin: 6px 0;
    color: var(--label2);
    font-size: 13px;
    line-height: 1.5;
}

#app-info .app-description {
    font-size: 14px;
}

#app-info .app-credit {
    font-size: 12px;
}

#app-info .app-links {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

#app-info .app-links .icon {
    width: 14px;
    height: 14px;
    opacity: .6;
    display: inline-block;
    vertical-align: middle;
}

#app-info a {
    color: var(--label2);
    text-decoration: none;
    transition: color .2s ease;
}

#app-info a:hover {
    color: var(--label1);
}

.tab {
    background-color: var(--bg-secondary);
    border-radius: 20px;
    padding: 20px 16px;
    margin-bottom: 16px;
    transition: all .3s ease;
}

.tab:last-child {
    margin-bottom: 20px;
}

.section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--label1);
    margin: 0 0 16px;
    padding: 0;
}

.file-input-wrapper {
    position: relative;
    width: 100%;
}

.file-button,
input[type=file] {
    width: 100%;
    border: 0;
    cursor: pointer;
}

input[type=file] {
    height: 100%;
    padding: 0;
    background: 0 0;
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.file-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: var(--interactive-height);
    padding: 0 20px;
    background-color: var(--interactive-bg);
    border-radius: var(--interactive-radius);
    color: var(--label1);
    font-size: 15px;
    font-weight: 600;
    transition: all .2s ease;
    position: relative;
}

.file-button:active {
    transform: scale(.98);
}

input[type=file]:disabled + .file-button {
    opacity: .5;
}

.file-button .icon-plus {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: var(--label1);
    background-color: #fff;
    border-radius: 50%;
    flex-shrink: 0;
}

.file-button .icon-plus::before {
    content: "+";
    display: block;
    margin-bottom: 2px;
}

.file-button.has-file {
    background-color: var(--interactive-bg);
    justify-content: space-between;
}

.file-button.has-file .file-name {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.file-button .change-file {
    color: var(--red);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.rom-filename-display {
    background-color: var(--interactive-bg);
    border-radius: var(--interactive-radius);
    padding: 0 20px;
    min-height: var(--interactive-height);
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--label1);
    word-break: break-all;
}

.creator-loaded-container,
.patch-loaded-container,
.rom-loaded-container {
    display: none;
}

.patch-info-container,
.rom-info-container {
    margin-bottom: 12px;
}

.info-row {
    display: none;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 12px;
}

.info-row.show {
    display: flex;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    font-size: 13px;
    color: var(--label2);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 60px;
}

.info-value {
    font-size: 13px;
    color: var(--label1);
    font-family: "SF Mono", "Monaco", "Courier New", monospace;
    word-break: break-all;
    text-align: left;
    flex: 1;
    -moz-user-select: text;
    -webkit-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor: text;
}

.change-file-button {
    width: 100%;
    height: var(--interactive-height);
    padding: 0 20px;
    background-color: var(--interactive-bg);
    border: 0;
    border-radius: var(--interactive-radius);
    color: var(--red);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    text-align: center;
    font-family: inherit;
}

.change-file-button:active {
    transform: scale(.98);
    opacity: .8;
}

.checkbox-container {
    margin: 12px 0;
    display: none;
}

.checkbox-container.show,
.error-message-container.show {
    display: block;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--label1);
    cursor: pointer;
}

input[type=checkbox].styled {
    width: 22px;
    height: 22px;
    border: 2px solid var(--label2);
    border-radius: 6px;
    background-color: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: relative;
    transition: all .2s ease;
    flex-shrink: 0;
}

input[type=checkbox].styled:checked {
    background-color: transparent;
    border-color: var(--label1);
}

input[type=checkbox].styled:checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

select {
    width: 100%;
    height: var(--interactive-height);
    background-color: var(--interactive-bg);
    border: 0;
    border-radius: var(--interactive-radius);
    color: var(--label1);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    outline: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238F8F92' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding: 0 48px 0 18px;
    font-family: inherit;
}

select:disabled {
    opacity: .5;
    cursor: not-allowed;
}

#patch-builder-container-metadata-inputs {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#patch-builder-container-metadata-inputs input[type=text] {
    width: 100%;
    height: var(--interactive-height);
    padding: 0 18px;
    background-color: var(--interactive-bg);
    border: 0;
    border-radius: var(--interactive-radius);
    color: var(--label1);
    font-size: 15px;
    outline: 0;
    font-family: inherit;
}

#patch-builder-container-metadata-inputs input[type=text]::placeholder {
    color: var(--label2);
}

#bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 100;
    display: flex;
    justify-content: center;
}

button {
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    height: var(--action-button-height);
    padding: 0 48px;
    border: 0;
    border-radius: calc(var(--action-button-height) / 2);
    cursor: pointer;
    outline: 0;
    transition: all .2s ease;
    width: 100%;
    max-width: 600px;
}

#patch-builder-button-create,
#rom-patcher-button-apply {
    background-color: var(--red);
    color: #fff;
}

#patch-builder-button-create:active:not(:disabled),
#rom-patcher-button-apply:active:not(:disabled) {
    transform: scale(.98);
}

button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.error-message-container {
    display: none;
    margin-top: 16px;
}

#patch-builder-row-error-message,
#rom-patcher-row-error-message {
    margin-top: 16px;
    margin-bottom: 0;
}

#patch-builder-error-message,
#rom-patcher-error-message,
.error-message-content {
    display: block;
    color: var(--red);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 16px;
    background-color: rgba(255, 36, 66, .1);
    border-radius: 12px;
    width: 100%;
    line-height: 1.5;
}

#patch-builder-error-message:empty,
#rom-patcher-error-message:empty,
.error-message-content:empty {
    display: none;
}

#patch-builder-error-message.warning,
#rom-patcher-error-message.warning,
.error-message-content.warning {
    color: #ff9500;
    background-color: rgba(255, 149, 0, .1);
}

#patch-builder-container,
#rom-patcher-container {
    display: none;
}

#patch-builder-container.active,
#rom-patcher-container.active {
    display: block;
}

.rom-patcher-spinner {
    width: 20px;
    height: 20px;
    display: inline-block;
    position: relative;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
}

.rom-patcher-spinner:before {
    width: 6px;
    height: 6px;
    background-color: var(--red);
    border-radius: 3px;
    display: inline-block;
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    margin-left: -3px;
}

#patch-builder-button-create .rom-patcher-spinner:before,
#rom-patcher-button-apply .rom-patcher-spinner:before {
    background-color: #fff;
}

.rom-patcher-container-input {
    position: relative;
}

.rom-patcher-container-input .file-button.loading {
    padding-left: 48px;
}

.rom-patcher-container-input input.loading + .file-button + .rom-patcher-spinner {
    position: absolute;
    top: 50%;
    margin-top: -10px;
    left: 20px;
    z-index: 1;
}

.rom-patcher-dialog::backdrop {
    background-color: rgba(0, 0, 0, .75);
    backdrop-filter: blur(8px);
}

.rom-patcher-dialog {
    background-color: var(--bg-secondary);
    border: 0;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
    min-width: 320px;
    max-width: 90%;
    color: var(--label1);
}

#rom-patcher-dialog-zip-message {
    text-align: center;
    margin-bottom: 16px;
    font-size: 15px;
    font-weight: 600;
}

#rom-patcher-dialog-zip-file-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

#rom-patcher-dialog-zip-file-list li {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: background-color .2s ease;
    font-size: 15px;
}

#rom-patcher-dialog-zip-file-list li:hover {
    background-color: var(--segment-bg);
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-mono { font-family: "SF Mono", "Monaco", "Courier New", monospace; font-size: 13px; color: var(--label2); }
.text-selectable { -moz-user-select: text; -webkit-user-select: text; -ms-user-select: text; user-select: text; cursor: text; }
.hide { display: none !important; }

@media only screen and (min-width: 641px) {
    #wrapper {
        max-width: 600px;
        padding-top: 40px;
    }

    #app-info {
        margin-bottom: 24px;
    }

    .tab {
        padding: 24px 20px;
    }

    .file-section {
        margin-bottom: 20px;
    }

    #bottom-action-bar {
        padding: 16px 20px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }

    button {
        font-size: 18px;
    }
}

@media only screen and (max-width: 375px) {
    #wrapper {
        padding: 16px 12px 0;
    }

    .tab {
        padding: 16px 12px;
        border-radius: 16px;
    }

    .file-section {
        padding: 0;
    }

    .file-button {
        font-size: 14px;
    }

    .mode-segment {
        padding: 0 16px;
        font-size: 14px;
    }

    button {
        font-size: 16px;
        padding: 0 40px;
    }

    .section-title {
        font-size: 14px;
    }

    .info-label,
    .info-value {
        font-size: 12px;
    }
}

@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

body.theme-light .file-button {
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

body.theme-light .file-button .icon-plus {
    background-color: #fff;
    color: var(--label1);
}

body:not(.theme-light) .file-button {
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}

body:not(.theme-light) .file-button .icon-plus {
    background-color: #fff;
    color: #000;
}