Skip to content

Commit 08989a0

Browse files
committed
Add NSFW filter in the settings
1 parent 8e76570 commit 08989a0

File tree

1 file changed

+79
-2
lines changed

1 file changed

+79
-2
lines changed

electron_app/src/components/Settings.vue

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,21 @@
55
<h1>Settings</h1>
66
<br>
77
<h2>General Settings</h2>
8-
9-
<br><hr>
8+
<br>
9+
<div class="setting_box">
10+
<div class="settings_left">
11+
<h2>Block Adult Content</h2>
12+
<p>Prevents image generation considered NSFW</p>
13+
</div>
14+
<hr>
15+
<div style="float:right;margin-right: 9px;align-self: center;" >
16+
<label class="switch">
17+
<input type="checkbox" v-model="app_state.app_data.settings.nsfw_filter">
18+
<span class="toggle round"></span>
19+
</label>
20+
</div>
21+
</div>
22+
<hr>
1023
<div class="l_button button_colored" style="float:right" @click="add_model" >Add New Model</div>
1124
<h2>Custom Models</h2>
1225

@@ -91,4 +104,68 @@ export default {
91104
<style>
92105
</style>
93106
<style scoped>
107+
.switch {
108+
position: relative;
109+
display: inline-block;
110+
width: 60px;
111+
height: 30px;
112+
}
113+
114+
.switch input {
115+
opacity: 0;
116+
width: 0;
117+
height: 0;
118+
}
119+
120+
.toggle {
121+
position: absolute;
122+
cursor: pointer;
123+
top: 0;
124+
left: 0;
125+
right: 0;
126+
bottom: 0;
127+
background-color: #ccc;
128+
-webkit-transition: .4s;
129+
transition: .4s;
130+
}
131+
132+
.toggle:before {
133+
position: absolute;
134+
content: "";
135+
height: 22px;
136+
width: 23px;
137+
left: 5px;
138+
bottom: 4px;
139+
background-color: white;
140+
-webkit-transition: .4s;
141+
transition: .4s;
142+
}
143+
144+
input:checked + .toggle {
145+
background-color: #3E7BFA;
146+
}
147+
148+
149+
input:checked + .toggle:before {
150+
transform: translateX(27px);
151+
}
152+
153+
.toggle.round {
154+
border-radius: 34px;
155+
}
156+
157+
.toggle.round:before {
158+
border-radius: 50%;
159+
}
160+
161+
162+
.setting_box{
163+
display: flex;
164+
flex-direction: row;
165+
}
166+
167+
.settings_left{
168+
flex: 1 1 auto;
169+
}
170+
94171
</style>

0 commit comments

Comments
 (0)