Moving on
parent
67091af854
commit
f0641be55c
@ -0,0 +1,40 @@
|
||||
from flask import request
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import StringField, PasswordField, BooleanField, SubmitField
|
||||
from wtforms.validators import DataRequired
|
||||
from flask_login import current_user, login_user, logout_user
|
||||
from werkzeug.urls import url_parse
|
||||
|
||||
from yadc.models import User
|
||||
|
||||
class LoginForm(FlaskForm):
|
||||
username = StringField('Username', validators=[DataRequired()])
|
||||
password = PasswordField('Password', validators=[DataRequired()])
|
||||
remember_me = BooleanField('Remember me')
|
||||
submit = SubmitField('Log In')
|
||||
|
||||
from flask import Blueprint, render_template, flash, redirect, url_for
|
||||
|
||||
bp = Blueprint('auth', __name__)
|
||||
|
||||
@bp.route('/login', methods=['GET', 'POST'])
|
||||
def login():
|
||||
form = LoginForm()
|
||||
if form.validate_on_submit():
|
||||
#flash('Login requested for user {}, remember_me={}'.format(form.username.data, form.remember_me.data))
|
||||
user = User.query.filter_by(username=form.username.data).first()
|
||||
if user is None or not user.check_password(form.password.data):
|
||||
flash('Invalid username or password.')
|
||||
return redirect(url_for('auth.login'))
|
||||
login_user(user, remember=form.remember_me.data)
|
||||
nextpg = request.args.get('next')
|
||||
if not nextpg and url_parse(nextpg).netloc != '':
|
||||
nextpg = url_for('main.index')
|
||||
#flash('Logged in as {}'.format(user.username))
|
||||
return redirect(nextpg)
|
||||
return render_template('login.html', form=form)
|
||||
|
||||
@bp.route('/logout')
|
||||
def logout():
|
||||
logout_user()
|
||||
return redirect(url_for('main.index'))
|
@ -0,0 +1,40 @@
|
||||
from flask import Blueprint, render_template, flash, redirect
|
||||
from flask_login import login_required
|
||||
|
||||
bp = Blueprint('main', __name__)
|
||||
|
||||
@bp.route('/index')
|
||||
def index():
|
||||
return render_template('index.html')
|
||||
|
||||
@bp.route('/humm')
|
||||
@login_required
|
||||
def humm():
|
||||
return render_template('index.html')
|
||||
|
||||
@bp.route('/')
|
||||
@bp.route('/post')
|
||||
def post():
|
||||
return render_template('index.html')
|
||||
pass
|
||||
|
||||
@bp.route('/post/show/<id>')
|
||||
def post_show(id):
|
||||
return render_template('post.html')
|
||||
pass
|
||||
|
||||
@bp.route('/post/new')
|
||||
@bp.route('/post/create')
|
||||
@bp.route('/post/upload')
|
||||
@login_required
|
||||
def post_upload():
|
||||
pass
|
||||
|
||||
@bp.route('/user/show/<username>')
|
||||
def user_profile(username):
|
||||
pass
|
||||
|
||||
@bp.route('/user/settings')
|
||||
@login_required
|
||||
def user_settings():
|
||||
pass
|
@ -0,0 +1,567 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
// _ _ _ _ _
|
||||
// (_) | | | | | (_)
|
||||
// _ _ __ ___| |_ _ __| | ___ _ __ ___ ___ __| |_ __ _
|
||||
// | | '_ \ / __| | | | |/ _` |/ _ \ | '_ ` _ \ / _ \/ _` | |/ _` |
|
||||
// | | | | | (__| | |_| | (_| | __/ | | | | | | __/ (_| | | (_| |
|
||||
// |_|_| |_|\___|_|\__,_|\__,_|\___| |_| |_| |_|\___|\__,_|_|\__,_|
|
||||
//
|
||||
// Simple, elegant and maintainable media queries in Sass
|
||||
// v1.4.9
|
||||
//
|
||||
// http://include-media.com
|
||||
//
|
||||
// Authors: Eduardo Boucas (@eduardoboucas)
|
||||
// Hugo Giraudel (@hugogiraudel)
|
||||
//
|
||||
// This project is licensed under the terms of the MIT license
|
||||
|
||||
|
||||
////
|
||||
/// include-media library public configuration
|
||||
/// @author Eduardo Boucas
|
||||
/// @access public
|
||||
////
|
||||
|
||||
|
||||
///
|
||||
/// Creates a list of global breakpoints
|
||||
///
|
||||
/// @example scss - Creates a single breakpoint with the label `phone`
|
||||
/// $breakpoints: ('phone': 320px);
|
||||
///
|
||||
$breakpoints: (
|
||||
'phone': 320px,
|
||||
'tablet': 768px,
|
||||
'desktop': 1024px
|
||||
) !default;
|
||||
|
||||
|
||||
///
|
||||
/// Creates a list of static expressions or media types
|
||||
///
|
||||
/// @example scss - Creates a single media type (screen)
|
||||
/// $media-expressions: ('screen': 'screen');
|
||||
///
|
||||
/// @example scss - Creates a static expression with logical disjunction (OR operator)
|
||||
/// $media-expressions: (
|
||||
/// 'retina2x': '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)'
|
||||
/// );
|
||||
///
|
||||
$media-expressions: (
|
||||
'screen': 'screen',
|
||||
'print': 'print',
|
||||
'handheld': 'handheld',
|
||||
'landscape': '(orientation: landscape)',
|
||||
'portrait': '(orientation: portrait)',
|
||||
'retina2x': '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi), (min-resolution: 2dppx)',
|
||||
'retina3x': '(-webkit-min-device-pixel-ratio: 3), (min-resolution: 350dpi), (min-resolution: 3dppx)'
|
||||
) !default;
|
||||
|
||||
|
||||
///
|
||||
/// Defines a number to be added or subtracted from each unit when declaring breakpoints with exclusive intervals
|
||||
///
|
||||
/// @example scss - Interval for pixels is defined as `1` by default
|
||||
/// @include media('>128px') {}
|
||||
///
|
||||
/// /* Generates: */
|
||||
/// @media (min-width: 129px) {}
|
||||
///
|
||||
/// @example scss - Interval for ems is defined as `0.01` by default
|
||||
/// @include media('>20em') {}
|
||||
///
|
||||
/// /* Generates: */
|
||||
/// @media (min-width: 20.01em) {}
|
||||
///
|
||||
/// @example scss - Interval for rems is defined as `0.1` by default, to be used with `font-size: 62.5%;`
|
||||
/// @include media('>2.0rem') {}
|
||||
///
|
||||
/// /* Generates: */
|
||||
/// @media (min-width: 2.1rem) {}
|
||||
///
|
||||
$unit-intervals: (
|
||||
'px': 1,
|
||||
'em': 0.01,
|
||||
'rem': 0.1,
|
||||
'': 0
|
||||
) !default;
|
||||
|
||||
///
|
||||
/// Defines whether support for media queries is available, useful for creating separate stylesheets
|
||||
/// for browsers that don't support media queries.
|
||||
///
|
||||
/// @example scss - Disables support for media queries
|
||||
/// $im-media-support: false;
|
||||
/// @include media('>=tablet') {
|
||||
/// .foo {
|
||||
/// color: tomato;
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// /* Generates: */
|
||||
/// .foo {
|
||||
/// color: tomato;
|
||||
/// }
|
||||
///
|
||||
$im-media-support: true !default;
|
||||
|
||||
///
|
||||
/// Selects which breakpoint to emulate when support for media queries is disabled. Media queries that start at or
|
||||
/// intercept the breakpoint will be displayed, any others will be ignored.
|
||||
///
|
||||
/// @example scss - This media query will show because it intercepts the static breakpoint
|
||||
/// $im-media-support: false;
|
||||
/// $im-no-media-breakpoint: 'desktop';
|
||||
/// @include media('>=tablet') {
|
||||
/// .foo {
|
||||
/// color: tomato;
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// /* Generates: */
|
||||
/// .foo {
|
||||
/// color: tomato;
|
||||
/// }
|
||||
///
|
||||
/// @example scss - This media query will NOT show because it does not intercept the desktop breakpoint
|
||||
/// $im-media-support: false;
|
||||
/// $im-no-media-breakpoint: 'tablet';
|
||||
/// @include media('>=desktop') {
|
||||
/// .foo {
|
||||
/// color: tomato;
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// /* No output */
|
||||
///
|
||||
$im-no-media-breakpoint: 'desktop' !default;
|
||||
|
||||
///
|
||||
/// Selects which media expressions are allowed in an expression for it to be used when media queries
|
||||
/// are not supported.
|
||||
///
|
||||
/// @example scss - This media query will show because it intercepts the static breakpoint and contains only accepted media expressions
|
||||
/// $im-media-support: false;
|
||||
/// $im-no-media-breakpoint: 'desktop';
|
||||
/// $im-no-media-expressions: ('screen');
|
||||
/// @include media('>=tablet', 'screen') {
|
||||
/// .foo {
|
||||
/// color: tomato;
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// /* Generates: */
|
||||
/// .foo {
|
||||
/// color: tomato;
|
||||
/// }
|
||||
///
|
||||
/// @example scss - This media query will NOT show because it intercepts the static breakpoint but contains a media expression that is not accepted
|
||||
/// $im-media-support: false;
|
||||
/// $im-no-media-breakpoint: 'desktop';
|
||||
/// $im-no-media-expressions: ('screen');
|
||||
/// @include media('>=tablet', 'retina2x') {
|
||||
/// .foo {
|
||||
/// color: tomato;
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// /* No output */
|
||||
///
|
||||
$im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
|
||||
|
||||
////
|
||||
/// Cross-engine logging engine
|
||||
/// @author Hugo Giraudel
|
||||
/// @access private
|
||||
////
|
||||
|
||||
|
||||
///
|
||||
/// Log a message either with `@error` if supported
|
||||
/// else with `@warn`, using `feature-exists('at-error')`
|
||||
/// to detect support.
|
||||
///
|
||||
/// @param {String} $message - Message to log
|
||||
///
|
||||
@function im-log($message) {
|
||||
@if feature-exists('at-error') {
|
||||
@error $message;
|
||||
} @else {
|
||||
@warn $message;
|
||||
$_: noop();
|
||||
}
|
||||
|
||||
@return $message;
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Wrapper mixin for the log function so it can be used with a more friendly
|
||||
/// API than `@if im-log('..') {}` or `$_: im-log('..')`. Basically, use the function
|
||||
/// within functions because it is not possible to include a mixin in a function
|
||||
/// and use the mixin everywhere else because it's much more elegant.
|
||||
///
|
||||
/// @param {String} $message - Message to log
|
||||
///
|
||||
@mixin log($message) {
|
||||
@if im-log($message) {}
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Function with no `@return` called next to `@warn` in Sass 3.3
|
||||
/// to trigger a compiling error and stop the process.
|
||||
///
|
||||
@function noop() {}
|
||||
|
||||
///
|
||||
/// Determines whether a list of conditions is intercepted by the static breakpoint.
|
||||
///
|
||||
/// @param {Arglist} $conditions - Media query conditions
|
||||
///
|
||||
/// @return {Boolean} - Returns true if the conditions are intercepted by the static breakpoint
|
||||
///
|
||||
@function im-intercepts-static-breakpoint($conditions...) {
|
||||
$no-media-breakpoint-value: map-get($breakpoints, $im-no-media-breakpoint);
|
||||
|
||||
@if not $no-media-breakpoint-value {
|
||||
@if im-log('`#{$im-no-media-breakpoint}` is not a valid breakpoint.') {}
|
||||
}
|
||||
|
||||
@each $condition in $conditions {
|
||||
@if not map-has-key($media-expressions, $condition) {
|
||||
$operator: get-expression-operator($condition);
|
||||
$prefix: get-expression-prefix($operator);
|
||||
$value: get-expression-value($condition, $operator);
|
||||
|
||||
@if ($prefix == 'max' and $value <= $no-media-breakpoint-value) or
|
||||
($prefix == 'min' and $value > $no-media-breakpoint-value) {
|
||||
@return false;
|
||||
}
|
||||
} @else if not index($im-no-media-expressions, $condition) {
|
||||
@return false;
|
||||
}
|
||||
}
|
||||
|
||||
@return true;
|
||||
}
|
||||
|
||||
////
|
||||
/// Parsing engine
|
||||
/// @author Hugo Giraudel
|
||||
/// @access private
|
||||
////
|
||||
|
||||
|
||||
///
|
||||
/// Get operator of an expression
|
||||
///
|
||||
/// @param {String} $expression - Expression to extract operator from
|
||||
///
|
||||
/// @return {String} - Any of `>=`, `>`, `<=`, `<`, `≥`, `≤`
|
||||
///
|
||||
@function get-expression-operator($expression) {
|
||||
@each $operator in ('>=', '>', '<=', '<', '≥', '≤') {
|
||||
@if str-index($expression, $operator) {
|
||||
@return $operator;
|
||||
}
|
||||
}
|
||||
|
||||
// It is not possible to include a mixin inside a function, so we have to
|
||||
// rely on the `im-log(..)` function rather than the `log(..)` mixin. Because
|
||||
// functions cannot be called anywhere in Sass, we need to hack the call in
|
||||
// a dummy variable, such as `$_`. If anybody ever raise a scoping issue with
|
||||
// Sass 3.3, change this line in `@if im-log(..) {}` instead.
|
||||
$_: im-log('No operator found in `#{$expression}`.');
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Get dimension of an expression, based on a found operator
|
||||
///
|
||||
/// @param {String} $expression - Expression to extract dimension from
|
||||
/// @param {String} $operator - Operator from `$expression`
|
||||
///
|
||||
/// @return {String} - `width` or `height` (or potentially anything else)
|
||||
///
|
||||
@function get-expression-dimension($expression, $operator) {
|
||||
$operator-index: str-index($expression, $operator);
|
||||
$parsed-dimension: str-slice($expression, 0, $operator-index - 1);
|
||||
$dimension: 'width';
|
||||
|
||||
@if str-length($parsed-dimension) > 0 {
|
||||
$dimension: $parsed-dimension;
|
||||
}
|
||||
|
||||
@return $dimension;
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Get dimension prefix based on an operator
|
||||
///
|
||||
/// @param {String} $operator - Operator
|
||||
///
|
||||
/// @return {String} - `min` or `max`
|
||||
///
|
||||
@function get-expression-prefix($operator) {
|
||||
@return if(index(('<', '<=', '≤'), $operator), 'max', 'min');
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Get value of an expression, based on a found operator
|
||||
///
|
||||
/// @param {String} $expression - Expression to extract value from
|
||||
/// @param {String} $operator - Operator from `$expression`
|
||||
///
|
||||
/// @return {Number} - A numeric value
|
||||
///
|
||||
@function get-expression-value($expression, $operator) {
|
||||
$operator-index: str-index($expression, $operator);
|
||||
$value: str-slice($expression, $operator-index + str-length($operator));
|
||||
|
||||
@if map-has-key($breakpoints, $value) {
|
||||
$value: map-get($breakpoints, $value);
|
||||
} @else {
|
||||
$value: to-number($value);
|
||||
}
|
||||
|
||||
$interval: map-get($unit-intervals, unit($value));
|
||||
|
||||
@if not $interval {
|
||||
// It is not possible to include a mixin inside a function, so we have to
|
||||
// rely on the `im-log(..)` function rather than the `log(..)` mixin. Because
|
||||
// functions cannot be called anywhere in Sass, we need to hack the call in
|
||||
// a dummy variable, such as `$_`. If anybody ever raise a scoping issue with
|
||||
// Sass 3.3, change this line in `@if im-log(..) {}` instead.
|
||||
$_: im-log('Unknown unit `#{unit($value)}`.');
|
||||
}
|
||||
|
||||
@if $operator == '>' {
|
||||
$value: $value + $interval;
|
||||
} @else if $operator == '<' {
|
||||
$value: $value - $interval;
|
||||
}
|
||||
|
||||
@return $value;
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Parse an expression to return a valid media-query expression
|
||||
///
|
||||
/// @param {String} $expression - Expression to parse
|
||||
///
|
||||
/// @return {String} - Valid media query
|
||||
///
|
||||
@function parse-expression($expression) {
|
||||
// If it is part of $media-expressions, it has no operator
|
||||
// then there is no need to go any further, just return the value
|
||||
@if map-has-key($media-expressions, $expression) {
|
||||
@return map-get($media-expressions, $expression);
|
||||
}
|
||||
|
||||
$operator: get-expression-operator($expression);
|
||||
$dimension: get-expression-dimension($expression, $operator);
|
||||
$prefix: get-expression-prefix($operator);
|
||||
$value: get-expression-value($expression, $operator);
|
||||
|
||||
@return '(#{$prefix}-#{$dimension}: #{$value})';
|
||||
}
|
||||
|
||||
///
|
||||
/// Slice `$list` between `$start` and `$end` indexes
|
||||
///
|
||||
/// @access private
|
||||
///
|
||||
/// @param {List} $list - List to slice
|
||||
/// @param {Number} $start [1] - Start index
|
||||
/// @param {Number} $end [length($list)] - End index
|
||||
///
|
||||
/// @return {List} Sliced list
|
||||
///
|
||||
@function slice($list, $start: 1, $end: length($list)) {
|
||||
@if length($list) < 1 or $start > $end {
|
||||
@return ();
|
||||
}
|
||||
|
||||
$result: ();
|
||||
|
||||
@for $i from $start through $end {
|
||||
$result: append($result, nth($list, $i));
|
||||
}
|
||||
|
||||
@return $result;
|
||||
}
|
||||
|
||||
////
|
||||
/// String to number converter
|
||||
/// @author Hugo Giraudel
|
||||
/// @access private
|
||||
////
|
||||
|
||||
|
||||
///
|
||||
/// Casts a string into a number
|
||||
///
|
||||
/// @param {String | Number} $value - Value to be parsed
|
||||
///
|
||||
/// @return {Number}
|
||||
///
|
||||
@function to-number($value) {
|
||||
@if type-of($value) == 'number' {
|
||||
@return $value;
|
||||
} @else if type-of($value) != 'string' {
|
||||
$_: im-log('Value for `to-number` should be a number or a string.');
|
||||
}
|
||||
|
||||
$first-character: str-slice($value, 1, 1);
|
||||
$result: 0;
|
||||
$digits: 0;
|
||||
$minus: ($first-character == '-');
|
||||
$numbers: ('0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9);
|
||||
|
||||
// Remove +/- sign if present at first character
|
||||
@if ($first-character == '+' or $first-character == '-') {
|
||||
$value: str-slice($value, 2);
|
||||
}
|
||||
|
||||
@for $i from 1 through str-length($value) {
|
||||
$character: str-slice($value, $i, $i);
|
||||
|
||||
@if not (index(map-keys($numbers), $character) or $character == '.') {
|
||||
@return to-length(if($minus, -$result, $result), str-slice($value, $i))
|
||||
}
|
||||
|
||||
@if $character == '.' {
|
||||
$digits: 1;
|
||||
} @else if $digits == 0 {
|
||||
$result: $result * 10 + map-get($numbers, $character);
|
||||
} @else {
|
||||
$digits: $digits * 10;
|
||||
$result: $result + map-get($numbers, $character) / $digits;
|
||||
}
|
||||
}
|
||||
|
||||
@return if($minus, -$result, $result);
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Add `$unit` to `$value`
|
||||
///
|
||||
/// @param {Number} $value - Value to add unit to
|
||||
/// @param {String} $unit - String representation of the unit
|
||||
///
|
||||
/// @return {Number} - `$value` expressed in `$unit`
|
||||
///
|
||||
@function to-length($value, $unit) {
|
||||
$units: ('px': 1px, 'cm': 1cm, 'mm': 1mm, '%': 1%, 'ch': 1ch, 'pc': 1pc, 'in': 1in, 'em': 1em, 'rem': 1rem, 'pt': 1pt, 'ex': 1ex, 'vw': 1vw, 'vh': 1vh, 'vmin': 1vmin, 'vmax': 1vmax);
|
||||
|
||||
@if not index(map-keys($units), $unit) {
|
||||
$_: im-log('Invalid unit `#{$unit}`.');
|
||||
}
|
||||
|
||||
@return $value * map-get($units, $unit);
|
||||
}
|
||||
|
||||
///
|
||||
/// This mixin aims at redefining the configuration just for the scope of
|
||||
/// the call. It is helpful when having a component needing an extended
|
||||
/// configuration such as custom breakpoints (referred to as tweakpoints)
|
||||
/// for instance.
|
||||
///
|
||||
/// @author Hugo Giraudel
|
||||
///
|
||||
/// @param {Map} $tweakpoints [()] - Map of tweakpoints to be merged with `$breakpoints`
|
||||
/// @param {Map} $tweak-media-expressions [()] - Map of tweaked media expressions to be merged with `$media-expression`
|
||||
///
|
||||
/// @example scss - Extend the global breakpoints with a tweakpoint
|
||||
/// @include media-context(('custom': 678px)) {
|
||||
/// .foo {
|
||||
/// @include media('>phone', '<=custom') {
|
||||
/// // ...
|
||||
/// }
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// @example scss - Extend the global media expressions with a custom one
|
||||
/// @include media-context($tweak-media-expressions: ('all': 'all')) {
|
||||
/// .foo {
|
||||
/// @include media('all', '>phone') {
|
||||
/// // ...
|
||||
/// }
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// @example scss - Extend both configuration maps
|
||||
/// @include media-context(('custom': 678px), ('all': 'all')) {
|
||||
/// .foo {
|
||||
/// @include media('all', '>phone', '<=custom') {
|
||||
/// // ...
|
||||
/// }
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
@mixin media-context($tweakpoints: (), $tweak-media-expressions: ()) {
|
||||
// Save global configuration
|
||||
$global-breakpoints: $breakpoints;
|
||||
$global-media-expressions: $media-expressions;
|
||||
|
||||
// Update global configuration
|
||||
$breakpoints: map-merge($breakpoints, $tweakpoints) !global;
|
||||
$media-expressions: map-merge($media-expressions, $tweak-media-expressions) !global;
|
||||
|
||||
@content;
|
||||
|
||||
// Restore global configuration
|
||||
$breakpoints: $global-breakpoints !global;
|
||||
$media-expressions: $global-media-expressions !global;
|
||||
}
|
||||
|
||||
////
|
||||
/// include-media public exposed API
|
||||
/// @author Eduardo Boucas
|
||||
/// @access public
|
||||
////
|
||||
|
||||
|
||||
///
|
||||
/// Generates a media query based on a list of conditions
|
||||
///
|
||||
/// @param {Arglist} $conditions - Media query conditions
|
||||
///
|
||||
/// @example scss - With a single set breakpoint
|
||||
/// @include media('>phone') { }
|
||||
///
|
||||
/// @example scss - With two set breakpoints
|
||||
/// @include media('>phone', '<=tablet') { }
|
||||
///
|
||||
/// @example scss - With custom values
|
||||
/// @include media('>=358px', '<850px') { }
|
||||
///
|
||||
/// @example scss - With set breakpoints with custom values
|
||||
/// @include media('>desktop', '<=1350px') { }
|
||||
///
|
||||
/// @example scss - With a static expression
|
||||
/// @include media('retina2x') { }
|
||||
///
|
||||
/// @example scss - Mixing everything
|
||||
/// @include media('>=350px', '<tablet', 'retina3x') { }
|
||||
///
|
||||
@mixin media($conditions...) {
|
||||
@if ($im-media-support and length($conditions) == 0) or
|
||||
(not $im-media-support and im-intercepts-static-breakpoint($conditions...)) {
|
||||
@content;
|
||||
} @else if ($im-media-support and length($conditions) > 0) {
|
||||
@media #{unquote(parse-expression(nth($conditions, 1)))} {
|
||||
// Recursive call
|
||||
@include media(slice($conditions, 2)...) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,356 @@
|
||||
@import "_include-media";
|
||||
$breakpoints: (tablet: 560px, desktop: 900px);
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
$bg-color: #222; //#20141f;
|
||||
$text-color: #fff;
|
||||
$a-color: #fff;
|
||||
$ahover-color: #909090;
|
||||
|
||||
$header-bg-color: #111;
|
||||
$nav-bg-color: #222d;//#20141fd0;
|
||||
$nav-bg-color_hover: #333;//#20141fa0;
|
||||
|
||||
$desktop-width: 560px;
|
||||
|
||||
@mixin mobile {
|
||||
@media only screen and (max-width: #{$desktop-width - 1px}) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
@mixin desktop {
|
||||
@media only screen and (min-width: #{$desktop-width}) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: Verdana, Geneva, Tahoma, sans-serif;
|
||||
//font-size: 14px;
|
||||
|
||||
background-color: $bg-color;
|
||||
color: $text-color;
|
||||
}
|
||||
|
||||
a {
|
||||
color: $a-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
color: $ahover-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
header {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
|
||||
padding: 0 10px;
|
||||
|
||||
background-color: $header-bg-color;
|
||||
|
||||
> a.logo {
|
||||
font-size: 2em;
|
||||
margin: 6px;
|
||||
}
|
||||
|
||||
// @include mobile { font-size: 1.3em; }
|
||||
// @include desktop { font-size: 1.1em; }
|
||||
|
||||
@include media("<tablet") { position: relative; }
|
||||
> nav {
|
||||
flex-grow: 1;
|
||||
|
||||
display: flex;
|
||||
|
||||
> ._overlay {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@include media("<tablet") {
|
||||
display: none;
|
||||
|
||||
&._drop {
|
||||
display: flex;
|
||||
flex-flow: column nowrap;
|
||||
|
||||
position: absolute;
|
||||
margin: 0;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
|
||||
background-color: $nav-bg-color;
|
||||
}
|
||||
|
||||
> a, a#user-menu, .user_dropdown > a {
|
||||
padding: 12px;
|
||||
padding-left: 24px;
|
||||
//text-align: center;
|
||||
|
||||
&:hover, &:active {
|
||||
background-color: $nav-bg-color_hover;
|
||||
}
|
||||
}
|
||||
|
||||
.user {
|
||||
&::before {
|
||||
content: "";
|
||||
display: block;
|
||||
border-top: 1px solid grey;
|
||||
margin: 2px 12px;
|
||||
}
|
||||
#user-menu {
|
||||
display: block;
|
||||
|
||||
}
|
||||
.user_dropdown {
|
||||
display: flex;
|
||||
flex-flow: column nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
> ._overlay {
|
||||
display: block;
|
||||
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
background-color: #0006;
|
||||
|
||||
@at-root {
|
||||
html.oh { overflow: hidden; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@include media(">=tablet") {
|
||||
margin: 0px 5px;
|
||||
align-items: center;
|
||||
|
||||
> * {
|
||||
margin: 0 5px;
|
||||
padding: 6px 0;
|
||||
}
|
||||
|
||||
> .user {
|
||||
padding: 0;
|
||||
margin-left: auto;
|
||||
margin-right: 0;
|
||||
|
||||
#user-menu {
|
||||
display: block;
|
||||
padding: 6px 10px; //replication of nav/*
|
||||
}
|
||||
|
||||
position: relative;
|
||||
.user_dropdown {
|
||||
//display: none;
|
||||
opacity: .1; // BOI DAT HACK
|
||||
height: 0;
|
||||
width: 0;
|
||||
overflow: hidden;
|
||||
|
||||
a {
|
||||
padding: 10px;
|
||||
}
|
||||
a:hover {
|
||||
|
||||
background-color: $nav-bg-color_hover;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover > .user_dropdown {
|
||||
display: flex;
|
||||
flex-flow: column nowrap;
|
||||
|
||||
position: absolute;
|
||||
margin: 0;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
|
||||
background-color: $nav-bg-color;
|
||||
|
||||
opacity: 1; // BOI DAT HACK
|
||||
height: unset;
|
||||
width: unset;
|
||||
transition: .2s ease;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
> #nav-menu {
|
||||
display: none;
|
||||
|
||||
@include media("<tablet") {
|
||||
display: block;
|
||||
margin: 5px;
|
||||
margin-left: auto;
|
||||
|
||||
padding: 0 2px;
|
||||
align-self: center;
|
||||
font-size: 2em;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.main_wrap {
|
||||
// margin: 0 auto;
|
||||
max-width: 1200px;
|
||||
|
||||
display: flex;
|
||||
|
||||
padding: 8px;
|
||||
|
||||
h4 {
|
||||
margin: 0;
|
||||
margin-bottom: 10px;
|
||||
|
||||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
@include media("<desktop") {
|
||||
flex-flow: column nowrap;
|
||||
|
||||
// section {
|
||||
// margin: 0 10px;
|
||||
// }
|
||||
}
|
||||
@include media(">=desktop") {
|
||||
flex-flow: row nowrap;
|
||||
|
||||
}
|
||||
|
||||
> section.tag_panel {
|
||||
flex-shrink: 0;
|
||||
|
||||
|
||||
article.tags {
|
||||
// @include media(">=desktop") {
|
||||
// margin-left: 10px;
|
||||
// margin-top: 10px;
|
||||
// }
|
||||
|
||||
padding: 10px;
|
||||
|
||||
.tag_container {
|
||||
display: flex;
|
||||
|
||||
> span {
|
||||
margin: 2px 2px;
|
||||
padding: 6px 12px;
|
||||
|
||||
//text-align: center;
|
||||
border-radius: 4px;
|
||||
background-color: #0005;
|
||||
|
||||
> .fa-tag {
|
||||
font-size: .9em;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
> .count {
|
||||
// display: none;
|
||||
font-size: .8em;
|
||||
}
|
||||
// > a {
|
||||
// display: block;
|
||||
// }
|
||||
}
|
||||
}
|
||||
@include media("<desktop") {
|
||||
.tag_container {
|
||||
flex-flow: row wrap;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@include media(">=desktop") {
|
||||
.tag_container {
|
||||
flex-flow: column nowrap;
|
||||
align-items: start;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
overflow: hidden;
|
||||
> section.content {
|
||||
.posts {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
// margin-left: -4px;
|
||||
// margin-right: -4px;
|
||||
// margin-left: 0;
|
||||
// margin-right: 0;
|
||||
// margin: 0;
|
||||
// padding: 8px;
|
||||
// margin: 0 8px;
|
||||
// @include media(">=desktop") {
|
||||
// margin-right: 8px;
|
||||
// margin-top: 8px;
|
||||
// }
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
flex: /*10000*/350 0 350px;
|
||||
}
|
||||
|
||||
> figure {
|
||||
position: relative;
|
||||
margin: 8px;
|
||||
|
||||
|
||||
img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 4px;
|
||||
|
||||
transition: .2s ease;
|
||||
}
|
||||
&:hover img {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.pagin {
|
||||
margin: 10px auto;
|
||||
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
> a {
|
||||
display: block;
|
||||
|
||||
background-color: #0005;
|
||||
padding: 8px 12px;
|
||||
|
||||
margin: 0 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
footer {
|
||||
padding: 10px;
|
||||
|
||||
// background-color: $header-bg-color;
|
||||
|
||||
text-align: center;
|
||||
}
|
@ -0,0 +1,254 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!--<link rel="stylesheet" href="{{ url_for('static', filename='default.css')}}">-->
|
||||
{% assets "scss_all" %}
|
||||
<link rel="stylesheet" href="{{ ASSET_URL }}">
|
||||
{% endassets %}
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
|
||||
<title>YaDc</title>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href="#" class="logo">
|
||||
<span>YaDc</span>
|
||||
</a>
|
||||
<nav id="main-nav">
|
||||
<a href="#">Posts</a>
|
||||
<a href="#">Threads</a>
|
||||
<a href="#">Upload</a>
|
||||
|
||||
<div class="user">
|
||||
<a href="#" id="user-menu">KuxaBeast</a>
|
||||
<!--<span class="user fa fa-user"></span>-->
|
||||
<div class="user_dropdown">
|
||||
<a href="#">Profile</a>
|
||||
<a href="#">Settings</a>
|
||||
<a href="#">Log out</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="_overlay"></div>
|
||||
</nav>
|
||||
<span id="nav-menu" class="fa fa-bars"></span>
|
||||
</header>
|
||||
<div class="main_wrap">
|
||||
<section class="tag_panel">
|
||||
<article class="tags">
|
||||
<h4>Tags</h4>
|
||||
<div class="tag_container">
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">neko</a>
|
||||
<span class="count">10</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">works</a>
|
||||
<span class="count">2</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">anime</a>
|
||||
<span class="count">4</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">manga</a>
|
||||
<span class="count">7</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">original</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">azur lane</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">figure</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">touhou</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">photoshop</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">close</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">cropped</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">waifu2x</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
<section class="content">
|
||||
<div class="posts">
|
||||
<figure style="flex: 307.87 1 307.87px;">
|
||||
<a href="#">
|
||||
<img src="static/ryuzu/916993.png" alt="">
|
||||
</a>
|
||||
<!--<div class="thumb-info">
|
||||
<span>RyuZU²</span>
|
||||
<span>1920x1080</span>
|
||||
<span>1.5M</span>
|
||||
</div>-->
|
||||
</figure>
|
||||
<figure style="flex: 309.68 1 309.68px;">
|
||||
<img src="static/ryuzu/916500.jpg" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 157.98 1 157.98px;">
|
||||
<img src="static/pixiv/illust_76819896_20191017_131929.jpg" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 391.11 1 391.11px;">
|
||||
<img src="static/ryuzu/916132.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 220.00 1 220.00px;">
|
||||
<img src="static/pixiv/illust_75885180_20191105_174853.jpg" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 334.97 1 334.97px;">
|
||||
<img src="static/ryuzu/916486.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 155.53 1 155.53px;">
|
||||
<img src="static/pixiv/illust_71840908_20191117_162206.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 391.11 1 391.11px;">
|
||||
<img src="static/ryuzu/916269.jpg" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 131.98 1 131.98px;">
|
||||
<img src="static/pixiv/illust_72206228_20191026_131238.jpg" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 391.11 1 391.11px;">
|
||||
<img src="static/ryuzu/916234.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 157.75 1 157.75px;">
|
||||
<img src="static/pixiv/illust_66441619_20191117_162011.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 340.92 1 340.92px;">
|
||||
<img src="static/ryuzu/917345.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 155.28 1 155.28px;">
|
||||
<img src="static/pixiv/illust_71851314_20191017_131351.jpg" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 356.46 1 356.46px;">
|
||||
<img src="static/ryuzu/917364.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 155.55 1 155.55px;">
|
||||
<img src="static/pixiv/illust_74700365_20191026_131807.jpg" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 391.11 1 391.11px;">
|
||||
<img src="static/ryuzu/916232.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 229.12 1 229.12px;">
|
||||
<img src="static/pixiv/illust_73298123_20191017_131918.jpg" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 318.79 1 318.79px;">
|
||||
<img src="static/ryuzu/917571.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 155.56 1 155.56px;">
|
||||
<img src="static/pixiv/illust_72068885_20191017_131812.jpg" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 361.95 1 361.95px;">
|
||||
<img src="static/ryuzu/917362.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 329.28 1 329.28px;">
|
||||
<img src="static/pixiv/illust_74981463_20191010_180604.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 201.44 1 201.44px;">
|
||||
<img src="static/pixiv/illust_73112550_20191017_132201.jpg" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 134.56 1 134.56px;">
|
||||
<img src="static/pixiv/illust_58205189_20191117_161917.jpg" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 170.19 1 170.19px;">
|
||||
<img src="static/pixiv/illust_75746945_20191026_131754.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 155.54 1 155.54px;">
|
||||
<img src="static/pixiv/illust_77361639_20191026_131342.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 220.00 1 220.00px;">
|
||||
<img src="static/pixiv/illust_76970188_20191105_175035.jpg" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 134.89 1 134.89px;">
|
||||
<img src="static/pixiv/illust_77544221_20191117_162451.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 171.16 1 171.16px;">
|
||||
<img src="static/pixiv/illust_76606724_20191027_110006.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 107.11 1 107.11px;">
|
||||
<img src="static/pixiv/illust_71850098_20191017_131539.jpg" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 220.99 1 220.99px;">
|
||||
<img src="static/pixiv/illust_76418587_20191027_110252.png" alt="">
|
||||
</figure>
|
||||
<figure style="flex: 155.78 1 155.78px;">
|
||||
<img src="static/pixiv/illust_76629400_20191026_131307.jpg" alt="">
|
||||
</figure>
|
||||
</div>
|
||||
<div class="pagin">
|
||||
<a href="#"><span class="fa fa-chevron-left"></span></a>
|
||||
<a href="#">1</a>
|
||||
<a href="#">2</a>
|
||||
<a href="#">3</a>
|
||||
<a href="#">4</a>
|
||||
<a href="#">5</a>
|
||||
<a href="#"><span class="fa fa-chevron-right"></span></a>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
Produced by KuxaBeast
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
let nav_menu = document.querySelectorAll("#nav-menu, nav#main-nav > ._overlay")
|
||||
let nav_menu_event = function(ev) {
|
||||
let drop = document.getElementById("main-nav")
|
||||
let html = document.getElementsByTagName('html')[0]
|
||||
if (!drop.classList.contains("_drop")) {
|
||||
drop.classList.add("_drop")
|
||||
html.classList.add("oh")
|
||||
|
||||
window.scrollTo(0, 0);
|
||||
} else {
|
||||
drop.classList.remove("_drop")
|
||||
html.classList.remove("oh")
|
||||
}
|
||||
}
|
||||
nav_menu.forEach(element => {
|
||||
element.addEventListener('click', nav_menu_event)
|
||||
});
|
||||
|
||||
document.getElementById("user-menu").addEventListener('click', (ev) => {
|
||||
let drop = document.getElementsByClassName("user_dropdown")[0]
|
||||
if (!drop.classList.contains("_drop")) {
|
||||
drop.classList.add("_drop")
|
||||
} else {
|
||||
drop.classList.remove("_drop")
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,144 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!--<link rel="stylesheet" href="{{ url_for('static', filename='default.css')}}">-->
|
||||
{% assets "scss_all" %}
|
||||
<link rel="stylesheet" href="{{ ASSET_URL }}">
|
||||
{% endassets %}
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
|
||||
<title>YaDc</title>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href="#" class="logo">
|
||||
<span>YaDc</span>
|
||||
</a>
|
||||
<nav id="main-nav">
|
||||
<a href="#">Posts</a>
|
||||
<a href="#">Threads</a>
|
||||
<a href="#">Upload</a>
|
||||
|
||||
<div class="user">
|
||||
<a href="#" id="user-menu">KuxaBeast</a>
|
||||
<!--<span class="user fa fa-user"></span>-->
|
||||
<div class="user_dropdown">
|
||||
<a href="#">Profile</a>
|
||||
<a href="#">Settings</a>
|
||||
<a href="#">Log out</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="_overlay"></div>
|
||||
</nav>
|
||||
<span id="nav-menu" class="fa fa-bars"></span>
|
||||
</header>
|
||||
<div class="main_wrap">
|
||||
<section class="tag_panel">
|
||||
<article class="tags">
|
||||
<h4>Tags</h4>
|
||||
<div class="tag_container">
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">neko</a>
|
||||
<span class="count">10</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">works</a>
|
||||
<span class="count">2</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">anime</a>
|
||||
<span class="count">4</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">manga</a>
|
||||
<span class="count">7</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">original</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">azur lane</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">figure</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">touhou</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">photoshop</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">close</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">cropped</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fa fa-tag"></span>
|
||||
<a href="#">waifu2x</a>
|
||||
<span class="count">5</span>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
<section class="content">
|
||||
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
Produced by KuxaBeast
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
let nav_menu = document.querySelectorAll("#nav-menu, nav#main-nav > ._overlay")
|
||||
let nav_menu_event = function(ev) {
|
||||
let drop = document.getElementById("main-nav")
|
||||
let html = document.getElementsByTagName('html')[0]
|
||||
if (!drop.classList.contains("_drop")) {
|
||||
drop.classList.add("_drop")
|
||||
html.classList.add("oh")
|
||||
|
||||
window.scrollTo(0, 0);
|
||||
} else {
|
||||
drop.classList.remove("_drop")
|
||||
html.classList.remove("oh")
|
||||
}
|
||||
}
|
||||
nav_menu.forEach(element => {
|
||||
element.addEventListener('click', nav_menu_event)
|
||||
});
|
||||
|
||||
document.getElementById("user-menu").addEventListener('click', (ev) => {
|
||||
let drop = document.getElementsByClassName("user_dropdown")[0]
|
||||
if (!drop.classList.contains("_drop")) {
|
||||
drop.classList.add("_drop")
|
||||
} else {
|
||||
drop.classList.remove("_drop")
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue