UNPKG

senangwebs-story

Version:

Lightweight, dependency-free JavaScript library for creating interactive, visual novel-style story experiences.

99 lines (98 loc) 1.77 kB
body { font-family: sans-serif; background-color: #f0f0f0; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } #story-container { width: 100%; height: 100%; position: relative; overflow: hidden; } [data-sws-background] img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; z-index: 1; } [data-sws-subjects] { position: absolute; bottom: 0; left: 0; width: 100%; height: 80%; z-index: 2; display: flex; justify-content: center; align-items: flex-end; } [data-sws-subjects] img { max-height: 100%; opacity: 0.5; transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out; margin: 0 20px; } [data-sws-subjects] img.active { opacity: 1; transform: scale(1.05); } [data-sws-dialog-box] { position: absolute; bottom: 20px; left: 20px; right: 20px; background: rgba(0, 0, 0, 0.7); color: white; padding: 20px; border-radius: 10px; z-index: 3; min-height: 150px; } [data-sws-active-subject-name] { margin: 0 0 10px 0; font-size: 1.2em; font-weight: bold; color: #ffc107; } [data-sws-dialog-box] p { margin: 0; font-size: 1em; line-height: 1.5; } [data-sws-actions] { position: absolute; bottom: 10px; right: 10px; z-index: 4; } [data-sws-actions] button { padding: 10px 20px; font-size: 1em; cursor: pointer; margin-left: 10px; } [data-sws-button="next"] { background-color: #28a745; color: white; border: none; border-radius: 5px; } [data-sws-button="next"]:hover { background-color: #218838; } [data-sws-button="back"] { background-color: #007bff; color: white; border: none; border-radius: 5px; } [data-sws-button="back"]:hover { background-color: #0069d9; }