Skip to content

Commit 5de50ab

Browse files
committed
tailwind updates to main dev mode and sidebar
- updated the style and layout - darkmode support - reconfigured some layouts - updated a few builtins preliminarily to help with debuging - responsive mode can do full window - configuration panel for all the dev tool options (and reset)
1 parent 8fcd352 commit 5de50ab

29 files changed

Lines changed: 1084 additions & 518 deletions

plugins/strip-devtool.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export default function stripDevToolPlugin() {
5252
clean_src = removetag(clean_src, 'Notivue')
5353
clean_src = removeline(clean_src, 'Notivue')
5454
clean_src = removeline(clean_src, 'notivue')
55+
clean_src = removeline(clean_src, 'DevAppSidebar')
5556
}
5657
}
5758

src/builtins/advertisement/AdvertisementView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ onBeforeUnmount(() => {
4646
<div class="page prevent-select text-center flex flex-col items-center">
4747
<br /><br /><br />
4848
<img ref="logo" src="@/user/assets/brain.svg" width="220" />
49-
<h1 ref="title" class="title is-3">Please help us understand the mind!</h1>
49+
<h1 ref="title" class="text-3xl font-bold mb-4">Please help us understand the mind!</h1>
5050
<p>Take part in a short experiment where you play some games.</p>
5151
<br />
5252
<Button ref="button" id="begintask" @click="finish()" size="lg">

src/builtins/navbars/StatusBar.vue

Lines changed: 58 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import useAPI from '@/core/composables/useAPI'
88
import WithdrawFormModal from '@/builtins/withdraw/WithdrawFormModal.vue'
99
import InformedConsentModal from '@/builtins/simple_consent/InformedConsentModal.vue'
1010
import ReportIssueModal from '@/builtins/report_issue/ReportIssueModal.vue'
11+
import { Button } from '@/uikit/components/ui/button'
1112
1213
const router = useRouter()
1314
const smilestore = useSmileStore() // get the global store
@@ -50,13 +51,13 @@ function submitWithdraw() {
5051
</script>
5152

5253
<template>
53-
<div class="infobar" role="navigation" aria-label="main navigation">
54-
<div class="infobar-brand">
55-
<a class="infobar-logo" :href="appconfig.labURL" target="_new" v-if="!appconfig.anonymousMode">
54+
<div class="flex flex-row items-stretch relative px-5" role="navigation" aria-label="main navigation">
55+
<div class="flex items-stretch flex-shrink-0 min-h-[3.25rem]">
56+
<a class="flex items-center pt-3" :href="appconfig.labURL" target="_new" v-if="!appconfig.anonymousMode">
5657
<img :src="api.getStaticUrl(appconfig.brandLogoFn)" width="90" />
5758
</a>
58-
<div class="infobar-item">
59-
<p class="is-size-7 studyinfo pt-2">
59+
<div class="flex items-center pt-1">
60+
<p class="text-xs text-left pl-2.5 text-foreground pt-2 sm:block hidden font-mono">
6061
Study: {{ smilestore.config.codeName }}<br />Version: {{ smilestore.config.github.lastCommitHash
6162
}}{{
6263
appconfig.mode === 'testing' || appconfig.mode === 'development' || appconfig.mode === 'presentation'
@@ -67,49 +68,55 @@ function submitWithdraw() {
6768
</p>
6869
</div>
6970
</div>
70-
<div id="infobar" class="infobar-menu is-active">
71-
<div class="infobar-end">
72-
<div class="infobar-item" v-if="!appconfig.anonymousMode">
73-
<div class="buttons">
74-
<button
75-
class="button is-info is-small is-light"
76-
v-if="api.store.browserPersisted.consented"
77-
@click="toggleConsent()"
78-
>
79-
<FAIcon icon="magnifying-glass" />&nbsp;&nbsp;View consent
80-
</button>
81-
<button
82-
class="button is-danger is-small is-light"
71+
<div id="infobar" class="flex-grow flex-shrink-0 flex items-stretch z-10">
72+
<div class="flex justify-end ml-auto items-stretch">
73+
<div class="flex items-center pt-1" v-if="!appconfig.anonymousMode">
74+
<div class="flex gap-2">
75+
<Button variant="outline" size="xs" v-if="api.store.browserPersisted.consented" @click="toggleConsent()">
76+
<FAIcon icon="magnifying-glass" />
77+
View consent
78+
</Button>
79+
<Button
80+
variant="destructive"
81+
size="xs"
8382
v-if="api.store.browserPersisted.consented && !api.store.browserPersisted.withdrawn"
8483
@click="toggleWithdraw()"
8584
>
86-
<FAIcon icon="circle-xmark" />&nbsp;&nbsp;Withdraw
87-
</button>
88-
<button class="button is-warning is-small is-light" @click="toggleReport()" v-if="false">
89-
<FAIcon icon="hand" />&nbsp;&nbsp;Report issue
90-
</button>
85+
<FAIcon icon="circle-xmark" />
86+
Withdraw
87+
</Button>
88+
<Button variant="secondary" size="xs" @click="toggleReport()" v-if="false">
89+
<FAIcon icon="hand" />
90+
Report issue
91+
</Button>
9192
</div>
9293
</div>
9394
</div>
9495
</div>
9596
</div>
9697

9798
<!-- modal for viewing consent form -->
98-
<div class="modal" :class="{ 'is-active': showconsentmodal }">
99-
<div class="modal-background" @click="toggleConsent()"></div>
100-
<div class="modal-content">
101-
<div class="modaltext">
99+
<div class="absolute inset-0 z-50 flex items-center justify-center p-8" :class="{ hidden: !showconsentmodal }">
100+
<div class="absolute inset-0 bg-black bg-opacity-50" @click="toggleConsent()"></div>
101+
<div class="relative bg-white rounded-lg shadow-xl w-full max-w-4xl max-h-[90vh] overflow-y-auto">
102+
<div class="p-8">
102103
<InformedConsentModal @toggle-consent="toggleConsent()" />
103104
</div>
104105
</div>
105-
<button class="modal-close is-large" aria-label="close" @click="toggleConsent()"></button>
106+
<button
107+
class="absolute top-8 right-8 text-gray-400 hover:text-gray-600 text-2xl z-10"
108+
aria-label="close"
109+
@click="toggleConsent()"
110+
>
111+
×
112+
</button>
106113
</div>
107114

108115
<!-- modal for withdrawing from study -->
109-
<div class="modal" :class="{ 'is-active': showwithdrawmodal }">
110-
<div class="modal-background" @click="toggleWithdraw()"></div>
111-
<div class="modal-content">
112-
<div class="modaltext">
116+
<div class="absolute inset-0 z-50 flex items-center justify-center p-8" :class="{ hidden: !showwithdrawmodal }">
117+
<div class="absolute inset-0 bg-black bg-opacity-50" @click="toggleWithdraw()"></div>
118+
<div class="relative bg-white rounded-lg shadow-xl w-full max-w-4xl max-h-[90vh] overflow-y-auto">
119+
<div class="p-8">
113120
<WithdrawFormModal
114121
:prefill-email="email"
115122
ref="withdrawform"
@@ -118,100 +125,33 @@ function submitWithdraw() {
118125
/>
119126
</div>
120127
</div>
121-
<button class="modal-close is-large" aria-label="close" @click="toggleWithdraw()"></button>
128+
<button
129+
class="absolute top-8 right-8 text-gray-400 hover:text-gray-600 text-2xl z-10"
130+
aria-label="close"
131+
@click="toggleWithdraw()"
132+
>
133+
×
134+
</button>
122135
</div>
123136

124137
<!-- modal for reporting issues -->
125-
<div class="modal" :class="{ 'is-active': showreportissuemodal }">
126-
<div class="modal-background" @click="toggleReport()"></div>
127-
<div class="modal-content">
128-
<div class="modaltext">
138+
<div class="absolute inset-0 z-50 flex items-center justify-center p-8" :class="{ hidden: !showreportissuemodal }">
139+
<div class="absolute inset-0 bg-black bg-opacity-50" @click="toggleReport()"></div>
140+
<div class="relative bg-white rounded-lg shadow-xl w-full max-w-4xl max-h-[90vh] overflow-y-auto">
141+
<div class="p-8">
129142
<ReportIssueModal @toggle-report="toggleReport()" />
130143
</div>
131144
</div>
132-
<button class="modal-close is-large" aria-label="close" @click="toggleReport()"></button>
145+
<button
146+
class="absolute top-8 right-8 text-gray-400 hover:text-gray-600 text-2xl z-10"
147+
aria-label="close"
148+
@click="toggleReport()"
149+
>
150+
×
151+
</button>
133152
</div>
134153
</template>
135154

136155
<style scoped>
137-
.infobar {
138-
display: flex;
139-
flex-flow: row nowrap;
140-
align-items: stretch;
141-
position: relative;
142-
}
143-
144-
.infobar-brand {
145-
align-items: stretch;
146-
display: flex;
147-
flex-shrink: 0;
148-
min-height: var(--bulma-navbar-height);
149-
}
150-
151-
.infobar {
152-
padding-left: 20px;
153-
padding-right: 20px;
154-
}
155-
156-
.infobar-logo {
157-
align-items: center;
158-
padding-top: 12px;
159-
}
160-
161-
.infobar-item {
162-
align-items: center;
163-
display: flex;
164-
padding-top: 3px;
165-
}
166-
167-
.infobar-end {
168-
justify-content: flex-end;
169-
margin-inline-start: auto;
170-
display: flex;
171-
align-items: stretch;
172-
}
173-
174-
.infobar-menu {
175-
flex-grow: 1;
176-
flex-shrink: 0;
177-
align-items: stretch;
178-
display: flex;
179-
z-index: 999;
180-
}
181-
182-
/* scoped css for this component */
183-
.modaltext {
184-
background-color: #fff;
185-
padding: 30px;
186-
}
187-
188-
.navbar {
189-
z-index: 10;
190-
background-color: var(--status-bar-bg-color);
191-
color: var(--status-bar-text-color);
192-
}
193-
194-
.modal-content {
195-
width: 80%;
196-
}
197-
198-
.studyinfo {
199-
text-align: left;
200-
padding-left: 10px;
201-
color: var(--status-bar-text-color);
202-
}
203-
204-
.navbar-start {
205-
margin-right: 10px;
206-
}
207-
208-
.navbar-end {
209-
margin-left: auto;
210-
}
211-
212-
@media screen and (max-width: 560px) {
213-
.studyinfo {
214-
display: none;
215-
}
216-
}
156+
/* All styling has been converted to Tailwind classes */
217157
</style>
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
<script setup>
22
import useAPI from '@/core/composables/useAPI'
3+
import { Button } from '@/uikit/components/ui/button'
34
const api = useAPI()
45
//import InformedConsentText from '@/user/components/InformedConsentText.vue'
56
</script>
67

78
<template>
8-
<article class="message">
9-
<div class="message-header">
10-
<p>Informed Consent</p>
9+
<div class="rounded-lg border border-blue-200 bg-blue-50 p-6 shadow-sm">
10+
<div class="mb-4 border-b border-blue-200 pb-3">
11+
<h3 class="text-lg font-semibold text-blue-800">Informed Consent</h3>
1112
</div>
12-
<div class="message-body has-text-left mr-7 pb-8">
13+
<div class="space-y-4 text-left pr-7 pb-8">
1314
<template v-if="api.getAppComponent">
1415
<component :is="api.getAppComponent('informed_consent_text')" />
1516
</template>
1617
<template v-else>
17-
<div class="notification is-danger">
18+
<div class="rounded-md border border-red-200 bg-red-50 p-4 text-sm text-red-800">
1819
Error: Unable to load consent form text. Please contact the study administrator.
1920
</div>
2021
</template>
2122
<!-- load text of consent form -->
22-
<div class="has-text-right mt-5">
23-
<button class="button" aria-label="close" @click="$emit('toggleConsent')">
24-
Thanks, take me back to the study!
25-
</button>
23+
<div class="flex justify-end pt-5">
24+
<Button variant="default" @click="$emit('toggleConsent')"> Thanks, take me back to the study! </Button>
2625
</div>
2726
</div>
28-
</article>
27+
</div>
2928
</template>

0 commit comments

Comments
 (0)