# HG changeset patch # User Nattee Niparnan # Date 2022-02-03 08:18:49 # Node ID 534e06ae3cce706f0303e64d25845d5b8645d4c2 # Parent c7508af7524ef43f4f81c7edd28c1395e1f5806d # Parent 97816c2b8906c6cff4fe0a9da626222b0b37fdee Merge pull request #30 from noppakorn/golden-submit-button add golden submit button diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -556,3 +556,39 @@ .grader-comment { word-wrap: break-word; } + + +golden-btn + .golden-btn { margin-top: 1em; } + +.golden-btn { + display: inline-block; + outline: none; + font-family: inherit; + box-sizing: border-box; + border: none; + box-shadow: 0 3px 6px rgba(0,0,0,.16), 0 3px 6px rgba(110,80,20,.4), + inset 0 -2px 5px 1px rgba(139,66,8,1), + inset 0 -1px 1px 3px rgba(250,227,133,1); + background-image: linear-gradient(160deg, #a54e07, #b47e11, #fef1a2, #bc881b, #a54e07) !important; + border: 1px solid #a55d07; + color: rgb(120,50,5); + text-shadow: 0 2px 2px rgba(250, 227, 133, 1); + cursor: pointer; + transition: all .2s ease-in-out; + background-size: 100% 100%; + background-position:center; +} +.golden-btn:focus, +.golden-btn:hover { + background-size: 150% 150%; + box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23), + inset 0 -2px 5px 1px #b17d10, + inset 0 -1px 1px 3px rgba(250,227,133,1); + border: 1px solid rgba(165,93,7,.6); + color: rgba(120,50,5,.8); +} +.golden-btn:active { + box-shadow: 0 3px 6px rgba(0,0,0,.16), 0 3px 6px rgba(110,80,20,.4), + inset 0 -2px 5px 1px #b17d10, + inset 0 -1px 1px 3px rgba(250,227,133,1); +} diff --git a/app/views/submissions/edit.html.haml b/app/views/submissions/edit.html.haml --- a/app/views/submissions/edit.html.haml +++ b/app/views/submissions/edit.html.haml @@ -35,7 +35,7 @@ = file_field_tag 'load_file' = text_field_tag '' , nil, {readonly: true, class: 'form-control'} .form-group - = submit_tag 'Submit', class: 'btn btn-success', id: 'live_submit', + = submit_tag 'Submit', class: 'btn ' + (@submission && @submission.number >= 100 ? 'golden-btn' : 'btn-success'), id: 'live_submit', data: {confirm: "Submitting this source code for task #{@problem.long_name}?"} - # latest submission status .panel{class: (@submission && @submission.graded_at) ? "panel-info" : "panel-warning"}