Переглянути джерело

Add meta tag to page, make select button mobile ready

sbkwgh 8 роки тому
батько
коміт
5f21760c37
2 змінених файлів з 35 додано та 2 видалено
  1. 1 1
      index.html
  2. 34 1
      src/components/SelectButton.vue

+ 1 - 1
index.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
   <head>
-    <meta charset="utf-8">
+    <meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1">
     <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
     <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/styles/default.min.css">
   </head>

+ 34 - 1
src/components/SelectButton.vue

@@ -131,4 +131,37 @@
 		}
 
 	}
-</style>
+
+	@media (max-width: 425px) {
+		.select_button {
+			@at-root #{&}__overlay {
+				transition: all 0.2s;
+
+				@at-root #{&}--show {
+					background-color: hsla(213, 35%, 5%, 0.76);
+				}
+			}
+
+			@at-root #{&}__options {
+				width: 100%;
+				left: 0;
+				bottom: 0;
+				position: fixed;
+				font-size: 1.5rem;
+				opacity: 1;
+				border-radius: 0.25rem 0.25rem 0 0;
+				transition: opacity 0.2s, bottom 0.2s;
+
+				@at-root #{&}--hidden {
+					bottom: -100%;
+					opacity: 0;
+				} 
+
+			}
+			@at-root #{&}__option {
+				padding: 1rem;
+			}
+		}
+	}
+</style>
+